]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'linux-2.6'
authorPaul Mackerras <paulus@samba.org>
Mon, 10 Dec 2007 04:41:22 +0000 (15:41 +1100)
committerPaul Mackerras <paulus@samba.org>
Mon, 10 Dec 2007 04:41:22 +0000 (15:41 +1100)
41 files changed:
Documentation/powerpc/booting-without-of.txt
arch/powerpc/Makefile
arch/powerpc/boot/Makefile
arch/powerpc/boot/wrapper
arch/powerpc/kernel/isa-bridge.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/mm/fault.c
arch/powerpc/platforms/8xx/m8xx_setup.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/celleb/io-workarounds.c
arch/powerpc/platforms/celleb/pci.c
arch/powerpc/platforms/celleb/scc_epci.c
arch/powerpc/platforms/embedded6xx/holly.c
arch/powerpc/platforms/iseries/pci.c
arch/powerpc/platforms/iseries/pci.h
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/iseries/setup.h
arch/powerpc/platforms/pasemi/Kconfig
arch/powerpc/platforms/pasemi/cpufreq.c
arch/powerpc/platforms/pasemi/gpio_mdio.c
arch/powerpc/platforms/pasemi/pasemi.h
arch/powerpc/platforms/pasemi/powersave.S
arch/powerpc/platforms/pasemi/setup.c
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/powermac/time.c
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/eeh_driver.c
arch/powerpc/platforms/pseries/plpar_wrappers.h
arch/powerpc/platforms/pseries/smp.c
arch/powerpc/sysdev/axonram.c
arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/sysdev/pmi.c
arch/powerpc/xmon/xmon.c
arch/ppc/platforms/ev64260.c
drivers/char/hw_random/Kconfig
drivers/char/hw_random/pasemi-rng.c
drivers/edac/pasemi_edac.c
drivers/macintosh/via-pmu.c
include/asm-powerpc/cputhreads.h [new file with mode: 0644]
include/asm-powerpc/ppc-pci.h

index e9a3cb1d6b06b18a3e0bba0d5a0bf85dc3fde77f..7327f37d78f3a57fbe4404508960b4def68fbe84 100644 (file)
@@ -711,13 +711,14 @@ define a bus type with a more complex address format, including things
 like address space bits, you'll have to add a bus translator to the
 prom_parse.c file of the recent kernels for your bus type.
 
-The "reg" property only defines addresses and sizes (if #size-cells
-is non-0) within a given bus. In order to translate addresses upward
+The "reg" property only defines addresses and sizes (if #size-cells is
+non-0) within a given bus. In order to translate addresses upward
 (that is into parent bus addresses, and possibly into CPU physical
 addresses), all busses must contain a "ranges" property. If the
 "ranges" property is missing at a given level, it's assumed that
-translation isn't possible. The format of the "ranges" property for a
-bus is a list of:
+translation isn't possible, i.e., the registers are not visible on the
+parent bus.  The format of the "ranges" property for a bus is a list
+of:
 
        bus address, parent bus address, size
 
@@ -735,6 +736,10 @@ fit in a single 32-bit word.   New 32-bit powerpc boards should use a
 1/1 format, unless the processor supports physical addresses greater
 than 32-bits, in which case a 2/1 format is recommended.
 
+Alternatively, the "ranges" property may be empty, indicating that the
+registers are visible on the parent bus using an identity mapping
+translation.  In other words, the parent bus address space is the same
+as the child bus address space.
 
 2) Note about "compatible" properties
 -------------------------------------
index bd87626c1f6041664ed777fcd4349116bb32ea32..f70df9b64f8f601c420e857d0fba4a4f9b85276d 100644 (file)
@@ -167,6 +167,9 @@ boot := arch/$(ARCH)/boot
 $(BOOT_TARGETS): vmlinux
        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
+bootwrapper_install:
+       $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
 define archhelp
   @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
   @echo '  install         - Install kernel using'
index 18e32719d0ed4544202bae47cc9c1361e6116649..e1c73e9afa5997dddb79f0356d493fd09745cbcc 100644 (file)
@@ -243,3 +243,51 @@ clean-kernel := vmlinux.strip vmlinux.bin
 clean-kernel += $(addsuffix .gz,$(clean-kernel))
 # If not absolute clean-files are relative to $(obj).
 clean-files += $(addprefix $(objtree)/, $(clean-kernel))
+
+WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
+WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
+WRAPPER_BINDIR := /usr/sbin
+INSTALL := install
+
+extra-installed                := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
+hostprogs-installed    := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
+wrapper-installed      := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
+dts-installed          := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
+
+all-installed          := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
+
+quiet_cmd_mkdir           = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+      cmd_mkdir           = mkdir -p $@
+
+quiet_cmd_install        = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
+      cmd_install        = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
+
+quiet_cmd_install_dts    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
+      cmd_install_dts    = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
+
+quiet_cmd_install_exe    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
+      cmd_install_exe    = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
+
+quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
+      cmd_install_wrapper = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
+                               sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
+                                         -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
+
+
+$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
+       $(call cmd,mkdir)
+
+$(extra-installed)     : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
+       $(call cmd,install)
+
+$(hostprogs-installed)  : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
+       $(call cmd,install_exe)
+
+$(dts-installed)       : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
+       $(call cmd,install_dts)
+
+$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
+       $(call cmd,install_wrapper)
+
+$(obj)/bootwrapper_install: $(all-installed)
+
index 31147a0377283e179b473aa4fa4c9f720ce8ed48..a591ced478758f00b38cf4f7d0ee24f6cc931ab7 100755 (executable)
@@ -45,6 +45,7 @@ CROSS=
 
 # directory for object and other files used by this script
 object=arch/powerpc/boot
+objbin=$object
 
 # directory for working files
 tmpdir=.
@@ -95,6 +96,7 @@ while [ "$#" -gt 0 ]; do
        shift
        [ "$#" -gt 0 ] || usage
        object="$1"
+       objbin="$1"
        ;;
     -W)
        shift
@@ -116,6 +118,9 @@ while [ "$#" -gt 0 ]; do
 done
 
 if [ -n "$dts" ]; then
+    if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
+       dts="$object/dts/$dts"
+    fi
     if [ -z "$dtb" ]; then
        dtb="$platform.dtb"
     fi
@@ -246,11 +251,11 @@ fi
 # post-processing needed for some platforms
 case "$platform" in
 pseries|chrp)
