Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 26 Jul 2007 21:00:09 +0000 (14:00 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 26 Jul 2007 21:00:09 +0000 (14:00 -0700)
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (21 commits)
  [POWERPC] spusched: Fix initial timeslice calculation
  [POWERPC] spufs: Fix incorrect initialization of cbe_spu_info.spus
  [POWERPC] Fix Maple platform ISA bus
  [POWERPC] Make pci_iounmap actually unmap things
  [POWERPC] Add function to check if address is an IO port
  [POWERPC] Fix Pegasos keyboard detection
  [POWERPC] iSeries: Fix section mismatch warning in lpevents
  [POWERPC] iSeries: Fix section mismatch warnings
  [POWERPC] iSeries: We need vio_enable_interrupts
  [POWERPC] Fix RTC and device tree on linkstation machines
  [POWERPC] Add of_register_i2c_devices()
  [POWERPC] Fix loop with unsigned long counter variable
  [POWERPC] Fix register labels on show_regs() message for 4xx/Book-E
  [POWERPC] Only allow building of BootX text support on PPC_MULTIPLATFORM
  [POWERPC] Fix the ability to reset on MPC8544 DS and MPC8568 MDS boards
  [POWERPC] Fix mpc7448hpc2 tsi108 device_type bug
  [POWREPC] Fixup a number of modpost warnings on ppc32
  [POWERPC] Fix ethernet PHY support on MPC8544 DS
  [POWERPC] Don't try to allocate resources for a Freescale POWERPC PHB
  Revert "[POWERPC] Don't complain if size-cells == 0 in prom_parse()"
  ...

27 files changed:
arch/powerpc/Kconfig.debug
arch/powerpc/boot/dts/kuroboxHD.dts
arch/powerpc/boot/dts/kuroboxHG.dts
arch/powerpc/boot/dts/mpc7448hpc2.dts
arch/powerpc/boot/dts/mpc8544ds.dts
arch/powerpc/boot/dts/mpc8568mds.dts
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/iomap.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom_parse.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/udbg.c
arch/powerpc/mm/lmb.c
arch/powerpc/platforms/cell/spufs/context.c
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/iseries/lpevents.c
arch/powerpc/platforms/maple/pci.c
arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/indirect_pci.c
include/asm-powerpc/pci-bridge.h
include/asm-powerpc/ppc_asm.h
include/asm-powerpc/vio.h

index 346cd3befe1e2252bb0c132e20d3b9f33aefd8ad..5c71624ee38d41708af7dc299417c601606cde7d 100644 (file)
@@ -134,7 +134,7 @@ config BDI_SWITCH
 
 config BOOTX_TEXT
        bool "Support for early boot text console (BootX or OpenFirmware only)"
-       depends PPC_OF
+       depends PPC_OF && PPC_MULTIPLATFORM
        help
          Say Y here to see progress messages from the boot firmware in text
          mode. Requires either BootX or Open Firmware.
index a983680c326384d3125ba1d39a65163b7455bada..122537419d9f75d9f99cde8fb25c9ff35f69bc0b 100644 (file)
@@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
                        reg = <0>;
-                       clock-frequency = <bebc200>;    /* Fixed by bootwrapper */
-                       timebase-frequency = <1743000>; /* Fixed by bootwrapper */
-                       bus-frequency = <0>;            /* From bootloader */
+                       clock-frequency = <bebc200>;    /* Fixed by bootloader */
+                       timebase-frequency = <1743000>; /* Fixed by bootloader */
+                       bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-line-size = <0>;
-                       d-cache-line-size = <0>;
                        i-cache-size = <4000>;
                        d-cache-size = <4000>;
                };
@@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                          fef00000 fef00000 00100000>;  /* pci iack */
 
                i2c@80003000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <80003000 1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
+
+                       rtc@32 {
+                               device_type = "rtc";
+                               compatible = "ricoh,rs5c372b";
+                               reg = <32>;
+                       };
                };
 
                serial@80004500 {
@@ -91,7 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
                        interrupt-parent = <&mpic>;
                };
 