-    $object/addnote "$ofile"
+    $objbin/addnote "$ofile"
     ;;
 coff)
     ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
-    $object/hack-coff "$ofile"
+    $objbin/hack-coff "$ofile"
     ;;
 cuboot*)
     gzip -f -9 "$ofile"
@@ -259,7 +264,7 @@ cuboot*)
     ;;
 treeboot*)
     mv "$ofile" "$ofile.elf"
-    $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
+    $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
     if [ -z "$cacheit" ]; then
        rm -f "$ofile.elf"
     fi
@@ -287,8 +292,6 @@ ps3)
     overlay_dest="256"
     overlay_size="256"
 
-    rm -f "$object/otheros.bld"
-
     ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
 
     dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
@@ -299,6 +302,8 @@ ps3)
         skip=$system_reset_overlay seek=$overlay_dest \
         count=$overlay_size bs=1
 
-    gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
+    odir="$(dirname "$ofile.bin")"
+    rm -f "$odir/otheros.bld"
+    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
     ;;
 esac
index f0f49d1be3d5e156d8327b3783cf69541e77335a..965bfcc9ad2d6e5a8887933876b3ac8db7bd59c3 100644 (file)
@@ -108,7 +108,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
        if (size > 0x10000)
                size = 0x10000;
 
-       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
+       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
               "mapping 64k\n");
 
        __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
@@ -116,7 +116,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
        return;
 
 inval_range:
-       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
+       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
               "mapping 64k\n");
        __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
                     0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED);
index 2ae3b6f778a3c4e5cff5922c10c96a705d44c2de..15ec71a84f78fcccb617876b34f36042a2d77f32 100644 (file)
@@ -48,9 +48,7 @@
 static DEFINE_SPINLOCK(hose_spinlock);
 
 /* XXX kill that some day ... */
-int global_phb_number;         /* Global phb counter */
-
-extern struct list_head hose_list;
+static int global_phb_number;          /* Global phb counter */
 
 /*
  * pci_controller(phb) initialized common variables.
index 2de00f870edc34438352ae71ed54c7013228b7fa..6adb5a1e98bb8f2a46eac766b03288ac8e4b1f7e 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
 #include <linux/debugfs.h>
+#include <linux/percpu.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
@@ -57,6 +58,7 @@
 #include <asm/mmu.h>
 #include <asm/lmb.h>
 #include <asm/xmon.h>
+#include <asm/cputhreads.h>
 
 #include "setup.h"
 
@@ -327,6 +329,31 @@ void __init check_for_initrd(void)
 
 #ifdef CONFIG_SMP
 
+int threads_per_core, threads_shift;
+cpumask_t threads_core_mask;
+
+static void __init cpu_init_thread_core_maps(int tpc)
+{
+       int i;
+
+       threads_per_core = tpc;
+       threads_core_mask = CPU_MASK_NONE;
+
+       /* This implementation only supports power of 2 number of threads
+        * for simplicity and performance
+        */
+       threads_shift = ilog2(tpc);
+       BUG_ON(tpc != (1 << threads_shift));
+
+       for (i = 0; i < tpc; i++)
+               cpu_set(i, threads_core_mask);
+
+       printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
+              tpc, tpc > 1 ? "s" : "");
+       printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
+}
+
+
 /**
  * setup_cpu_maps - initialize the following cpu maps:
  *                  cpu_possible_map
@@ -350,22 +377,32 @@ void __init smp_setup_cpu_maps(void)
 {
        struct device_node *dn = NULL;
        int cpu = 0;
+       int nthreads = 1;
+
+       DBG("smp_setup_cpu_maps()\n");
 
        while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
                const int *intserv;
-               int j, len = sizeof(u32), nthreads = 1;
+               int j, len;
+
+               DBG("  * %s...\n", dn->full_name);
 
                intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
                                &len);
-               if (intserv)
+               if (intserv) {
                        nthreads = len / sizeof(int);
-               else {
+                       DBG("    ibm,ppc-interrupt-server#s -> %d threads\n",
+                           nthreads);
+               } else {
+                       DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
                        intserv = of_get_property(dn, "reg", NULL);
                        if (!intserv)
                                intserv = &cpu; /* assume logical == phys */
                }
 
                for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
+                       DBG("    thread %d -> cpu %d (hard id %d)\n",
+                           j, cpu, intserv[j]);
                        cpu_set(cpu, cpu_present_map);
                        set_hard_smp_processor_id(cpu, intserv[j]);
                        cpu_set(cpu, cpu_possible_map);
@@ -373,6 +410,12 @@ void __init smp_setup_cpu_maps(void)
                }
        }
 
+       /* If no SMT supported, nthreads is forced to 1 */
+       if (!cpu_has_feature(CPU_FTR_SMT)) {
+               DBG("  SMT disabled ! nthreads forced to 1\n");
+               nthreads = 1;
+       }
+
 #ifdef CONFIG_PPC64
        /*
         * On pSeries LPAR, we need to know how many cpus
@@ -395,7 +438,7 @@ void __init smp_setup_cpu_maps(void)
 
                /* Double maxcpus for processors which have SMT capability */
                if (cpu_has_feature(CPU_FTR_SMT))
-                       maxcpus *= 2;
+                       maxcpus *= nthreads;
 
                if (maxcpus > NR_CPUS) {
                        printk(KERN_WARNING
@@ -412,9 +455,16 @@ void __init smp_setup_cpu_maps(void)
        out:
                of_node_put(dn);
        }
-
        vdso_data->processorCount = num_present_cpus();
 #endif /* CONFIG_PPC64 */
+
+        /* Initialize CPU <=> thread mapping/
+        *
+        * WARNING: We assume that the number of threads is the same for
+        * every CPU in the system. If that is not the case, then some code
+        * here will have to be reworked
+        */
+       cpu_init_thread_core_maps(nthreads);
 }
 
 /*
@@ -424,17 +474,19 @@ void __init smp_setup_cpu_maps(void)
  */
 void __init smp_setup_cpu_sibling_map(void)
 {
-#if defined(CONFIG_PPC64)
-       int cpu;
+#ifdef CONFIG_PPC64
+       int i, cpu, base;
 
-       /*
-        * Do the sibling map; assume only two threads per processor.
-        */
        for_each_possible_cpu(cpu) {
-               cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
-               if (cpu_has_feature(CPU_FTR_SMT))
-                       cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
+               DBG("Sibling map for CPU %d:", cpu);
+               base = cpu_first_thread_in_core(cpu);
+               for (i = 0; i < threads_per_core; i++) {
+                       cpu_set(base + i, per_cpu(cpu_sibling_map, cpu));
+                       DBG(" %d", base + i);
+               }
+               DBG("\n");
        }
+
 #endif /* CONFIG_PPC64 */
 }
 #endif /* CONFIG_SMP */