-               mpic: pic@80040000 {
+               mpic: interrupt-controller@80040000 {
                        #interrupt-cells = <2>;
                        #address-cells = <0>;
                        device_type = "open-pic";
index 5cf42dc022dfa816985eb37033b2b1427a0b1e27..579aa8b967d94be8c6b28a7aa7530ec143f6b8e2 100644 (file)
@@ -33,12 +33,10 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
                        reg = <0>;
-                       clock-frequency = <fdad680>;    /* Fixed by bootwrapper */
-                       timebase-frequency = <1F04000>; /* Fixed by bootwrapper */
-                       bus-frequency = <0>;            /* From bootloader */
+                       clock-frequency = <fdad680>;    /* Fixed by bootloader */
+                       timebase-frequency = <1F04000>; /* Fixed by bootloader */
+                       bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-line-size = <0>;
-                       d-cache-line-size = <0>;
                        i-cache-size = <4000>;
                        d-cache-size = <4000>;
                };
@@ -64,11 +62,19 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                          fef00000 fef00000 00100000>;  /* pci iack */
 
                i2c@80003000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <80003000 1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
+
+                       rtc@32 {
+                               device_type = "rtc";
+                               compatible = "ricoh,rs5c372b";
+                               reg = <32>;
+                       };
                };
 
                serial@80004500 {
@@ -91,8 +97,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
                        interrupt-parent = <&mpic>;
                };
 
-               mpic: pic@80040000 {
-                       interrupt-parent = <&mpic>;
+               mpic: interrupt-controller@80040000 {
                        #interrupt-cells = <2>;
                        #address-cells = <0>;
                        device_type = "open-pic";
index 0e3d314a7158116351d5dccd4d6395eefd47e22b..b9158eb2797ea4e3e42b07b042a2e916227c5320 100644 (file)
@@ -45,7 +45,7 @@
                #address-cells = <1>;
                #size-cells = <1>;
                #interrupt-cells = <2>;
-               device_type = "tsi108-bridge";
+               device_type = "tsi-bridge";
                ranges = <00000000 c0000000 00010000>;
                reg = <c0000000 00010000>;
                bus-frequency = <0>;
index 4a900c6df762562b9f330d367af58de4f7ceb57c..4680e2010887e468d4fb4824f9fc795428943a31 100644 (file)
                        interrupts = <1d 2 1e 2 22 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
+                       phy-connection-type = "rgmii-id";
                };
 
                ethernet@26000 {
                        interrupts = <1f 2 20 2 21 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
+                       phy-connection-type = "rgmii-id";
                };
 
                serial@4500 {
 
                };
 
+               global-utilities@e0000 {        //global utilities block
+                       compatible = "fsl,mpc8548-guts";
+                       reg = <e0000 1000>;
+                       fsl,has-rstcr;
+               };
+
                mpic: pic@40000 {
                        clock-frequency = <0>;
                        interrupt-controller;
index 99fa5a0ea4255f9efff808d016828ddd0b774661..b1dcfbe8c1f8632b636ea1fe89215bc551862646 100644 (file)
                        interrupt-parent = <&mpic>;
                };
 
+               global-utilities@e0000 {        //global utilities block
+                       compatible = "fsl,mpc8548-guts";
+                       reg = <e0000 1000>;
+                       fsl,has-rstcr;
+               };
+
                pci@8000 {
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
index 8cdd48ea43912d7a39c5d82c34432787a67f30b2..1448af92c6a9b36a1c6129522af1ac4c482d415b 100644 (file)
@@ -809,8 +809,9 @@ system_reset_iSeries:
        mtmsrd  r24                     /* RI on */
        lhz     r24,PACAPACAINDEX(r13)  /* Get processor # */
        cmpwi   0,r24,0                 /* Are we processor 0? */
-       beq     .__start_initialization_iSeries /* Start up the first processor */
-       mfspr   r4,SPRN_CTRLF
+       bne     1f
+       b       .__start_initialization_iSeries /* Start up the first processor */
+1:     mfspr   r4,SPRN_CTRLF
        li      r5,CTRL_RUNLATCH        /* Turn off the run light */
        andc    r4,r4,r5
        mtspr   SPRN_CTRLT,r4
@@ -1611,7 +1612,7 @@ _GLOBAL(generic_secondary_smp_init)
 #endif
 
 #ifdef CONFIG_PPC_ISERIES
-_STATIC(__start_initialization_iSeries)
+_INIT_STATIC(__start_initialization_iSeries)
        /* Clear out the BSS */
        LOAD_REG_IMMEDIATE(r11,__bss_stop)
        LOAD_REG_IMMEDIATE(r8,__bss_start)
index 601ef79a591618d75d1e0d2c919c993e6b4dc2fc..2a5cf868037083b6695670f5d99d1d6100daa5a4 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/pci.h>
 #include <linux/mm.h>
 #include <asm/io.h>
+#include <asm/pci-bridge.h>
 
 /*
  * Here comes the ppc64 implementation of the IOMAP 
@@ -136,7 +137,12 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
 
 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 {
-       /* Nothing to do */
+       if (isa_vaddr_is_ioport(addr))
+               return;
+       if (pcibios_vaddr_is_ioport(addr))
+               return;
+       iounmap(addr);
 }
+
 EXPORT_SYMBOL(pci_iomap);
 EXPORT_SYMBOL(pci_iounmap);
index 2fc87862146cbd68048c0d2307a5eb6b626de086..24bea97c736c75ca59f3ceed5e48443dd6d14daf 100644 (file)
@@ -418,10 +418,10 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
 }
 EXPORT_SYMBOL_GPL(virq_to_hw);
 