index 8135da06e0a44e4e320e7157e3b9fec364e67793..10dda224a3611128913cca2357affd92ca7ff48a 100644 (file)
@@ -189,7 +189,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
                        return SIGSEGV;
                /* in_atomic() in user mode is really bad,
                   as is current->mm == NULL. */
-               printk(KERN_EMERG "Page fault in user mode with"
+               printk(KERN_EMERG "Page fault in user mode with "
                       "in_atomic() = %d mm = %p\n", in_atomic(), mm);
                printk(KERN_EMERG "NIP = %lx  MSR = %lx\n",
                       regs->nip, regs->msr);
index d35eda80e9e62376ae882636cf0159ec19bce8a1..ba645c2b63f62f61677eecb85a9abacbcf79b329 100644 (file)
@@ -120,7 +120,7 @@ void __init mpc8xx_calibrate_decr(void)
        ppc_tb_freq /= 16;
        ppc_proc_freq = 50000000;
        if (!get_freq("clock-frequency", &ppc_proc_freq))
-               printk(KERN_ERR "WARNING: Estimating processor frequency"
+               printk(KERN_ERR "WARNING: Estimating processor frequency "
                                "(not found)\n");
 
        printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
index e4438456c8675c8917052ba9e95cdd8a9e828809..efb3964457b1db4451c1c75d97dbf03e2c40ca0b 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/firmware.h>
 #include <asm/system.h>
 #include <asm/rtas.h>
+#include <asm/cputhreads.h>
 
 #include "interrupt.h"
 #include <asm/udbg.h>
@@ -182,7 +183,7 @@ static int smp_cell_cpu_bootable(unsigned int nr)
         */
        if (system_state < SYSTEM_RUNNING &&
            cpu_has_feature(CPU_FTR_SMT) &&
-           !smt_enabled_at_boot && nr % 2 != 0)
+           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
                return 0;
 
        return 1;
index 2b912140bcbb6feee382aead23826adfcde27d5b..32b9cecfda1566a28204b85b808911d456038279 100644 (file)
@@ -256,7 +256,7 @@ int __init celleb_pci_workaround_init(void)
 
        celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
        if (!celleb_dummy_page_va) {
-               printk(KERN_ERR "Celleb: dummy read disabled."
+               printk(KERN_ERR "Celleb: dummy read disabled. "
                        "Alloc celleb_dummy_page_va failed\n");
                return 1;
        }
index 6bc32fda7a6b3e51716b2d01f40b29aaf19ad695..13ec4a606b9611d6715c39990eeda0a47ffe67c7 100644 (file)
@@ -138,8 +138,6 @@ static void celleb_config_read_fake(unsigned char *config, int where,
                *val = celleb_fake_config_readl(p);
                break;
        }
-
-       return;
 }
 
 static void celleb_config_write_fake(unsigned char *config, int where,
@@ -158,7 +156,6 @@ static void celleb_config_write_fake(unsigned char *config, int where,
                celleb_fake_config_writel(val, p);
                break;
        }
-       return;
 }
 
 static int celleb_fake_pci_read_config(struct pci_bus *bus,
@@ -351,6 +348,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node,
        wi1 = of_get_property(node, "vendor-id", NULL);
        wi2 = of_get_property(node, "class-code", NULL);
        wi3 = of_get_property(node, "revision-id", NULL);
+       if (!wi0 || !wi1 || !wi2 || !wi3) {
+               printk(KERN_ERR "PCI: Missing device tree properties.\n");
+               goto error;
+       }
 
        celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff);
        celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff);
@@ -372,6 +373,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node,
        celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr);
 
        li = of_get_property(node, "interrupts", &rlen);
+       if (!li) {
+               printk(KERN_ERR "PCI: interrupts not found.\n");
+               goto error;
+       }
        val = li[0];
        celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1);
        celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val);
index 9d076426676c696874375f8474f11f9a502f6819..a3c7cfbcb323049da70590529d8e20dea251fda5 100644 (file)
@@ -95,7 +95,7 @@ void __init epci_workaround_init(struct pci_controller *hose)
        private->dummy_page_da = dma_map_single(hose->parent,
                celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
        if (private->dummy_page_da == DMA_ERROR_CODE) {
-               printk(KERN_ERR "EPCI: dummy read disabled."
+               printk(KERN_ERR "EPCI: dummy read disabled. "
                       "Map dummy page failed.\n");
                return;
        }
index b6de2b5223dd4682b61d9c9708b68c978c782059..ce91787f3c7c39789e094e31219a6079040e9367 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/serial_core.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -39,7 +40,6 @@
 #include <asm/tsi108_irq.h>
 #include <asm/tsi108_pci.h>
 #include <asm/mpic.h>
-#include <asm/of_platform.h>
 
 #undef DEBUG
 
index da87162000f0b25aa38c9189622a7105412b1272..a74d1e1966ddf68afbd1e30310df9f1c5cb2def1 100644 (file)
@@ -87,7 +87,7 @@ static DEFINE_SPINLOCK(iomm_table_lock);
  * - CurrentIndex is incremented to keep track of the last entry.
  * - Builds the resource entry for allocated BARs.
  */
-static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
+static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
 {
        struct resource *bar_res = &dev->resource[bar_num];
        long bar_size = pci_resource_len(dev, bar_num);
@@ -130,7 +130,7 @@ static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
  * - Loops through The Bar resources(0 - 5) including the ROM
  *   is resource(6).
  */
-static void allocate_device_bars(struct pci_dev *dev)
+static void __init allocate_device_bars(struct pci_dev *dev)
 {
        int bar_num;
 
index 33a8489fde54c636260781a944aa82b2549348e7..730986bc917a7ecde3c724075bc147bf62423394 100644 (file)
@@ -59,5 +59,10 @@ static inline u64 iseries_ds_addr(struct device_node *node)
 }
 
 extern void    iSeries_Device_Information(struct pci_dev*, int);
+#ifdef CONFIG_PCI
+extern void    iSeries_pci_final_fixup(void);
+#else
+static void    iSeries_pci_final_fixup(void) { }
+#endif
 
 #endif /* _PLATFORMS_ISERIES_PCI_H */
index 0877a88341100e7cdf25a49c3167f0c3a94fdffc..2175a71800d56f1cc88c371f5933f9ab03918e19 100644 (file)
@@ -63,6 +63,7 @@
 #include "main_store.h"
 #include "call_sm.h"
 #include "call_hpt.h"
+#include "pci.h"
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
 static unsigned long build_iSeries_Memory_Map(void);
 static void iseries_shared_idle(void);
 static void iseries_dedicated_idle(void);
-#ifdef CONFIG_PCI
-extern void iSeries_pci_final_fixup(void);
-#else
-static void iSeries_pci_final_fixup(void) { }
-#endif
 
 
 struct MemoryBlock {
@@ -112,13 +108,13 @@ static unsigned long iSeries_process_Condor_mainstore_vpd(
         * correctly.
         */
        mb_array[0].logicalStart = 0;
-       mb_array[0].logicalEnd = 0x100000000;
+       mb_array[0].logicalEnd = 0x100000000UL;
        mb_array[0].absStart = 0;
-       mb_array[0].absEnd = 0x100000000;
+       mb_array[0].absEnd = 0x100000000UL;
 
        if (holeSize) {
                numMemoryBlocks = 2;
-               holeStart = holeStart & 0x000fffffffffffff;
+               holeStart = holeStart & 0x000fffffffffffffUL;
                holeStart = addr_to_chunk(holeStart);
                holeFirstChunk = holeStart;
                holeSize = addr_to_chunk(holeSize);
@@ -128,9 +124,9 @@ static unsigned long iSeries_process_Condor_mainstore_vpd(
                mb_array[0].logicalEnd = holeFirstChunk;
                mb_array[0].absEnd = holeFirstChunk;
                mb_array[1].logicalStart = holeFirstChunk;
-               mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks;
+               mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks;
                mb_array[1].absStart = holeFirstChunk + holeSizeChunks;
-               mb_array[1].absEnd = 0x100000000;
+               mb_array[1].absEnd = 0x100000000UL;
        }
        return numMemoryBlocks;
 }
@@ -234,9 +230,9 @@ static unsigned long iSeries_process_Regatta_mainstore_vpd(
                                mb_array[i].logicalEnd,
                                mb_array[i].absStart, mb_array[i].absEnd);
                mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart &
-                               0x000fffffffffffff);
+                               0x000fffffffffffffUL);
                mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd &
-                               0x000fffffffffffff);
+                               0x000fffffffffffffUL);
                mb_array[i].logicalStart =
                        addr_to_chunk(mb_array[i].logicalStart);
                mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd);
@@ -320,7 +316,7 @@ struct mschunks_map mschunks_map = {
 };
 EXPORT_SYMBOL(mschunks_map);
 
-void mschunks_alloc(unsigned long num_chunks)
+static void mschunks_alloc(unsigned long num_chunks)
 {
        klimit = _ALIGN(klimit, sizeof(u32));
        mschunks_map.mapping = (u32 *)klimit;
index 0a47ac53c95970a0fbf958410829c0a2cc97d9e3..729754bbb0189054f1fc28311ce13f66c6e341af 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef        __ISERIES_SETUP_H__
 #define        __ISERIES_SETUP_H__
 
+extern void *iSeries_early_setup(void);
 extern unsigned long iSeries_get_boot_time(void);
 extern int iSeries_set_rtc_time(struct rtc_time *tm);
 extern void iSeries_get_rtc_time(struct rtc_time *tm);
index 735e1536cbfc15dc93a01d517d55245190694ab6..2f4dd6e4aac112b44d57cdbbcad734c4adac901e 100644 (file)
@@ -17,7 +17,7 @@ config PPC_PASEMI_IOMMU
        bool "PA Semi IOMMU support"
        depends on PPC_PASEMI
        help
-         IOMMU support for PA6T-1682M
+         IOMMU support for PA Semi PWRficient
 
 config PPC_PASEMI_IOMMU_DMA_FORCE
        bool "Force DMA engine to use IOMMU"
index 1cfb8b0c8fecd512f6b26564138a9df52b148c17..58556b028a4c142b9886fe78c48b69a752c8fd2c 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/time.h>
+#include <asm/smp.h>
 
 #define SDCASR_REG             0x0100
 #define SDCASR_REG_STRIDE      0x1000
@@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned int astate)
        local_irq_restore(flags);
 }
 
+int check_astate(void)
+{
+       return get_cur_astate(hard_smp_processor_id());
+}
+
 void restore_astate(int cpu)
 {
        set_astate(cpu, current_astate);
@@ -147,7 +153,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
        if (!cpu)
                goto out;
 
-       dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
+       dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
+       if (!dn)
+               dn = of_find_compatible_node(NULL, NULL,
+                                            "pasemi,pwrficient-sdc");
        if (!dn)
                goto out;
        err = of_address_to_resource(dn, 0, &res);
@@ -160,7 +169,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
                goto out;
        }
 