-struct irq_host *irq_alloc_host(unsigned int revmap_type,
-                               unsigned int revmap_arg,
-                               struct irq_host_ops *ops,
-                               irq_hw_number_t inval_irq)
+__init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
+                                               unsigned int revmap_arg,
+                                               struct irq_host_ops *ops,
+                                               irq_hw_number_t inval_irq)
 {
        struct irq_host *host;
        unsigned int size = sizeof(struct irq_host);
index fe7d1255e11ea903dbd01f41e56c839ccb04f703..083cfbdbe0b2d7ed86edeb2ab55d5a7284fd8a91 100644 (file)
@@ -65,7 +65,7 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
        spin_unlock(&hose_spinlock);
 }
 
-struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
+__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
 {
        struct pci_controller *phb;
 
@@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_controller *phb)
                kfree(phb);
 }
 
+int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+       int ret = 0;
+       struct pci_controller *hose;
+       unsigned long size;
+
+       spin_lock(&hose_spinlock);
+       list_for_each_entry(hose, &hose_list, list_node) {
+#ifdef CONFIG_PPC64
+               size = hose->pci_io_size;
+#else
+               size = hose->io_resource.end - hose->io_resource.start + 1;
+#endif
+               if (address >= hose->io_base_virt &&
+                   address < (hose->io_base_virt + size)) {
+                       ret = 1;
+                       break;
+               }
+       }
+       spin_unlock(&hose_spinlock);
+       return ret;
+}
+
 /*
  * Return the domain number for this bus.
  */
index 721a69400d6557c86fe2c3cc46705130c80df95d..cd35c969bb283f5a52d76b14e8bb208799aafd9f 100644 (file)
@@ -59,6 +59,24 @@ LIST_HEAD(hose_list);
 
 static int pci_bus_count;
 