-       dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
+       dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
+       if (!dn)
+               dn = of_find_compatible_node(NULL, NULL,
+                                            "pasemi,pwrficient-gizmo");
        if (!dn) {
                err = -ENODEV;
                goto out_unmap_sdcasr;
@@ -292,7 +304,8 @@ static struct cpufreq_driver pas_cpufreq_driver = {
 
 static int __init pas_cpufreq_init(void)
 {
-       if (!machine_is_compatible("PA6T-1682M"))
+       if (!machine_is_compatible("PA6T-1682M") &&
+           !machine_is_compatible("pasemi,pwrficient"))
                return -ENODEV;
 
        return cpufreq_register_driver(&pas_cpufreq_driver);
index dae9f658122e4ef47dffa02ba5877cd73bac2c52..b46542990cf8288338c34c80a169d8364e942a56 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/interrupt.h>
 #include <linux/phy.h>
 #include <linux/platform_device.h>
-#include <asm/of_platform.h>
+#include <linux/of_platform.h>
 
 #define DELAY 1
 
@@ -218,45 +218,27 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
                                     const struct of_device_id *match)
 {
        struct device *dev = &ofdev->dev;
-       struct device_node *np = ofdev->node;
-       struct device_node *gpio_np;
+       struct device_node *phy_dn, *np = ofdev->node;
        struct mii_bus *new_bus;
-       struct resource res;
        struct gpio_priv *priv;
        const unsigned int *prop;
-       int err = 0;
+       int err;
        int i;
 
-       gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
-
-       if (!gpio_np)
-               return -ENODEV;
-
-       err = of_address_to_resource(gpio_np, 0, &res);
-       of_node_put(gpio_np);
-
-       if (err)
-               return -EINVAL;
-
-       if (!gpio_regs)
-               gpio_regs = ioremap(res.start, 0x100);
-
-       if (!gpio_regs)
-               return -EPERM;
-
+       err = -ENOMEM;
        priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
-       if (priv == NULL)
-               return -ENOMEM;
+       if (!priv)
+               goto out;
 
        new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
 
-       if (new_bus == NULL)
-               return -ENOMEM;
+       if (!new_bus)
+               goto out_free_priv;
 
-       new_bus->name = "pasemi gpio mdio bus",
-       new_bus->read = &gpio_mdio_read,
-       new_bus->write = &gpio_mdio_write,
-       new_bus->reset = &gpio_mdio_reset,
+       new_bus->name = "pasemi gpio mdio bus";
+       new_bus->read = &gpio_mdio_read;
+       new_bus->write = &gpio_mdio_write;
+       new_bus->reset = &gpio_mdio_reset;
 
        prop = of_get_property(np, "reg", NULL);
        new_bus->id = *prop;
@@ -265,9 +247,24 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
        new_bus->phy_mask = 0;
 
        new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
-       for(i = 0; i < PHY_MAX_ADDR; ++i)
-               new_bus->irq[i] = irq_create_mapping(NULL, 10);
 
+       if (!new_bus->irq)
+               goto out_free_bus;
+
+       for (i = 0; i < PHY_MAX_ADDR; i++)
+               new_bus->irq[i] = NO_IRQ;
+
+       for (phy_dn = of_get_next_child(np, NULL);
+            phy_dn != NULL;
+            phy_dn = of_get_next_child(np, phy_dn)) {
+               const unsigned int *ip, *regp;
+
+               ip = of_get_property(phy_dn, "interrupts", NULL);
+               regp = of_get_property(phy_dn, "reg", NULL);
+               if (!ip || !regp || *regp >= PHY_MAX_ADDR)
+                       continue;
+               new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
+       }
 
        prop = of_get_property(np, "mdc-pin", NULL);
        priv->mdc_pin = *prop;
@@ -280,17 +277,21 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
 
        err = mdiobus_register(new_bus);
 
-       if (0 != err) {
+       if (err != 0) {
                printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
                                new_bus->name, err);
-               goto bus_register_fail;
+               goto out_free_irq;
        }
 
        return 0;
 
-bus_register_fail:
+out_free_irq:
+       kfree(new_bus->irq);
+out_free_bus:
        kfree(new_bus);
-
+out_free_priv:
+       kfree(priv);
+out:
        return err;
 }
 
@@ -317,6 +318,7 @@ static struct of_device_id gpio_mdio_match[] =
        },
        {},
 };
+MODULE_DEVICE_TABLE(of, gpio_mdio_match);
 
 static struct of_platform_driver gpio_mdio_driver =
 {
@@ -330,12 +332,32 @@ static struct of_platform_driver gpio_mdio_driver =
 
 int gpio_mdio_init(void)
 {
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
+       if (!np)
+               np = of_find_compatible_node(NULL, NULL,
+                                            "pasemi,pwrficient-gpio");
+       if (!np)
+               return -ENODEV;
+       gpio_regs = of_iomap(np, 0);
+       of_node_put(np);
+
+       if (!gpio_regs)
+               return -ENODEV;
+
        return of_register_platform_driver(&gpio_mdio_driver);
 }
+module_init(gpio_mdio_init);
 
 void gpio_mdio_exit(void)
 {
        of_unregister_platform_driver(&gpio_mdio_driver);
+       if (gpio_regs)
+               iounmap(gpio_regs);
 }
-device_initcall(gpio_mdio_init);
+module_exit(gpio_mdio_exit);
 
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Olof Johansson <olof@lixom.net>");
+MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards");
index 516acabb4e96a4151b42e2833e907feb633c6ae2..c96127b029b653c4dd8e7d7c7e23864323d30152 100644 (file)
@@ -16,8 +16,14 @@ extern void idle_doze(void);
 
 /* Restore astate to last set */
 #ifdef CONFIG_PPC_PASEMI_CPUFREQ
+extern int check_astate(void);
 extern void restore_astate(int cpu);
 #else
+static inline int check_astate(void)
+{
+       /* Always return >0 so we never power save */
+       return 1;
+}
 static inline void restore_astate(int cpu)
 {
 }
index 6d0fba6aab174fbaf52bc2136f7983048fce91b4..56f45adcd0895aceb35f7be4ef800b2c39e60b77 100644 (file)
@@ -62,7 +62,16 @@ sleep_common:
        mflr    r0
        std     r0, 16(r1)
        stdu    r1,-64(r1)
+#ifdef CONFIG_PPC_PASEMI_CPUFREQ
+       std     r3, 48(r1)
 
+       /* Only do power savings when in astate 0 */
+       bl      .check_astate
+       cmpwi   r3,0
+       bne     1f
+
+       ld      r3, 48(r1)
+#endif
        LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
        mfmsr   r4
        andc    r5,r4,r6
@@ -73,7 +82,7 @@ sleep_common:
 
        mtmsrd  r4,0
 
-       addi    r1,r1,64
+1:     addi    r1,r1,64
        ld      r0,16(r1)
        mtlr    r0
        blr
index 3d62060498b4256151a3e63aa28e94350552fcec..5748194a667fcffa4f5d67c7eb65b987cd5e925f 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/delay.h>
 #include <linux/console.h>
 #include <linux/pci.h>
+#include <linux/of_platform.h>
 
 #include <asm/prom.h>
 #include <asm/system.h>
@@ -35,7 +36,6 @@
 #include <asm/mpic.h>
 #include <asm/smp.h>
 #include <asm/time.h>
-#include <asm/of_platform.h>
 
 #include <pcmcia/ss.h>
 #include <pcmcia/cistpl.h>
 
 #include "pasemi.h"
 
+#if !defined(CONFIG_SMP)
+static void smp_send_stop(void) {}
+#endif
+
 /* SDC reset register, must be pre-mapped at reset time */
 static void __iomem *reset_reg;
 
@@ -60,6 +64,9 @@ static int num_mce_regs;
 
 static void pas_restart(char *cmd)
 {
+       /* Need to put others cpu in hold loop so they're not sleeping */
+       smp_send_stop();
+       udelay(10000);
        printk("Restarting...\n");
        while (1)
                out_le32(reset_reg, 0x6000000);
@@ -362,8 +369,12 @@ static inline void pasemi_pcmcia_init(void)
 
 
 static struct of_device_id pasemi_bus_ids[] = {
+       /* Unfortunately needed for legacy firmwares */
        { .type = "localbus", },
        { .type = "sdc", },
+       /* These are the proper entries, which newer firmware uses */
+       { .compatible = "pasemi,localbus", },
+       { .compatible = "pasemi,sdc", },
        {},
 };
 
@@ -389,7 +400,8 @@ static int __init pas_probe(void)
 {
        unsigned long root = of_get_flat_dt_root();
 
-       if (!of_flat_dt_is_compatible(root, "PA6T-1682M"))
+       if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
+           !of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
                return 0;
 
        hpte_init_native();
@@ -400,7 +412,7 @@ static int __init pas_probe(void)
 }
 
 define_machine(pasemi) {
-       .name                   = "PA Semi PA6T-1682M",
+       .name                   = "PA Semi PWRficient",
        .probe                  = pas_probe,
        .setup_arch             = pas_setup_arch,
        .init_early             = pas_init_early,
index 02c533096627851363c3864232b53d130659ed8b..3acb59d5cdf56c9c260dd0952b2fe866ec7daf29 100644 (file)
@@ -51,6 +51,8 @@
 #include <linux/root_dev.h>
 #include <linux/bitops.h>
 #include <linux/suspend.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
 
 #include <asm/reg.h>
 #include <asm/sections.h>
@@ -68,8 +70,6 @@
 #include <asm/btext.h>
 #include <asm/pmac_feature.h>
 #include <asm/time.h>
-#include <asm/of_device.h>
-#include <asm/of_platform.h>
 #include <asm/mmu_context.h>
 #include <asm/iommu.h>
 #include <asm/smu.h>
index bf9da56942e8df6bbfdaeea285d7584961970000..bbbefd64ab5991f3c30c5e7d34a074a3e224d326 100644 (file)
@@ -84,12 +84,14 @@ long __init pmac_time_init(void)
        return delta;
 }
 
+#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
 static void to_rtc_time(unsigned long now, struct rtc_time *tm)
 {
        to_tm(now, tm);
        tm->tm_year -= 1900;
        tm->tm_mon -= 1;
 }
+#endif
 
 static unsigned long from_rtc_time(struct rtc_time *tm)
 {
index fb3d636e088be7eaf049d5af89dcf8e72add7cee..aa14a8559edb99480cd65b63c15b27546b4ba50a 100644 (file)
@@ -480,6 +480,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
                no_dn++;
                return 0;
        }
+       dn = find_device_pe(dn);
        pdn = PCI_DN(dn);
 
        /* Access to IO BARs might get this far and still not want checking. */
@@ -545,7 +546,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
 
        /* Note that config-io to empty slots may fail;
         * they are empty when they don't have children. */
-       if ((rets[0] == 5) && (dn->child == NULL)) {
+       if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) {
                false_positives++;
                pdn->eeh_false_positives ++;
                rc = 0;
index 57e025e84ab4ae0132b3145c96689730989ef6f9..06b89b56d0e92a9dce9739af67d49e0a51df2ea1 100644 (file)
@@ -354,13 +354,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
        if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
                goto excess_failures;
 
-       /* Get the current PCI slot state. */
-       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
-       if (rc < 0) {
-               printk(KERN_WARNING "EEH: Permanent failure\n");
-               goto hard_fail;
-       }
-
        printk(KERN_WARNING
           "EEH: This PCI device has failed %d times in the last hour:\n",
                frozen_pdn->eeh_freeze_count);
@@ -376,6 +369,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
         */
        pci_walk_bus(frozen_bus, eeh_report_error, &result);
 
+       /* Get the current PCI slot state. This can take a long time,
+        * sometimes over 3 seconds for certain systems. */
+       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
+       if (rc < 0) {
+               printk(KERN_WARNING "EEH: Permanent failure\n");
+               goto hard_fail;
+       }
+
        /* Since rtas may enable MMIO when posting the error log,
         * don't post the error log until after all dev drivers
         * have been informed.
index d003c80fa31d2b4369f0021fd3a9b38ab99dd4ae..d8680b589dc96c325afb09725c47f5c6a008a3e6 100644 (file)
@@ -8,11 +8,6 @@ static inline long poll_pending(void)
        return plpar_hcall_norets(H_POLL_PENDING);
 }
 
-static inline long prod_processor(void)
-{
-       return plpar_hcall_norets(H_PROD);
-}
-
 static inline long cede_processor(void)
 {
        return plpar_hcall_norets(H_CEDE);
index 116305b22a2bf209721e12bfca19666e6a293432..ea4c65917a648c5e4795a99a23ba87c4efaf3351 100644 (file)
@@ -46,6 +46,7 @@
 #include <asm/pSeries_reconfig.h>
 #include <asm/mpic.h>
 #include <asm/vdso_datapage.h>
+#include <asm/cputhreads.h>
 
 #include "plpar_wrappers.h"
 #include "pseries.h"
@@ -202,7 +203,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
         */
        if (system_state < SYSTEM_RUNNING &&
            cpu_has_feature(CPU_FTR_SMT) &&
-           !smt_enabled_at_boot && nr % 2 != 0)
+           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
                return 0;
 
        return 1;
index 5eaf3e3f4b8b01dda9b99e59afa7fe39dccaccac..d359d6e929752f5cd7258a127b8845f13e3a2791 100644 (file)
@@ -42,8 +42,9 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <asm/of_device.h>
-#include <asm/of_platform.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+
 #include <asm/page.h>
 #include <asm/prom.h>
 
index 33df4c347ca7cb69cae3d8f945afb168695c011f..87e58e09b500b7b78ae22c4c210ce23c605f504d 100644 (file)
@@ -222,7 +222,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
                        hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
        }
 
-       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx."
+       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "
                "Firmware bus number: %d->%d\n",
                (unsigned long long)rsrc.start, hose->first_busno,
                hose->last_busno);
index 20edd1e94eff7111927fef861236f8827e002b4d..c858749263e019e0641af6475341740993077741 100644 (file)
@@ -28,9 +28,9 @@
 #include <linux/completion.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
 
-#include <asm/of_device.h>
-#include <asm/of_platform.h>
 #include <asm/io.h>
 #include <asm/pmi.h>
 #include <asm/prom.h>
index 121b04d165d1937b2805a5a1dabaaa30c0467f6f..381d467cf55b80bc45963167cdd2c14105e16bea 100644 (file)
@@ -153,6 +153,10 @@ static const char *getvecname(unsigned long vec);
 
 static int do_spu_cmd(void);
 
+#ifdef CONFIG_44x
+static void dump_tlb_44x(void);
+#endif
+
 int xmon_no_auto_backtrace;
 
 extern void xmon_enter(void);
@@ -231,6 +235,9 @@ Commands:\n\
 #ifdef CONFIG_PPC_STD_MMU_32
 "  u   dump segment registers\n"
 #endif
+#ifdef CONFIG_44x
+"  u   dump TLB\n"
+#endif
 "  ?   help\n"
 "  zr  reboot\n\
   zh   halt\n"
@@ -855,6 +862,11 @@ cmds(struct pt_regs *excp)
                case 'u':
                        dump_segments();
                        break;
+#endif
+#ifdef CONFIG_4xx
+               case 'u':
+                       dump_tlb_44x();
+                       break;
 #endif
                default:
                        printf("Unrecognized command: ");
@@ -2581,6 +2593,32 @@ void dump_segments(void)
 }
 #endif
 