+static void
+fixup_hide_host_resource_fsl(struct pci_dev* dev)
+{
+       int i, class = dev->class >> 8;
+
+       if ((class == PCI_CLASS_PROCESSOR_POWERPC) &&
+               (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+               (dev->bus->parent == NULL)) {
+               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+                       dev->resource[i].start = 0;
+                       dev->resource[i].end = 0;
+                       dev->resource[i].flags = 0;
+               }
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl); 
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); 
+
 static void
 fixup_broken_pcnet32(struct pci_dev* dev)
 {
@@ -1229,7 +1247,7 @@ pcibios_init(void)
 
 subsys_initcall(pcibios_init);
 
-void __init pcibios_fixup_bus(struct pci_bus *bus)
+void pcibios_fixup_bus(struct pci_bus *bus)
 {
        struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
        unsigned long io_offset;
index 84f000a45e3678cf4d18fa8b194681bc6cdbaf00..a83727b308a0186e8a5dfadc06fd2be687029834 100644 (file)
@@ -423,7 +423,11 @@ void show_regs(struct pt_regs * regs)
        printk("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
        trap = TRAP(regs);
        if (trap == 0x300 || trap == 0x600)
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
+               printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
+#else
                printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
+#endif
        printk("TASK = %p[%d] '%s' THREAD: %p",
               current, current->pid, current->comm, task_thread_info(current));
 
index 3786dcc8a7b62752cc51ddd3fae9dd085a2b3726..b5c96af955c639ce43ea1532423bebebf0a6b177 100644 (file)
@@ -24,7 +24,7 @@
 /* Max address size we deal with */
 #define OF_MAX_ADDR_CELLS      4
 #define OF_CHECK_COUNTS(na, ns)        ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
-                       (ns) >= 0)
+                       (ns) > 0)
 
 static struct of_bus *of_match_bus(struct device_node *np);
 static int __of_address_to_resource(struct device_node *dev,
index 4924c48cb1ffc64df621b6d2dd6790c2b0683100..50ef38cffdbfc3db60df3b3a90827daac12aef47 100644 (file)
@@ -496,6 +496,10 @@ int check_legacy_ioport(unsigned long base_port)
                        break;
                }
                np = of_find_node_by_type(NULL, "8042");
+               /* Pegasos has no device_type on its 8042 node, look for the
+                * name instead */
+               if (!np)
+                       np = of_find_node_by_name(NULL, "8042");
                break;
        case FDC_BASE: /* FDC1 */
                np = of_find_node_by_type(NULL, "fdc");
index cbca1df8bc60f996edb343bf86a6944ecfdae108..0f9b4eadfbcbebaa27a60d369730f8b972284aa5 100644 (file)
@@ -155,7 +155,7 @@ static int early_console_initialized;
  * Called by setup_system after ppc_md->probe and ppc_md->early_init.
  * Call it again after setting udbg_putc in ppc_md->setup_arch.
  */
-void register_early_udbg_console(void)
+void __init register_early_udbg_console(void)
 {
        if (early_console_initialized)
                return;
index e3a1e8dc536a5bab3ea4c48f99e530cde5971e0b..8f4d2dc4cafb0e832039799c364d8bccfc67d51b 100644 (file)
@@ -138,8 +138,8 @@ void __init lmb_analyze(void)
 static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
                                  unsigned long size)
 {
-       unsigned long i, coalesced = 0;
-       long adjacent;
+       unsigned long coalesced = 0;
+       long adjacent, i;
 
        /* First try and coalesce this LMB with another. */
        for (i=0; i < rgn->cnt; i++) {
index 6694f86d7000899d6bb67080cc80cd93557f4d04..9cb081c26e7120f5ca84c8ecb2e7ff7ae7814df4 100644 (file)
@@ -59,7 +59,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
        INIT_LIST_HEAD(&ctx->aff_list);
        if (gang)
                spu_gang_add_ctx(gang, ctx);
-       ctx->cpus_allowed = current->cpus_allowed;
+
+       __spu_update_sched_info(ctx);
        spu_set_timeslice(ctx);
        ctx->stats.util_state = SPU_UTIL_IDLE_LOADED;
 
index 0b50fa5cb39d5af406047391ad7914eafd31d9be..6abdd8fe2098f29591a31ebd65a14952899067d4 100644 (file)
@@ -312,6 +312,7 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
        spu_acquire(ctx);
        if (ctx->state == SPU_STATE_SAVED) {
                __spu_update_sched_info(ctx);
+               spu_set_timeslice(ctx);
 
                ret = spu_activate(ctx, 0);
                if (ret) {
@@ -322,6 +323,9 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
                /*
                 * We have to update the scheduling priority under active_mutex
                 * to protect against find_victim().
+                *
+                * No need to update the timeslice ASAP, it will get updated
+                * once the current one has expired.
                 */
                spu_update_sched_info(ctx);
        }
index 227968b4779d3adc531fac2a71ef68dd1f18c386..758a80ac080a09fc177d8b43bb10e6166ece8a56 100644 (file)
@@ -927,10 +927,6 @@ int __init spu_sched_init(void)
                INIT_LIST_HEAD(&spu_prio->runq[i]);
                __clear_bit(i, spu_prio->bitmap);
        }
-       for (i = 0; i < MAX_NUMNODES; i++) {
-               mutex_init(&cbe_spu_info[i].list_mutex);
-               INIT_LIST_HEAD(&cbe_spu_info[i].spus);
-       }
        spin_lock_init(&spu_prio->runq_lock);
 
        setup_timer(&spusched_timer, spusched_wake, 0);
index 91df52a1899addd4aeaec8b39d1d5f9809cccc19..34bdbbe3ce590a73a70d04e5d91732189f1b43cb 100644 (file)
@@ -182,7 +182,7 @@ static int set_spread_lpevents(char *str)
 }
 __setup("spread_lpevents=", set_spread_lpevents);
 
-void setup_hvlpevent_queue(void)
+void __init setup_hvlpevent_queue(void)
 {
        void *eventStack;
 
index fceaae40fe7033c70947f3c9f65680d2b0671c0a..2542403288f92dd769e0e6d2b28d4228e649e894 100644 (file)
@@ -490,6 +490,9 @@ static int __init maple_add_bridge(struct device_node *dev)
        /* Fixup "bus-range" OF property */
        fixup_bus_range(dev);
 
+       /* Check for legacy IOs */
+       isa_bridge_find_early(hose);
+
        return 0;
 }
 
index 51c223385feb23c897013079b15007401396e89e..9fb0ce5c71766c5807467ad76a906fe9a15744d4 100644 (file)
@@ -107,7 +107,7 @@ void __init setup_pci_cmd(struct pci_controller *hose)
        }
 }
 
-static void __devinit quirk_fsl_pcie_transparent(struct pci_dev *dev)
+static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
 {
        struct resource *res;
        int i, res_idx = PCI_BRIDGE_RESOURCES;
@@ -216,7 +216,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 
        /* check PCI express link status */
        if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
-               hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG |
+               hose->indirect_type |= PPC_INDIRECT_TYPE_EXT_REG |
                        PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS;
                if (fsl_pcie_check_link(hose))
                        hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
index 3289fab01e9245a49919a61d5ecdc285a2a49810..727453d3e8b919cac9d5d435a5980842abc46cbd 100644 (file)
@@ -305,6 +305,64 @@ err:
 
 arch_initcall(gfar_of_init);
 
+#ifdef CONFIG_I2C_BOARDINFO
+#include <linux/i2c.h>
+struct i2c_driver_device {
+       char    *of_device;
+       char    *i2c_driver;
+       char    *i2c_type;
+};
+
+static struct i2c_driver_device i2c_devices[] __initdata = {
+       {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
+       {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
+       {"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
+       {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
+};
+
+static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
+               if (!of_device_is_compatible(node, i2c_devices[i].of_device))
+                       continue;
+               strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN);
+               strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
+               return 0;
+       }
+       return -ENODEV;
+}
+
+static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num)
+{
+       struct device_node *node = NULL;
+
+       while ((node = of_get_next_child(adap_node, node))) {
+               struct i2c_board_info info;
+               const u32 *addr;
+               int len;
+
+               addr = of_get_property(node, "reg", &len);
+               if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
+                       printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n");
+                       continue;
+               }
+
+               info.irq = irq_of_parse_and_map(node, 0);
+               if (info.irq == NO_IRQ)
+                       info.irq = -1;
+
+               if (of_find_i2c_driver(node, &info) < 0)
+                       continue;
+
+               info.platform_data = NULL;
+               info.addr = *addr;
+
+               i2c_register_board_info(bus_num, &info, 1);
+       }
+}
+
 static int __init fsl_i2c_of_init(void)
 {
        struct device_node *np;
@@ -349,6 +407,8 @@ static int __init fsl_i2c_of_init(void)
                                                    fsl_i2c_platform_data));
                if (ret)
                        goto unreg;