+#ifdef CONFIG_44x
+static void dump_tlb_44x(void)
+{
+       int i;
+
+       for (i = 0; i < PPC44x_TLB_SIZE; i++) {
+               unsigned long w0,w1,w2;
+               asm volatile("tlbre  %0,%1,0" : "=r" (w0) : "r" (i));
+               asm volatile("tlbre  %0,%1,1" : "=r" (w1) : "r" (i));
+               asm volatile("tlbre  %0,%1,2" : "=r" (w2) : "r" (i));
+               printf("[%02x] %08x %08x %08x ", i, w0, w1, w2);
+               if (w0 & PPC44x_TLB_VALID) {
+                       printf("V %08x -> %01x%08x %c%c%c%c%c",
+                              w0 & PPC44x_TLB_EPN_MASK,
+                              w1 & PPC44x_TLB_ERPN_MASK,
+                              w1 & PPC44x_TLB_RPN_MASK,
+                              (w2 & PPC44x_TLB_W) ? 'W' : 'w',
+                              (w2 & PPC44x_TLB_I) ? 'I' : 'i',
+                              (w2 & PPC44x_TLB_M) ? 'M' : 'm',
+                              (w2 & PPC44x_TLB_G) ? 'G' : 'g',
+                              (w2 & PPC44x_TLB_E) ? 'E' : 'e');
+               }
+               printf("\n");
+       }
+}
+#endif /* CONFIG_44x */
 void xmon_init(int enable)
 {
 #ifdef CONFIG_PPC_ISERIES
index 976270d537c1947480f3d8e573d5c4b2fae7d089..c1f77e1d368e7965c0fa062226df4f6562c81f33 100644 (file)
@@ -336,7 +336,7 @@ ev64260_early_serial_map(void)
 #endif
 
                if (early_serial_setup(&port) != 0)
-                       printk(KERN_WARNING "Early serial init of port 0"
+                       printk(KERN_WARNING "Early serial init of port 0 "
                                "failed\n");
 
                first_time = 0;
@@ -388,7 +388,7 @@ ev64260_setup_arch(void)
        ev64260_early_serial_map();
 #endif
 
-       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc."
+       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. "
                "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
 
        if (ppc_md.progress)
index 2d7cd486e025b45015868f2a5e51f61f36e48ed0..6bbd4fa50f3b87458a56dbc155288f1e21b5a64d 100644 (file)
@@ -98,7 +98,7 @@ config HW_RANDOM_PASEMI
        default HW_RANDOM
        ---help---
          This driver provides kernel-side support for the Random Number
-         Generator hardware found on PA6T-1682M processor.
+         Generator hardware found on PA Semi PWRficient SoCs.
 
          To compile this driver as a module, choose M here: the
          module will be called pasemi-rng.
index fa6040b6c8f2a4f0483d830aa97abe48ae2f7f60..24ae3073991fee365fe0533863adb2e097dc8b97 100644 (file)
@@ -126,10 +126,9 @@ static int __devexit rng_remove(struct of_device *dev)
 }
 
 static struct of_device_id rng_match[] = {
-       {
-               .compatible      = "1682m-rng",
-       },
-       {},
+       { .compatible      = "1682m-rng", },
+       { .compatible      = "pasemi,pwrficient-rng", },
+       { },
 };
 
 static struct of_platform_driver rng_driver = {
index 9007d0677220cf3aef8a524608d345452820ba6b..90320917be2875a6a0fc77361fd59e254f7670f6 100644 (file)
@@ -225,7 +225,7 @@ static int __devinit pasemi_edac_probe(struct pci_dev *pdev,
                EDAC_FLAG_NONE;
        mci->mod_name = MODULE_NAME;
        mci->dev_name = pci_name(pdev);
-       mci->ctl_name = "pasemi,1682m-mc";
+       mci->ctl_name = "pasemi,pwrficient-mc";
        mci->edac_check = pasemi_edac_check;
        mci->ctl_page_to_phys = NULL;
        pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub);
@@ -297,4 +297,4 @@ module_exit(pasemi_edac_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
-MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller");
+MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");
index dc741d3a4531cbe365aa8b89256a0337782b5b00..35e1f22089d621619ea28f9304f729ae25d8e068 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/adb.h>
 #include <linux/pmu.h>
 #include <linux/cuda.h>
-#include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
@@ -65,9 +64,7 @@
 #include "via-pmu-event.h"
 
 /* Some compile options */
-#undef SUSPEND_USES_PMU
 #define DEBUG_SLEEP
-#undef HACKED_PCI_SAVE
 
 /* Misc minor number allocated for /dev/pmu */
 #define PMU_MINOR              154
@@ -1256,9 +1253,7 @@ void
 pmu_suspend(void)
 {
        unsigned long flags;
-#ifdef SUSPEND_USES_PMU
-       struct adb_request *req;
-#endif
+
        if (!via)
                return;
        
@@ -1276,17 +1271,10 @@ pmu_suspend(void)
                via_pmu_interrupt(0, NULL);
                spin_lock_irqsave(&pmu_lock, flags);
                if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
-#ifdef SUSPEND_USES_PMU
-                       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
-                       spin_unlock_irqrestore(&pmu_lock, flags);
-                       while(!req.complete)
-                               pmu_poll();
-#else /* SUSPEND_USES_PMU */
                        if (gpio_irq >= 0)
                                disable_irq_nosync(gpio_irq);
                        out_8(&via[IER], CB1_INT | IER_CLR);
                        spin_unlock_irqrestore(&pmu_lock, flags);
-#endif /* SUSPEND_USES_PMU */
                        break;
                }
        } while (1);
@@ -1307,18 +1295,11 @@ pmu_resume(void)
                return;
        }
        adb_int_pending = 1;
-#ifdef SUSPEND_USES_PMU
-       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
-       spin_unlock_irqrestore(&pmu_lock, flags);
-       while(!req.complete)
-               pmu_poll();
-#else /* SUSPEND_USES_PMU */
        if (gpio_irq >= 0)
                enable_irq(gpio_irq);
        out_8(&via[IER], CB1_INT | IER_SET);
        spin_unlock_irqrestore(&pmu_lock, flags);
        pmu_poll();
-#endif /* SUSPEND_USES_PMU */
 }
 
 /* Interrupt data could be the result data from an ADB cmd */
@@ -1804,14 +1785,10 @@ static void broadcast_wake(void)
  * PCI devices which may get powered off when we sleep.
  */
 static struct pci_save {
-#ifndef HACKED_PCI_SAVE
        u16     command;
        u16     cache_lat;
        u16     intr;
        u32     rom_address;
-#else
-       u32     config[16];
-#endif 
 } *pbook_pci_saves;
 static int pbook_npci_saves;
 
@@ -1857,16 +1834,10 @@ pbook_pci_save(void)
                        pci_dev_put(pd);
                        return;
                }
-#ifndef HACKED_PCI_SAVE
                pci_read_config_word(pd, PCI_COMMAND, &ps->command);
                pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
                pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
                pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address);
-#else
-               int i;
-               for (i=1;i<16;i++)
-                       pci_read_config_dword(pd, i<<4, &ps->config[i]);
-#endif
                ++ps;
        }
 }
@@ -1885,17 +1856,6 @@ pbook_pci_restore(void)
        int j;
 
        while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
-#ifdef HACKED_PCI_SAVE
-               int i;
-               if (npci-- == 0) {
-                       pci_dev_put(pd);
-                       return;
-               }
-               ps++;
-               for (i=2;i<16;i++)
-                       pci_write_config_dword(pd, i<<4, ps->config[i]);
-               pci_write_config_dword(pd, 4, ps->config[1]);
-#else
                if (npci-- == 0)
                        return;
                ps++;
@@ -1919,7 +1879,6 @@ pbook_pci_restore(void)
                        pci_write_config_word(pd, PCI_COMMAND, ps->command);
                        break;
                }
-#endif 
        }
 }
 
@@ -2547,7 +2506,6 @@ pmu_release(struct inode *inode, struct file *file)
        struct pmu_private *pp = file->private_data;
        unsigned long flags;
 
-       lock_kernel();
        if (pp != 0) {
                file->private_data = NULL;
                spin_lock_irqsave(&all_pvt_lock, flags);
@@ -2561,7 +2519,6 @@ pmu_release(struct inode *inode, struct file *file)
 
                kfree(pp);
        }
-       unlock_kernel();
        return 0;
 }
 
diff --git a/include/asm-powerpc/cputhreads.h b/include/asm-powerpc/cputhreads.h
new file mode 100644 (file)
index 0000000..8485c28
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef _ASM_POWERPC_CPUTHREADS_H
+#define _ASM_POWERPC_CPUTHREADS_H
+
+#include <linux/cpumask.h>
+
+/*
+ * Mapping of threads to cores
+ */
+
+#ifdef CONFIG_SMP
+extern int threads_per_core;
+extern int threads_shift;
+extern cpumask_t threads_core_mask;
+#else
+#define threads_per_core       1
+#define threads_shift          0
+#define threads_core_mask      (CPU_MASK_CPU0)
+#endif
+
+/* cpu_thread_mask_to_cores - Return a cpumask of one per cores
+ *                            hit by the argument
+ *
+ * @threads:   a cpumask of threads
+ *
+ * This function returns a cpumask which will have one "cpu" (or thread)
+ * bit set for each core that has at least one thread set in the argument.
+ *
+ * This can typically be used for things like IPI for tlb invalidations
+ * since those need to be done only once per core/TLB
+ */
+static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
+{
+       cpumask_t       tmp, res;
+       int             i;
+
+       res = CPU_MASK_NONE;
+       for (i = 0; i < NR_CPUS; i += threads_per_core) {
+               cpus_shift_right(tmp, threads_core_mask, i);
+               if (cpus_intersects(threads, tmp))
+                       cpu_set(i, res);
+       }
+       return res;
+}
+
+static inline int cpu_nr_cores(void)
+{
+       return NR_CPUS >> threads_shift;
+}
+
+static inline cpumask_t cpu_online_cores_map(void)
+{
+       return cpu_thread_mask_to_cores(cpu_online_map);
+}
+
+static inline int cpu_thread_to_core(int cpu)
+{
+       return cpu >> threads_shift;
+}
+
+static inline int cpu_thread_in_core(int cpu)
+{
+       return cpu & (threads_per_core - 1);
+}
+
+static inline int cpu_first_thread_in_core(int cpu)
+{
+       return cpu & ~(threads_per_core - 1);
+}
+
+#endif /* _ASM_POWERPC_CPUTHREADS_H */
+
index b847aa10074be1d87878a40acbece6bb204644eb..fda5e3d1f62a290959bd43774940714b34b31cbc 100644 (file)
@@ -22,7 +22,6 @@ extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary);
 
 
 extern struct list_head hose_list;
-extern int global_phb_number;
 
 extern void find_and_init_phbs(void);