+
+               of_register_i2c_devices(np, i);
        }
 
        return 0;
@@ -360,6 +420,7 @@ err:
 }
 
 arch_initcall(fsl_i2c_of_init);
+#endif
 
 #ifdef CONFIG_PPC_83xx
 static int __init mpc83xx_wdt_init(void)
index a8ac2dfdd3d477975db3e121148cd668cc2b1f0f..5294560c7b00b5d65876995e8a96c10d047e3b08 100644 (file)
@@ -160,4 +160,5 @@ setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32
                mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
        hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK);
        hose->ops = &indirect_pci_ops;
+       hose->indirect_type = flags;
 }
index d53e0eb1de163a77ef879bd86de4e2fa90c089fb..e909769b641046a3b718170a20691fdc5fb2141f 100644 (file)
@@ -71,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
        return bus->sysdata;
 }
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+       /* No specific ISA handling on ppc32 at this stage, it
+        * all goes through PCI
+        */
+       return 0;
+}
+
 /* These are used for config access before all the PCI probing
    has been done. */
 int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -241,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);
 
 extern void isa_bridge_find_early(struct pci_controller *hose);
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+       /* Check if address hits the reserved legacy IO range */
+       unsigned long ea = (unsigned long)address;
+       return ea >= ISA_IO_BASE && ea < ISA_IO_END;
+}
+
 extern int pcibios_unmap_io_space(struct pci_bus *bus);
 extern int pcibios_map_io_space(struct pci_bus *bus);
 
@@ -271,11 +286,16 @@ extern struct pci_controller *
 pcibios_alloc_controller(struct device_node *dev);
 #ifdef CONFIG_PCI
 extern unsigned long pci_address_to_pio(phys_addr_t address);
+extern int pcibios_vaddr_is_ioport(void __iomem *address);
 #else
 static inline unsigned long pci_address_to_pio(phys_addr_t address)
 {
        return (unsigned long)-1;
 }
+static inline int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+       return 0;
+}
 #endif
 
 
index fa083d8e46632807b5a206a5ab7fa528e7676fea..65325721446deca505420cfc8dae4cf8c1430847 100644 (file)
@@ -181,6 +181,18 @@ name: \
        .type GLUE(.,name),@function; \
 GLUE(.,name):
 
+#define _INIT_STATIC(name) \
+       .section ".text.init.refok"; \
+       .align 2 ; \
+       .section ".opd","aw"; \
+name: \
+       .quad GLUE(.,name); \
+       .quad .TOC.@tocbase; \
+       .quad 0; \
+       .previous; \
+       .type GLUE(.,name),@function; \
+GLUE(.,name):
+
 #else /* 32-bit */
 
 #define _GLOBAL(n)     \
index 0117b544ecbce1ff1c7741f3e55938bd31f34081..3a0975e2adadad1ff673b6880ae04ed33f016449 100644 (file)
@@ -80,6 +80,11 @@ extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
 extern struct vio_dev *vio_find_node(struct device_node *vnode);
 extern int vio_enable_interrupts(struct vio_dev *dev);
 extern int vio_disable_interrupts(struct vio_dev *dev);
+#else
+static inline int vio_enable_interrupts(struct vio_dev *dev)
+{
+       return 0;
+}
 #endif
 
 static inline struct vio_driver *to_vio_driver(struct device_driver *drv)