]> err.no Git - linux-2.6/commitdiff
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi...
authorPaul Mackerras <paulus@samba.org>
Thu, 17 Jan 2008 05:17:58 +0000 (16:17 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 17 Jan 2008 05:17:58 +0000 (16:17 +1100)
63 files changed:
Documentation/kernel-parameters.txt
Documentation/powerpc/booting-without-of.txt
arch/powerpc/boot/.gitignore
arch/powerpc/boot/4xx.c
arch/powerpc/boot/4xx.h
arch/powerpc/boot/dcr.h
arch/powerpc/boot/dtc-src/.gitignore [new file with mode: 0644]
arch/powerpc/boot/serial.c
arch/powerpc/configs/bamboo_defconfig
arch/powerpc/configs/kilauea_defconfig
arch/powerpc/configs/sequoia_defconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/ibmebus.c
arch/powerpc/kernel/legacy_serial.c
arch/powerpc/kernel/of_device.c
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/pci_dn.c
arch/powerpc/kernel/rtas_pci.c
arch/powerpc/kernel/systbl_chk.c [new file with mode: 0644]
arch/powerpc/kernel/systbl_chk.sh [new file with mode: 0644]
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/platforms/40x/virtex.c
arch/powerpc/platforms/44x/rainier.c
arch/powerpc/platforms/44x/sequoia.c
arch/powerpc/platforms/cell/io-workarounds.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/cell/pmu.c
arch/powerpc/platforms/cell/setup.c
arch/powerpc/platforms/celleb/io-workarounds.c
arch/powerpc/platforms/celleb/iommu.c
arch/powerpc/platforms/celleb/pci.c
arch/powerpc/platforms/celleb/setup.c
arch/powerpc/platforms/iseries/pci.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/powermac/low_i2c.c
arch/powerpc/platforms/powermac/pfunc_base.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/mv64x60_dev.c
arch/powerpc/sysdev/mv64x60_pci.c
arch/powerpc/sysdev/mv64x60_udbg.c
arch/powerpc/sysdev/ppc4xx_pci.c
arch/powerpc/sysdev/tsi108_dev.c
arch/powerpc/sysdev/uic.c
arch/powerpc/sysdev/xilinx_intc.c
drivers/macintosh/therm_adt746x.c
drivers/macintosh/therm_pm72.c
drivers/macintosh/therm_windtunnel.c
drivers/net/ibm_newemac/core.c
drivers/of/base.c
drivers/of/device.c
drivers/serial/mpc52xx_uart.c
drivers/serial/uartlite.c
include/asm-powerpc/mmu-hash64.h
include/asm-powerpc/pci-bridge.h
include/linux/of.h
include/linux/of_device.h

index 33121d6c827c6e5fcc85d72b1f5ee5f166b743a2..2fc1fb896afce11e356860462b3372a6e802a4d1 100644 (file)
@@ -685,6 +685,7 @@ and is between 256 and 4096 characters. It is defined in the file
                        See Documentation/isdn/README.HiSax.
 
        hugepages=      [HW,X86-32,IA-64] Maximal number of HugeTLB pages.
+       hugepagesz=     [HW,IA-64,PPC] The size of the HugeTLB pages.
 
        i8042.direct    [HW] Put keyboard port into non-translated mode
        i8042.dumbkbd   [HW] Pretend that controller can only read data from
index ee0209a7de3ee62d810c060e72ec69ad17f2d4c1..6d1d0856063e8899940870d78d45a881b0ad5698 100644 (file)
@@ -671,10 +671,10 @@ device or bus to be described by the device tree.
 
 In general, the format of an address for a device is defined by the
 parent bus type, based on the #address-cells and #size-cells
-property. In the absence of such a property, the parent's parent
-values are used, etc... The kernel requires the root node to have
-those properties defining addresses format for devices directly mapped
-on the processor bus.
+properties.  Note that the parent's parent definitions of #address-cells
+and #size-cells are not inhereted so every node with children must specify
+them.  The kernel requires the root node to have those properties defining
+addresses format for devices directly mapped on the processor bus.
 
 Those 2 properties define 'cells' for representing an address and a
 size. A "cell" is a 32-bit number. For example, if both contain 2
@@ -2091,8 +2091,7 @@ platforms are moved over to use the flattened-device-tree model.
 
    Example:
        localbus@f0010100 {
-               compatible = "fsl,mpc8272ads-localbus",
-                            "fsl,mpc8272-localbus",
+               compatible = "fsl,mpc8272-localbus",
                             "fsl,pq2-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
@@ -2292,7 +2291,7 @@ platforms are moved over to use the flattened-device-tree model.
    properties of the device node.  In general, device nodes for IP-cores
    will take the following form:
 
-       (name)@(base-address) {
+       (name): (generic-name)@(base-address) {
                compatible = "xlnx,(ip-core-name)-(HW_VER)"
                             [, (list of compatible devices), ...];
                reg = <(baseaddr) (size)>;
@@ -2302,6 +2301,9 @@ platforms are moved over to use the flattened-device-tree model.
                xlnx,(parameter2) = <(int-value)>;
        };
 
+       (generic-name):   an open firmware-style name that describes the
+                       generic class of device.  Preferably, this is one word, such
+                       as 'serial' or 'ethernet'.
        (ip-core-name): the name of the ip block (given after the BEGIN
                        directive in system.mhs).  Should be in lowercase
                        and all underscores '_' converted to dashes '-'.
@@ -2310,9 +2312,9 @@ platforms are moved over to use the flattened-device-tree model.
                        dropped from the parameter name, the name is converted
                        to lowercase and all underscore '_' characters are
                        converted to dashes '-'.
-       (baseaddr):     the C_BASEADDR parameter.
+       (baseaddr):     the baseaddr parameter value (often named C_BASEADDR).
        (HW_VER):       from the HW_VER parameter.
-       (size):         equals C_HIGHADDR - C_BASEADDR + 1
+       (size):         the address range size (often C_HIGHADDR - C_BASEADDR + 1).
 
    Typically, the compatible list will include the exact IP core version
    followed by an older IP core version which implements the same
@@ -2342,11 +2344,11 @@ platforms are moved over to use the flattened-device-tree model.
 
    becomes the following device tree node:
 
-       opb-uartlite-0@ec100000 {
+       opb_uartlite_0: serial@ec100000 {
                device_type = "serial";
                compatible = "xlnx,opb-uartlite-1.00.b";
                reg = <ec100000 10000>;
-               interrupt-parent = <&opb-intc>;
+               interrupt-parent = <&opb_intc_0>;
                interrupts = <1 0>; // got this from the opb_intc parameters
                current-speed = <d#115200>;     // standard serial device prop
                clock-frequency = <d#50000000>; // standard serial device prop
@@ -2355,16 +2357,19 @@ platforms are moved over to use the flattened-device-tree model.
                xlnx,use-parity = <0>;
        };
 
-   Some IP cores actually implement 2 or more logical devices.  In this case,
-   the device should still describe the whole IP core with a single node
-   and add a child node for each logical device.  The ranges property can
-   be used to translate from parent IP-core to the registers of each device.
-   (Note: this makes the assumption that both logical devices have the same
-   bus binding.  If this is not true, then separate nodes should be used for
-   each logical device).  The 'cell-index' property can be used to enumerate
-   logical devices within an IP core.  For example, the following is the
-   system.mhs entry for the dual ps2 controller found on the ml403 reference
-   design.
+   Some IP cores actually implement 2 or more logical devices.  In
+   this case, the device should still describe the whole IP core with
+   a single node and add a child node for each logical device.  The
+   ranges property can be used to translate from parent IP-core to the
+   registers of each device.  In addition, the parent node should be
+   compatible with the bus type 'xlnx,compound', and should contain
+   #address-cells and #size-cells, as with any other bus.  (Note: this
+   makes the assumption that both logical devices have the same bus
+   binding.  If this is not true, then separate nodes should be used
+   for each logical device).  The 'cell-index' property can be used to
+   enumerate logical devices within an IP core.  For example, the
+   following is the system.mhs entry for the dual ps2 controller found
+   on the ml403 reference design.
 
        BEGIN opb_ps2_dual_ref
                PARAMETER INSTANCE = opb_ps2_dual_ref_0
@@ -2386,21 +2391,24 @@ platforms are moved over to use the flattened-device-tree model.
 
    It would result in the following device tree nodes:
 
-       opb_ps2_dual_ref_0@a9000000 {
+       opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "xlnx,compound";
                ranges = <0 a9000000 2000>;
                // If this device had extra parameters, then they would
                // go here.
                ps2@0 {
                        compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
                        reg = <0 40>;
-                       interrupt-parent = <&opb-intc>;
+                       interrupt-parent = <&opb_intc_0>;
                        interrupts = <3 0>;
                        cell-index = <0>;
                };
                ps2@1000 {
                        compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
                        reg = <1000 40>;
-                       interrupt-parent = <&opb-intc>;
+                       interrupt-parent = <&opb_intc_0>;
                        interrupts = <3 0>;
                        cell-index = <0>;
                };
@@ -2463,17 +2471,18 @@ platforms are moved over to use the flattened-device-tree model.
 
    Gives this device tree (some properties removed for clarity):
 
-       plb-v34-0 {
+       plb@0 {
                #address-cells = <1>;
                #size-cells = <1>;
+               compatible = "xlnx,plb-v34-1.02.a";
                device_type = "ibm,plb";
                ranges; // 1:1 translation
 
-               plb-bram-if-cntrl-0@ffff0000 {
+               plb_bram_if_cntrl_0: bram@ffff0000 {
                        reg = <ffff0000 10000>;
                }
 
-               opb-v20-0 {
+               opb@20000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges = <20000000 20000000 20000000
@@ -2481,11 +2490,11 @@ platforms are moved over to use the flattened-device-tree model.
                                  80000000 80000000 40000000
                                  c0000000 c0000000 20000000>;
 
-                       opb-uart16550-0@a0000000 {
+                       opb_uart16550_0: serial@a0000000 {
                                reg = <a00000000 2000>;
                        };
 
-                       opb-intc-0@d1000fc0 {
+                       opb_intc_0: interrupt-controller@d1000fc0 {
                                reg = <d1000fc0 20>;
                        };
                };
index 65f4118cbe78b9f852820f2963498341fb3b6a57..b160322a87adc4ecec970b631122af67f770ffca 100644 (file)
@@ -1,4 +1,5 @@
 addnote
+dtc
 empty.c
 hack-coff
 infblock.c
index 33f25b671340ba20c4be26762d622d42fc94a44b..61a4045324cb78e04c128d91d256925a64aa13d4 100644 (file)
@@ -499,20 +499,45 @@ void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
        u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
        u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
        u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
+       u32 psr = mfdcr(DCRN_405_CPC0_PSR);
        u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
-       u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
+       u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv;
 
        fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
        fbdv = (pllmr & 0x1e000000) >> 25;
-       cbdv = ((pllmr & 0x00060000) >> 17) + 1;
-       opdv = ((pllmr & 0x00018000) >> 15) + 1;
-       epdv = ((pllmr & 0x00001800) >> 13) + 2;
+       if (fbdv == 0)
+               fbdv = 16;
+       cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
+       opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
+       ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
+       epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
        udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
 
-       m = fwdv * fbdv * cbdv;
+       /* check for 405GPr */
+       if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
+               fwdvb = 8 - (pllmr & 0x00000007);
+               if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
+                       if (psr & 0x00000020) /* New mode enable */
+                               m = fwdvb * 2 * ppdv;
+                       else
+                               m = fwdvb * cbdv * ppdv;
+               else if (psr & 0x00000020) /* New mode enable */
+                       if (psr & 0x00000800) /* PerClk synch mode */
+                               m = fwdvb * 2 * epdv;
+                       else
+                               m = fbdv * fwdv;
+               else if (epdv == fbdv)
+                       m = fbdv * cbdv * epdv;
+               else
+                       m = fbdv * fwdvb * cbdv;
 
-       cpu = sys_clk * m / fwdv;
-       plb = cpu / cbdv;
+               cpu = sys_clk * m / fwdv;
+               plb = sys_clk * m / (fwdvb * cbdv);
+       } else {
+               m = fwdv * fbdv * cbdv;
+               cpu = sys_clk * m / fwdv;
+               plb = cpu / cbdv;
+       }
        opb = plb / opdv;
        ebc = plb / epdv;
 
@@ -541,3 +566,45 @@ void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
        dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
 }
 
+
+void ibm405ep_fixup_clocks(unsigned int sys_clk)
+{
+       u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0);
+       u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1);
+       u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR);
+       u32 cpu, plb, opb, ebc, uart0, uart1;
+       u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv;
+       u32 pllmr0_ccdv, tb, m;
+
+       fwdva = 8 - ((pllmr1 & 0x00070000) >> 16);
+       fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12);
+       fbdv = (pllmr1 & 0x00f00000) >> 20;
+       if (fbdv == 0)
+               fbdv = 16;
+
+       cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */
+       epdv = ((pllmr0 & 0x00000300) >> 8) + 2;  /* PLB:EBC */
+       opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */
+
+       m = fbdv * fwdvb;
+
+       pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1;
+       if (pllmr1 & 0x80000000)
+               cpu = sys_clk * m / (fwdva * pllmr0_ccdv);
+       else
+               cpu = sys_clk / pllmr0_ccdv;
+
+       plb = cpu / cbdv;
+       opb = plb / opdv;
+       ebc = plb / epdv;
+       tb = cpu;
+       uart0 = cpu / (cpc0_ucr & 0x0000007f);
+       uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8);
+
+       dt_fixup_cpu_clocks(cpu, tb, 0);
+       dt_fixup_clock("/plb", plb);
+       dt_fixup_clock("/plb/opb", opb);
+       dt_fixup_clock("/plb/ebc", ebc);
+       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
+       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
+}
index fbe0632621cac1411a5367fb7256bf3468d81a45..2606e64f0c4b02b1d6cd85d801d8c762a32a6386 100644 (file)
@@ -20,6 +20,7 @@ void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
 void ibm4xx_fixup_ebc_ranges(const char *ebc);
 
 void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
+void ibm405ep_fixup_clocks(unsigned int sys_clk);
 void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
 void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
                           unsigned int tmr_clk);
index 55655f78505a2b2c219179221f8678d360d4751f..95b9f5344016a619d97d413d738dc89394c28511 100644 (file)
@@ -146,7 +146,12 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
 #define DCRN_CPC0_PLLMR 0xb0
 #define DCRN_405_CPC0_CR0 0xb1
 #define DCRN_405_CPC0_CR1 0xb2
+#define DCRN_405_CPC0_PSR 0xb4
 
+/* 405EP Clocking/Power Management/Chip Control regs */
+#define DCRN_CPC0_PLLMR0  0xf0
+#define DCRN_CPC0_PLLMR1  0xf4
+#define DCRN_CPC0_UCR     0xf5
 
 /* 440GX Clock control etc */
 
diff --git a/arch/powerpc/boot/dtc-src/.gitignore b/arch/powerpc/boot/dtc-src/.gitignore
new file mode 100644 (file)
index 0000000..a7c3f94
--- /dev/null
@@ -0,0 +1,3 @@
+dtc-lexer.lex.c
+dtc-parser.tab.c
+dtc-parser.tab.h
index cafeece20ac7c2675e3945457e26eb86e2269a10..b6c68ef46809527cc095ca1b559f4a5f7bc77261 100644 (file)
@@ -128,7 +128,8 @@ int serial_console_init(void)
                rc = cpm_console_init(devp, &serial_cd);
        else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
                rc = mpc5200_psc_console_init(devp, &serial_cd);
-       else if (dt_is_compatible(devp, "xilinx,uartlite"))
+       else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
+                dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
                rc = uartlite_console_init(devp, &serial_cd);
 
        /* Add other serial console driver calls here */
index 0dc9c4b4794d43cd553e4036a9f838e8e4778e99..1ed9afc9b281d8ece03cb0e50bee760859b4af2f 100644 (file)
@@ -376,9 +376,7 @@ CONFIG_MISC_DEVICES=y
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-CONFIG_MACINTOSH_DRIVERS=y
-# CONFIG_MAC_EMUMOUSEBTN is not set
-# CONFIG_WINDFARM is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
index c86e7565adc612bda8ae51ecaeb783a452a8d49f..8dca3d451c0e0bbd594fbc542eec0bb74d679d99 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.24-rc6
-# Mon Dec 24 11:18:12 2007
+# Thu Jan  3 14:21:31 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -453,9 +453,28 @@ CONFIG_NETDEVICES=y
 # CONFIG_VETH is not set
 # CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
-# CONFIG_NET_ETHERNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_IBM_NEW_EMAC=y
+CONFIG_IBM_NEW_EMAC_RXB=256
+CONFIG_IBM_NEW_EMAC_TXB=256
+CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
+# CONFIG_IBM_NEW_EMAC_DEBUG is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
 CONFIG_IBM_NEW_EMAC_RGMII=y
+# CONFIG_IBM_NEW_EMAC_TAH is not set
 CONFIG_IBM_NEW_EMAC_EMAC4=y
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
 # CONFIG_TR is not set
index 2bb4df82fbdadc8826559532effa6d5d443be2ea..abbfed6582e148501fe4d31e0dd5aadfa7fca69e 100644 (file)
@@ -449,9 +449,7 @@ CONFIG_MISC_DEVICES=y
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-CONFIG_MACINTOSH_DRIVERS=y
-# CONFIG_MAC_EMUMOUSEBTN is not set
-# CONFIG_WINDFARM is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
@@ -462,10 +460,28 @@ CONFIG_NETDEVICES=y
 # CONFIG_VETH is not set
 # CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
-# CONFIG_NET_ETHERNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_IBM_NEW_EMAC=y
+CONFIG_IBM_NEW_EMAC_RXB=128
+CONFIG_IBM_NEW_EMAC_TXB=64
+CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
+# CONFIG_IBM_NEW_EMAC_DEBUG is not set
 CONFIG_IBM_NEW_EMAC_ZMII=y
 CONFIG_IBM_NEW_EMAC_RGMII=y
+# CONFIG_IBM_NEW_EMAC_TAH is not set
 CONFIG_IBM_NEW_EMAC_EMAC4=y
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
index 9374bc9a2dd1a597332ee8afc9c12cb39971852c..d9b377070caa0e810525879e39a4b5816690928d 100644 (file)
@@ -91,3 +91,13 @@ obj-$(CONFIG_PPC64)          += $(obj64-y)
 
 extra-$(CONFIG_PPC_FPU)                += fpu.o
 extra-$(CONFIG_PPC64)          += entry_64.o
+
+extra-y                                += systbl_chk.i
+$(obj)/systbl.o:               systbl_chk
+
+quiet_cmd_systbl_chk = CALL    $<
+      cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
+
+PHONY += systbl_chk
+systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
+       $(call cmd,systbl_chk)
index 9c74fdf29eeccc8f5c56adb7b1a5c98fc09a21e3..80e2eef05b2e6c5fd6e8fed925b8761e28a27d4d 100644 (file)
@@ -236,7 +236,7 @@ int __init btext_find_display(int allow_nonstdout)
        if (rc == 0 || !allow_nonstdout)
                return rc;
 
-       for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
+       for_each_node_by_type(np, "display") {
                if (of_get_property(np, "linux,opened", NULL)) {
                        printk("trying %s ...\n", np->full_name);
                        rc = btext_initialize(np);
index caae49ff06683eb44f3ed6d1e89a98bf4f37d5ab..fd5ae8d17c96e2d586c03e75f8e6f6d520283629 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/kobject.h>
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
 #include <asm/ibmebus.h>
 #include <asm/abs_addr.h>
@@ -171,7 +172,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
 
        root = of_find_node_by_path("/");
 
-       for (child = NULL; (child = of_get_next_child(root, child)); ) {
+       for_each_child_of_node(root, child) {
                if (!of_match_node(matches, child))
                        continue;
 
index b9cae6b1f8caf057d4328378c84902e8bc739e7b..4bfff8863bcb2069a58d2d123a4e1bdcecf836a6 100644 (file)
@@ -307,7 +307,7 @@ void __init find_legacy_serial_ports(void)
        }
 
        /* First fill our array with SOC ports */
-       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
+       for_each_compatible_node(np, "serial", "ns16550") {
                struct device_node *soc = of_get_parent(np);
                if (soc && !strcmp(soc->type, "soc")) {
                        index = add_legacy_soc_port(np, np);
@@ -318,7 +318,7 @@ void __init find_legacy_serial_ports(void)
        }
 
        /* First fill our array with ISA ports */
-       for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
+       for_each_node_by_type(np, "serial") {
                struct device_node *isa = of_get_parent(np);
                if (isa && !strcmp(isa->name, "isa")) {
                        index = add_legacy_isa_port(np, isa);
@@ -329,7 +329,7 @@ void __init find_legacy_serial_ports(void)
        }
 
        /* First fill our array with tsi-bridge ports */
-       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
+       for_each_compatible_node(np, "serial", "ns16550") {
                struct device_node *tsi = of_get_parent(np);
                if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
                        index = add_legacy_soc_port(np, np);
@@ -340,7 +340,7 @@ void __init find_legacy_serial_ports(void)
        }
 
        /* First fill our array with opb bus ports */
-       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
+       for_each_compatible_node(np, "serial", "ns16550") {
                struct device_node *opb = of_get_parent(np);
                if (opb && (!strcmp(opb->type, "opb") ||
                            of_device_is_compatible(opb, "ibm,opb"))) {
index 3388ad61999654feda0a0794f657a9492325ea38..5748ddb47d9f82fc332b844e56613d3a6e84a07b 100644 (file)
@@ -5,10 +5,10 @@
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
 #include <linux/slab.h>
+#include <linux/of_device.h>
 
 #include <asm/errno.h>
 #include <asm/dcr.h>
-#include <asm/of_device.h>
 
 static void of_device_make_bus_id(struct of_device *dev)
 {
index de36e235a60a3a2b4be2a9a8379f88b0cc29047b..fb698d47082d3d10c17edcdff354ce4f832858b6 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 
@@ -108,7 +109,7 @@ static int of_platform_bus_create(const struct device_node *bus,
        struct of_device *dev;
        int rc = 0;
 
-       for (child = NULL; (child = of_get_next_child(bus, child)); ) {
+       for_each_child_of_node(bus, child) {
                pr_debug("   create child: %s\n", child->full_name);
                dev = of_platform_device_create(child, NULL, parent);
                if (dev == NULL)
@@ -170,7 +171,7 @@ int of_platform_bus_probe(struct device_node *root,
                rc = of_platform_bus_create(root, matches, &dev->dev);
                goto bail;
        }
-       for (child = NULL; (child = of_get_next_child(root, child)); ) {
+       for_each_child_of_node(root, child) {
                if (!of_match_node(matches, child))
                        continue;
 
index a9c6cb24aab0c16f4165f7cfcf3389e4c1a826f0..14e300f85ce4857478c84acd6c5d6eefd59516aa 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/bootmem.h>
 #include <linux/irq.h>
 #include <linux/list.h>
+#include <linux/of.h>
 
 #include <asm/processor.h>
 #include <asm/io.h>
@@ -171,7 +172,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
        } else
                pci_to_OF_bus_map[pci_bus] = bus_range[0];
 
-       for (node=node->child; node != 0;node = node->sibling) {
+       for_each_child_of_node(node, node) {
                struct pci_dev* dev;
                const unsigned int *class_code, *reg;
        
@@ -240,15 +241,18 @@ pcibios_make_OF_bus_map(void)
 typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
 
 static struct device_node*
-scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
+scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void* data)
 {
+       struct device_node *node;
        struct device_node* sub_node;
 
-       for (; node != 0;node = node->sibling) {
+       for_each_child_of_node(parent, node) {
                const unsigned int *class_code;
        
-               if (filter(node, data))
+               if (filter(node, data)) {
+                       of_node_put(node);
                        return node;
+               }
 
                /* For PCI<->PCI bridges or CardBus bridges, we go down
                 * Note: some OFs create a parent node "multifunc-device" as
@@ -260,9 +264,11 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
                        (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
                        strcmp(node->name, "multifunc-device"))
                        continue;
-               sub_node = scan_OF_pci_childs(node->child, filter, data);
-               if (sub_node)
+               sub_node = scan_OF_pci_childs(node, filter, data);
+               if (sub_node) {
+                       of_node_put(node);
                        return sub_node;
+               }
        }
        return NULL;
 }
@@ -270,11 +276,11 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
 static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
                                               unsigned int devfn)
 {
-       struct device_node *np = NULL;
+       struct device_node *np;
        const u32 *reg;
        unsigned int psize;
 
-       while ((np = of_get_next_child(parent, np)) != NULL) {
+       for_each_child_of_node(parent, np) {
                reg = of_get_property(np, "reg", &psize);
                if (reg == NULL || psize < 4)
                        continue;
@@ -366,7 +372,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
        hose = pci_find_hose_for_OF_device(node);
        if (!hose || !hose->dn)
                return -ENODEV;
-       if (!scan_OF_pci_childs(hose->dn->child,
+       if (!scan_OF_pci_childs(hose->dn,
                        find_OF_pci_device_filter, (void *)node))
                return -ENODEV;
        reg = of_get_property(node, "reg", NULL);
index 5949bbabd7fb7620316d57b08ec012bef9f89a28..1930f393d01c9275a87025f0fcd0f76a5dcdec5b 100644 (file)
@@ -227,7 +227,7 @@ EXPORT_SYMBOL(of_create_pci_dev);
 void __devinit of_scan_bus(struct device_node *node,
                           struct pci_bus *bus)
 {
-       struct device_node *child = NULL;
+       struct device_node *child;
        const u32 *reg;
        int reglen, devfn;
        struct pci_dev *dev;
@@ -235,7 +235,7 @@ void __devinit of_scan_bus(struct device_node *node,
        DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
 
        /* Scan direct children */
-       while ((child = of_get_next_child(node, child)) != NULL) {
+       for_each_child_of_node(node, child) {
                DBG("  * %s\n", child->full_name);
                reg = of_get_property(child, "reg", &reglen);
                if (reg == NULL || reglen < 20)
index 85d4d8924b5ca1628cde9eee99088f53b5885098..1c67de52e3ce5d44e2a91c08b1cedd661e240f4a 100644 (file)
@@ -56,11 +56,6 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
                pdn->busno = (regs[0] >> 16) & 0xff;
                pdn->devfn = (regs[0] >> 8) & 0xff;
        }
-       if (firmware_has_feature(FW_FEATURE_ISERIES)) {
-               const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
-               if (busp)
-                       pdn->bussubno = *busp;
-       }
 
        pdn->pci_ext_config_space = (type && *type == 1);
        return NULL;
index 99aaae3409c0bf2b5148165c4d41f69fa00ae2df..433a0a0949fb2341b61384d553520e19fcdf4a38 100644 (file)
@@ -280,10 +280,7 @@ void __init find_and_init_phbs(void)
        struct pci_controller *phb;
        struct device_node *root = of_find_node_by_path("/");
 
-       for (node = of_get_next_child(root, NULL);
-            node != NULL;
-            node = of_get_next_child(root, node)) {
-
+       for_each_child_of_node(root, node) {
                if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
                                           strcmp(node->type, "pciex") != 0))
                        continue;
diff --git a/arch/powerpc/kernel/systbl_chk.c b/arch/powerpc/kernel/systbl_chk.c
new file mode 100644 (file)
index 0000000..77824d1
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * This file, when run through CPP produces a list of syscall numbers
+ * in the order of systbl.h.  That way we can check for gaps and syscalls
+ * that are out of order.
+ *
+ * Unfortunately, we cannot check for the correct ordering of entries
+ * using SYSX().
+ *
+ * Copyright Ã‚© IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <asm/unistd.h>
+
+#define SYSCALL(func)          __NR_##func
+#define COMPAT_SYS(func)       __NR_##func
+#define PPC_SYS(func)          __NR_##func
+#ifdef CONFIG_PPC64
+#define OLDSYS(func)           -1
+#define SYS32ONLY(func)                -1
+#else
+#define OLDSYS(func)           __NR_old##func
+#define SYS32ONLY(func)                __NR_##func
+#endif
+#define SYSX(f, f3264, f32)    -1
+
+#define SYSCALL_SPU(func)      SYSCALL(func)
+#define COMPAT_SYS_SPU(func)   COMPAT_SYS(func)
+#define PPC_SYS_SPU(func)      PPC_SYS(func)
+#define SYSX_SPU(f, f3264, f32)        SYSX(f, f3264, f32)
+
+/* Just insert a marker for ni_syscalls */
+#define        __NR_ni_syscall         -1
+
+/*
+ * These are the known exceptions.
+ * Hopefully, there will be no more.
+ */
+#define        __NR_llseek             __NR__llseek
+#undef __NR_umount
+#define        __NR_umount             __NR_umount2
+#define        __NR_old_getrlimit      __NR_getrlimit
+#define        __NR_newstat            __NR_stat
+#define        __NR_newlstat           __NR_lstat
+#define        __NR_newfstat           __NR_fstat
+#define        __NR_newuname           __NR_uname
+#define        __NR_sysctl             __NR__sysctl
+#define __NR_olddebug_setcontext       __NR_sys_debug_setcontext
+
+/* We call sys_ugetrlimit for syscall number __NR_getrlimit */
+#define getrlimit              ugetrlimit
+
+START_TABLE
+#include <asm/systbl.h>
+END_TABLE __NR_syscalls
diff --git a/arch/powerpc/kernel/systbl_chk.sh b/arch/powerpc/kernel/systbl_chk.sh
new file mode 100644 (file)
index 0000000..367d208
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Just process the CPP output from systbl_chk.c and complain
+# if anything is out of order.
+#
+# Copyright Ã‚© 2008 IBM Corporation
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+
+awk    'BEGIN { num = -1; }    # Ignore the beginning of the file
+       /^#/ { next; }
+       /^[ \t]*$/ { next; }
+       /^START_TABLE/ { num = 0; next; }
+       /^END_TABLE/ {
+               if (num != $2) {
+                       printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n",
+                               $2, num - 1;
+                       exit(1);
+               }
+               num = -1;       # Ignore the rest of the file
+       }
+       {
+               if (num == -1) next;
+               if (($1 != -1) && ($1 != num)) {
+                       printf "Syscall %s out of order (expected %s)\n",
+                               $1, num;
+                       exit(1);
+               };
+               num++;
+       }' "$1"
index cbbd8b0bc8f4070d37243491be3e3a0025be88d6..9326a6962b42987ab991c412760a70d8f49a10cd 100644 (file)
@@ -369,18 +369,11 @@ static void __init htab_init_page_sizes(void)
         * on what is available
         */
        if (mmu_psize_defs[MMU_PAGE_16M].shift)
-               mmu_huge_psize = MMU_PAGE_16M;
+               set_huge_psize(MMU_PAGE_16M);
        /* With 4k/4level pagetables, we can't (for now) cope with a
         * huge page size < PMD_SIZE */
        else if (mmu_psize_defs[MMU_PAGE_1M].shift)
-               mmu_huge_psize = MMU_PAGE_1M;
-
-       /* Calculate HPAGE_SHIFT and sanity check it */
-       if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
-           mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
-               HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
-       else
-               HPAGE_SHIFT = 0; /* No huge pages dude ! */
+               set_huge_psize(MMU_PAGE_1M);
 #endif /* CONFIG_HUGETLB_PAGE */
 }
 
index 71efb38d599be75490f61ca929a160ea8f86ab8c..a02266dad215cc3d1065b69e542bf48f8e2e27be 100644 (file)
 #include <asm/cputable.h>
 #include <asm/spu.h>
 
+#define HPAGE_SHIFT_64K        16
+#define HPAGE_SHIFT_16M        24
+
 #define NUM_LOW_AREAS  (0x100000000UL >> SID_SHIFT)
 #define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
 
-#ifdef CONFIG_PPC_64K_PAGES
-#define HUGEPTE_INDEX_SIZE     (PMD_SHIFT-HPAGE_SHIFT)
-#else
-#define HUGEPTE_INDEX_SIZE     (PUD_SHIFT-HPAGE_SHIFT)
-#endif
-#define PTRS_PER_HUGEPTE       (1 << HUGEPTE_INDEX_SIZE)
-#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << HUGEPTE_INDEX_SIZE)
+unsigned int hugepte_shift;
+#define PTRS_PER_HUGEPTE       (1 << hugepte_shift)
+#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << hugepte_shift)
 
-#define HUGEPD_SHIFT           (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE)
+#define HUGEPD_SHIFT           (HPAGE_SHIFT + hugepte_shift)
 #define HUGEPD_SIZE            (1UL << HUGEPD_SHIFT)
 #define HUGEPD_MASK            (~(HUGEPD_SIZE-1))
 
@@ -82,11 +81,35 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
        return 0;
 }
 
+/* Base page size affects how we walk hugetlb page tables */
+#ifdef CONFIG_PPC_64K_PAGES
+#define hpmd_offset(pud, addr)         pmd_offset(pud, addr)
+#define hpmd_alloc(mm, pud, addr)      pmd_alloc(mm, pud, addr)
+#else
+static inline
+pmd_t *hpmd_offset(pud_t *pud, unsigned long addr)
+{
+       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
+               return pmd_offset(pud, addr);
+       else
+               return (pmd_t *) pud;
+}
+static inline
+pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
+{
+       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
+               return pmd_alloc(mm, pud, addr);
+       else
+               return (pmd_t *) pud;
+}
+#endif
+
 /* Modelled after find_linux_pte() */
 pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 {
        pgd_t *pg;
        pud_t *pu;
+       pmd_t *pm;
 
        BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
 
@@ -96,14 +119,9 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
        if (!pgd_none(*pg)) {
                pu = pud_offset(pg, addr);
                if (!pud_none(*pu)) {
-#ifdef CONFIG_PPC_64K_PAGES
-                       pmd_t *pm;
-                       pm = pmd_offset(pu, addr);
+                       pm = hpmd_offset(pu, addr);
                        if (!pmd_none(*pm))
                                return hugepte_offset((hugepd_t *)pm, addr);
-#else
-                       return hugepte_offset((hugepd_t *)pu, addr);
-#endif
                }
        }
 
@@ -114,6 +132,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
 {
        pgd_t *pg;
        pud_t *pu;
+       pmd_t *pm;
        hugepd_t *hpdp = NULL;
 
        BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
@@ -124,14 +143,9 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
        pu = pud_alloc(mm, pg, addr);
 
        if (pu) {
-#ifdef CONFIG_PPC_64K_PAGES
-               pmd_t *pm;
-               pm = pmd_alloc(mm, pu, addr);
+               pm = hpmd_alloc(mm, pu, addr);
                if (pm)
                        hpdp = (hugepd_t *)pm;
-#else
-               hpdp = (hugepd_t *)pu;
-#endif
        }
 
        if (! hpdp)
@@ -158,7 +172,6 @@ static void free_hugepte_range(struct mmu_gather *tlb, hugepd_t *hpdp)
                                                 PGF_CACHENUM_MASK));
 }
 
-#ifdef CONFIG_PPC_64K_PAGES
 static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
                                   unsigned long addr, unsigned long end,
                                   unsigned long floor, unsigned long ceiling)
@@ -191,7 +204,6 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
        pud_clear(pud);
        pmd_free_tlb(tlb, pmd);
 }
-#endif
 
 static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
                                   unsigned long addr, unsigned long end,
@@ -210,9 +222,15 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
                        continue;
                hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
 #else
-               if (pud_none(*pud))
-                       continue;
-               free_hugepte_range(tlb, (hugepd_t *)pud);
+               if (HPAGE_SHIFT == HPAGE_SHIFT_64K) {
+                       if (pud_none_or_clear_bad(pud))
+                               continue;
+                       hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
+               } else {
+                       if (pud_none(*pud))
+                               continue;
+                       free_hugepte_range(tlb, (hugepd_t *)pud);
+               }
 #endif
        } while (pud++, addr = next, addr != end);
 
@@ -526,6 +544,57 @@ repeat:
        return err;
 }
 
+void set_huge_psize(int psize)
+{
+       /* Check that it is a page size supported by the hardware and
+        * that it fits within pagetable limits. */
+       if (mmu_psize_defs[psize].shift && mmu_psize_defs[psize].shift < SID_SHIFT &&
+               (mmu_psize_defs[psize].shift > MIN_HUGEPTE_SHIFT ||
+                       mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K)) {
+               HPAGE_SHIFT = mmu_psize_defs[psize].shift;
+               mmu_huge_psize = psize;
+#ifdef CONFIG_PPC_64K_PAGES
+               hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
+#else
+               if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
+                       hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
+               else
+                       hugepte_shift = (PUD_SHIFT-HPAGE_SHIFT);
+#endif
+
+       } else
+               HPAGE_SHIFT = 0;
+}
+
+static int __init hugepage_setup_sz(char *str)
+{
+       unsigned long long size;
+       int mmu_psize = -1;
+       int shift;
+
+       size = memparse(str, &str);
+
+       shift = __ffs(size);
+       switch (shift) {
+#ifndef CONFIG_PPC_64K_PAGES
+       case HPAGE_SHIFT_64K:
+               mmu_psize = MMU_PAGE_64K;
+               break;
+#endif
+       case HPAGE_SHIFT_16M:
+               mmu_psize = MMU_PAGE_16M;
+               break;
+       }
+
+       if (mmu_psize >=0 && mmu_psize_defs[mmu_psize].shift)
+               set_huge_psize(mmu_psize);
+       else
+               printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
+
+       return 1;
+}
+__setup("hugepagesz=", hugepage_setup_sz);
+
 static void zero_ctor(struct kmem_cache *cache, void *addr)
 {
        memset(addr, 0, kmem_cache_size(cache));
index 43fcc8e9f7d0f7610c73333fe86162ad47134247..88b66444dfb24df543a76692f426d9ea8156b765 100644 (file)
 #include <asm/time.h>
 #include <asm/xilinx_intc.h>
 
+static struct of_device_id xilinx_of_bus_ids[] __initdata = {
+       { .compatible = "xlnx,plb-v46-1.00.a", },
+       { .compatible = "xlnx,plb-v34-1.01.a", },
+       { .compatible = "xlnx,plb-v34-1.02.a", },
+       { .compatible = "xlnx,opb-v20-1.10.c", },
+       { .compatible = "xlnx,dcr-v29-1.00.a", },
+       { .compatible = "xlnx,compound", },
+       {}
+};
+
 static int __init virtex_device_probe(void)
 {
-       of_platform_bus_probe(NULL, NULL, NULL);
+       of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
 
        return 0;
 }
index a4ce5ba8fe3282a4eac93f7837363511e2bfce96..a7fae1cf69c1cdd76cf116543c51a4136c2d8b65 100644 (file)
  * option) any later version.
  */
 #include <linux/init.h>
+#include <linux/of_platform.h>
+
 #include <asm/machdep.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-#include <asm/of_platform.h>
 #include <asm/pci-bridge.h>
 #include "44x.h"
 
index 374f8c7fcd01353711cff0a49996c0a36b06368b..d279db42c896d1f0c0532f38abd611d2131b96d8 100644 (file)
@@ -38,7 +38,7 @@ static int __init sequoia_device_probe(void)
 
        return 0;
 }
-machien_device_initcall(sequoia, sequoia_device_probe);
+machine_device_initcall(sequoia, sequoia_device_probe);
 
 static int __init sequoia_probe(void)
 {
index b86076e3c09e402a6e74b880a8d23a8160143b33..979d4b67efb45dcb6562133d2d977ebed6de14e4 100644 (file)
@@ -309,9 +309,6 @@ static int __init spider_pci_workaround_init(void)
 {
        struct pci_controller *phb;
 
-       if (!machine_is(cell))
-               return 0;
-
        /* Find spider bridges. We assume they have been all probed
         * in setup_arch(). If that was to change, we would need to
         * update this code to cope with dynamically added busses
@@ -343,4 +340,4 @@ static int __init spider_pci_workaround_init(void)
 
        return 0;
 }
-arch_initcall(spider_pci_workaround_init);
+machine_arch_initcall(cell, spider_pci_workaround_init);
index 1221c6d8650f09014b8ffcdbb947576a3140523c..bceb5e13da5c7d0cf502eed6aee71fde4ae9a152 100644 (file)
@@ -700,10 +700,6 @@ static int __init cell_iommu_init(void)
 {
        struct device_node *np;
 
-       if (!machine_is(cell) &&
-           !machine_is(celleb_native))
-               return -ENODEV;
-
        /* If IOMMU is disabled or we have little enough RAM to not need
         * to enable it, we setup a direct mapping.
         *
@@ -746,5 +742,6 @@ static int __init cell_iommu_init(void)
 
        return 0;
 }
-arch_initcall(cell_iommu_init);
+machine_arch_initcall(cell, cell_iommu_init);
+machine_arch_initcall(celleb_native, cell_iommu_init);
 
index 99d688e88cbe1e51888f7fc6ec3b9f900a518ffe..69ed0d7f164673f069073231bed32e3ba72bd014 100644 (file)
@@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
        unsigned int irq;
        int rc, node;
 
-       if (!machine_is(cell))
-               return 0;
-
        for_each_node(node) {
                irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
                                               (node << IIC_IRQ_NODE_SHIFT));
@@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
 
        return 0;
 }
-arch_initcall(cbe_init_pm_irq);
+machine_arch_initcall(cell, cbe_init_pm_irq);
 
 void cbe_sync_irq(int node)
 {
index 4f6347c9fe68266d4d88638fa33b18d61f6fb7d1..e6534b519c9abb71267299eb313c1b9535571634 100644 (file)
@@ -85,9 +85,6 @@ static int __init cell_publish_devices(void)
 {
        int node;
 
-       if (!machine_is(cell))
-               return 0;
-
        /* Publish OF platform devices for southbridge IOs */
        of_platform_bus_probe(NULL, NULL, NULL);
 
@@ -101,7 +98,7 @@ static int __init cell_publish_devices(void)
        }
        return 0;
 }
-device_initcall(cell_publish_devices);
+machine_device_initcall(cell, cell_publish_devices);
 
 static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
 {
index b939c0e98af8eaf018acb3afce1621f32a87172d..423339be1bac8f3c2a0ef2400fcf19ede0275682 100644 (file)
@@ -22,6 +22,7 @@
 
 #undef DEBUG
 
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/irq.h>
 
index fbe718d517a65e6c91ea83633a2eb5240f0de205..41e1e6f8e05915fa14b558886ab9a4d2b58b6637 100644 (file)
@@ -92,9 +92,6 @@ static struct notifier_block celleb_of_bus_notifier = {
 
 static int __init celleb_init_iommu(void)
 {
-       if (!machine_is(celleb_beat))
-               return -ENODEV;
-
        celleb_init_direct_mapping();
        set_pci_dma_ops(&dma_direct_ops);
        bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
@@ -102,4 +99,4 @@ static int __init celleb_init_iommu(void)
        return 0;
 }
 
-arch_initcall(celleb_init_iommu);
+machine_arch_initcall(celleb_beat, celleb_init_iommu);
index 5d399e038c2326954002f956e89199d97f333f10..51b390d34e4dc51dd085075b0b4289648ad26008 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/pci_regs.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 
 #include <asm/io.h>
index 0f0c4680bf013071dd11ba50c13e50e73acbe0c3..f27ae1e3fb58d010f79735822cf9b297c6407e5f 100644 (file)
@@ -111,10 +111,6 @@ static struct of_device_id celleb_bus_ids[] __initdata = {
 
 static int __init celleb_publish_devices(void)
 {
-       if (!machine_is(celleb_beat) &&
-           !machine_is(celleb_native))
-               return -ENODEV;
-
        /* Publish OF platform devices for southbridge IOs */
        of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
 
@@ -122,7 +118,8 @@ static int __init celleb_publish_devices(void)
 
        return 0;
 }
-device_initcall(celleb_publish_devices);
+machine_device_initcall(celleb_beat, celleb_publish_devices);
+machine_device_initcall(celleb_native, celleb_publish_devices);
 
 
 /*
index 30e3d992dc0d9a1988d44c27bcedc54f0d651008..cc562e4c2f3269828f314d92af1b3f91248cb466 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/of.h>
 
 #include <asm/types.h>
 #include <asm/io.h>
@@ -70,7 +71,7 @@ static long current_iomm_table_entry;
  * Lookup Tables.
  */
 static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES];
-static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES];
+static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES];
 
 static DEFINE_SPINLOCK(iomm_table_lock);
 
@@ -80,8 +81,9 @@ static DEFINE_SPINLOCK(iomm_table_lock);
 static inline u64 iseries_ds_addr(struct device_node *node)
 {
        struct pci_dn *pdn = PCI_DN(node);
+       const u32 *sbp = of_get_property(node, "linux,subbus", NULL);
 
-       return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
+       return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40)
                        + ((u64)0x10 << 32);
 }
 
@@ -333,7 +335,8 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
         */
        while (bar_size > 0 ) {
                iomm_table[current_iomm_table_entry] = dev->sysdata;
-               iobar_table[current_iomm_table_entry] = bar_num;
+               ds_addr_table[current_iomm_table_entry] =
+                       iseries_ds_addr(dev->sysdata) | (bar_num << 24);
                bar_size -= IOMM_TABLE_ENTRY_SIZE;
                ++current_iomm_table_entry;
        }
@@ -438,7 +441,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
        }
 
        pdev->sysdata = node;
-       PCI_DN(node)->pcidev = pdev;
        allocate_device_bars(pdev);
        iseries_device_information(pdev, bus, *sub_bus);
        iommu_devnode_init_iSeries(pdev, node);
@@ -599,8 +601,7 @@ static inline struct device_node *xlate_iomm_address(
        dn = iomm_table[ind];
 
        if (dn != NULL) {
-               int barnum = iobar_table[ind];
-               *dsaptr = iseries_ds_addr(dn) | (barnum << 24);
+               *dsaptr = ds_addr_table[ind];
                *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE;
        } else
                panic("PCI: Invalid PCI IO address detected!\n");
index 144177d77cf1075bf590afb8492141d932f59200..3ce2d73b4177791c1a61a7643bd6e1ff7def86aa 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/serial.h>
 #include <linux/smp.h>
 #include <linux/bitops.h>
+#include <linux/of_device.h>
 
 #include <asm/processor.h>
 #include <asm/sections.h>
@@ -56,7 +57,6 @@
 #include <asm/dma.h>
 #include <asm/cputable.h>
 #include <asm/time.h>
-#include <asm/of_device.h>
 #include <asm/lmb.h>
 #include <asm/mpic.h>
 #include <asm/rtas.h>
index da2007e3db0e982c78431f38d8d07b44bef82afb..21226b74c9b20e05aa7cb143c1f40a43fc902d15 100644 (file)
@@ -585,8 +585,7 @@ static void __init kw_i2c_probe(void)
        struct device_node *np, *child, *parent;
 
        /* Probe keywest-i2c busses */
-       for (np = NULL;
-            (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){
+       for_each_compatible_node(np, "i2c","keywest-i2c") {
                struct pmac_i2c_host_kw *host;
                int multibus, chans, i;
 
@@ -1462,9 +1461,6 @@ int __init pmac_i2c_init(void)
                return 0;
        i2c_inited = 1;
 
-       if (!machine_is(powermac))
-               return 0;
-
        /* Probe keywest-i2c busses */
        kw_i2c_probe();
 
@@ -1483,7 +1479,7 @@ int __init pmac_i2c_init(void)
 
        return 0;
 }
-arch_initcall(pmac_i2c_init);
+machine_arch_initcall(powermac, pmac_i2c_init);
 
 /* Since pmac_i2c_init can be called too early for the platform device
  * registration, we need to do it at a later time. In our case, subsys
@@ -1515,4 +1511,4 @@ static int __init pmac_i2c_create_platform_devices(void)
 
        return 0;
 }
-subsys_initcall(pmac_i2c_create_platform_devices);
+machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
index 45d54b9ad9e04b0941bb94699a6373fe0dec53d0..db20de512f3e259c80f5e5c051a1b582d5fe9905 100644 (file)
@@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
 
        return 0;
 }
-
-arch_initcall(pmac_pfunc_base_install);
+machine_arch_initcall(powermac, pmac_pfunc_base_install);
 
 #ifdef CONFIG_PM
 
index 999f5e160897ba23ba07d7b6ae766d028fa26a7e..cd7216437416412fdaefebecd73c41a509189c26 100644 (file)
@@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
        sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
        return 0;
 }
-
-subsys_initcall(init_pmacpic_sysfs);
+machine_subsys_initcall(powermac, init_pmacpic_sysfs);
 
index adad4e97638182ce31ef9733ba14c6fd7e1c709f..36ff1b6b7fac43f58a77778947809cdb5ae10014 100644 (file)
@@ -397,17 +397,13 @@ static int initializing = 1;
 
 static int pmac_late_init(void)
 {
-       if (!machine_is(powermac))
-               return -ENODEV;
-
        initializing = 0;
        /* this is udbg (which is __init) and we can later use it during
         * cpu hotplug (in smp_core99_kick_cpu) */
        ppc_md.progress = NULL;
        return 0;
 }
-
-late_initcall(pmac_late_init);
+machine_late_initcall(powermac, pmac_late_init);
 
 /*
  * This is __init_refok because we check for "initializing" before
@@ -534,9 +530,6 @@ static int __init pmac_declare_of_platform_devices(void)
        if (machine_is(chrp))
                return -1;
 
-       if (!machine_is(powermac))
-               return 0;
-
        np = of_find_node_by_name(NULL, "valkyrie");
        if (np)
                of_platform_device_create(np, "valkyrie", NULL);
@@ -551,8 +544,7 @@ static int __init pmac_declare_of_platform_devices(void)
 
        return 0;
 }
-
-device_initcall(pmac_declare_of_platform_devices);
+machine_device_initcall(powermac, pmac_declare_of_platform_devices);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
index aa14a8559edb99480cd65b63c15b27546b4ba50a..9eb539ee5f9a1c05b7262637fe764736431ab0d7 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/rbtree.h>
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
+#include <linux/of.h>
+
 #include <asm/atomic.h>
 #include <asm/eeh.h>
 #include <asm/eeh_event.h>
@@ -169,7 +171,6 @@ static void rtas_slot_error_detail(struct pci_dn *pdn, int severity,
  */
 static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
 {
-       struct device_node *dn;
        struct pci_dev *dev = pdn->pcidev;
        u32 cfg;
        int cap, i;
@@ -243,12 +244,12 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
 
        /* Gather status on devices under the bridge */
        if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
-               dn = pdn->node->child;
-               while (dn) {
+               struct device_node *dn;
+
+               for_each_child_of_node(pdn->node, dn) {
                        pdn = PCI_DN(dn);
                        if (pdn)
                                n += gather_pci_data(pdn, buf+n, len-n);
-                       dn = dn->sibling;
                }
        }
 
@@ -372,7 +373,7 @@ struct device_node * find_device_pe(struct device_node *dn)
        return dn;
 }
 
-/** Mark all devices that are peers of this device as failed.
+/** Mark all devices that are children of this device as failed.
  *  Mark the device driver too, so that it can see the failure
  *  immediately; this is critical, since some drivers poll
  *  status registers in interrupts ... If a driver is polling,
@@ -380,9 +381,11 @@ struct device_node * find_device_pe(struct device_node *dn)
  *  an interrupt context, which is bad.
  */
 
-static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
+static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
 {
-       while (dn) {
+       struct device_node *dn;
+
+       for_each_child_of_node(parent, dn) {
                if (PCI_DN(dn)) {
                        /* Mark the pci device driver too */
                        struct pci_dev *dev = PCI_DN(dn)->pcidev;
@@ -392,10 +395,8 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
                        if (dev && dev->driver)
                                dev->error_state = pci_channel_io_frozen;
 
-                       if (dn->child)
-                               __eeh_mark_slot (dn->child, mode_flag);
+                       __eeh_mark_slot(dn, mode_flag);
                }
-               dn = dn->sibling;
        }
 }
 
@@ -415,19 +416,19 @@ void eeh_mark_slot (struct device_node *dn, int mode_flag)
        if (dev)
                dev->error_state = pci_channel_io_frozen;
 
-       __eeh_mark_slot (dn->child, mode_flag);
+       __eeh_mark_slot(dn, mode_flag);
 }
 
-static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
+static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
 {
-       while (dn) {
+       struct device_node *dn;
+
+       for_each_child_of_node(parent, dn) {
                if (PCI_DN(dn)) {
                        PCI_DN(dn)->eeh_mode &= ~mode_flag;
                        PCI_DN(dn)->eeh_check_count = 0;
-                       if (dn->child)
-                               __eeh_clear_slot (dn->child, mode_flag);
+                       __eeh_clear_slot(dn, mode_flag);
                }
-               dn = dn->sibling;
        }
 }
 
@@ -444,7 +445,7 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
 
        PCI_DN(dn)->eeh_mode &= ~mode_flag;
        PCI_DN(dn)->eeh_check_count = 0;
-       __eeh_clear_slot (dn->child, mode_flag);
+       __eeh_clear_slot(dn, mode_flag);
        spin_unlock_irqrestore(&confirm_error_lock, flags);
 }
 
@@ -849,11 +850,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
        if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
                __restore_bars (pdn);
 
-       dn = pdn->node->child;
-       while (dn) {
+       for_each_child_of_node(pdn->node, dn)
                eeh_restore_bars (PCI_DN(dn));
-               dn = dn->sibling;
-       }
 }
 
 /**
@@ -1131,7 +1129,8 @@ static void eeh_add_device_early(struct device_node *dn)
 void eeh_add_device_tree_early(struct device_node *dn)
 {
        struct device_node *sib;
-       for (sib = dn->child; sib; sib = sib->sibling)
+
+       for_each_child_of_node(dn, sib)
                eeh_add_device_tree_early(sib);
        eeh_add_device_early(dn);
 }
index 4baad80ab7316da61053dc7a3dd1a568497dcddd..217bcc2e8f8664f5af07ef8a871f499d5300c50e 100644 (file)
@@ -1128,13 +1128,12 @@ arch_initcall(fs_enet_of_init);
 
 static int __init fsl_pcmcia_of_init(void)
 {
-       struct device_node *np = NULL;
+       struct device_node *np;
        /*
         * Register all the devices which type is "pcmcia"
         */
-       while ((np = of_find_compatible_node(np,
-                       "pcmcia", "fsl,pq-pcmcia")) != NULL)
-                           of_platform_device_create(np, "m8xx-pcmcia", NULL);
+       for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia")
+               of_platform_device_create(np, "m8xx-pcmcia", NULL);
        return 0;
 }
 
index 548a32082e4a2f65dd5173b47ad2ded12e1f1573..304056cafb1ed20cfbe50ed45bc5ebe897022b14 100644 (file)
@@ -241,7 +241,7 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
 
        /* only register the shared platform device the first time through */
        if (id == 0 && (err = eth_register_shared_pdev(np)))
-               return err;;
+               return err;
 
        memset(r, 0, sizeof(r));
        of_irq_to_resource(np, 0, &r[0]);
@@ -451,22 +451,19 @@ static int __init mv64x60_device_setup(void)
        int id;
        int err;
 
-       for (id = 0;
-            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++)
-               if ((err = mv64x60_mpsc_device_setup(np, id)))
+       id = 0;
+       for_each_compatible_node(np, "serial", "marvell,mpsc")
+               if ((err = mv64x60_mpsc_device_setup(np, id++)))
                        goto error;
 
-       for (id = 0;
-            (np = of_find_compatible_node(np, "network",
-                                          "marvell,mv64x60-eth"));
-            id++)
-               if ((err = mv64x60_eth_device_setup(np, id)))
+       id = 0;
+       for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
+               if ((err = mv64x60_eth_device_setup(np, id++)))
                        goto error;
 
-       for (id = 0;
-            (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c"));
-            id++)
-               if ((err = mv64x60_i2c_device_setup(np, id)))
+       id = 0;
+       for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
+               if ((err = mv64x60_i2c_device_setup(np, id++)))
                        goto error;
 
        /* support up to one watchdog timer */
@@ -477,7 +474,6 @@ static int __init mv64x60_device_setup(void)
                of_node_put(np);
        }
 
-
        return 0;
 
 error:
index 6933f9c73b43accc8ec55ac26ff6190a62529669..d21ab8fa4993c87d464c0c81a6fcb56d3dfc01f3 100644 (file)
@@ -164,8 +164,8 @@ static int __init mv64x60_add_bridge(struct device_node *dev)
 
 void __init mv64x60_pci_init(void)
 {
-       struct device_node *np = NULL;
+       struct device_node *np;
 
-       while ((np = of_find_compatible_node(np, "pci", "marvell,mv64x60-pci")))
+       for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
                mv64x60_add_bridge(np);
 }
index 367e7b13ec0071dddf539b575071a83f51a835e1..35c77c7d06168482ec27db5405228468a9c3a0ab 100644 (file)
@@ -85,10 +85,10 @@ static void mv64x60_udbg_init(void)
        if (!stdout)
                return;
 
-       for (np = NULL;
-            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); )
+       for_each_compatible_node(np, "serial", "marvell,mpsc") {
                if (np == stdout)
                        break;
+       }
 
        of_node_put(stdout);
        if (!np)
index 3c2c14c32e7632dd344025d3dcea314bbb2e6e95..5abfcd157483b509e0f1c99ad0eacd693e05fb72 100644 (file)
@@ -533,7 +533,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
  *
  */
 
-#define MAX_PCIE_BUS_MAPPED    0x10
+#define MAX_PCIE_BUS_MAPPED    0x40
 
 struct ppc4xx_pciex_port
 {
index a113d800cbf0eba4e5ac235fafa9e0bf363b425b..be2808a292f7521315b2a03b7e82a269cb8633b7 100644 (file)
@@ -66,14 +66,12 @@ EXPORT_SYMBOL(get_vir_csrbase);
 static int __init tsi108_eth_of_init(void)
 {
        struct device_node *np;
-       unsigned int i;
+       unsigned int i = 0;
        struct platform_device *tsi_eth_dev;
        struct resource res;
        int ret;
 
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL;
-            i++) {
+       for_each_compatible_node(np, "network", "tsi108-ethernet") {
                struct resource r[2];
                struct device_node *phy, *mdio;
                hw_info tsi_eth_data;
@@ -98,7 +96,7 @@ static int __init tsi108_eth_of_init(void)
                        __FUNCTION__,r[1].name, r[1].start, r[1].end);
 
                tsi_eth_dev =
-                   platform_device_register_simple("tsi-ethernet", i, &r[0],
+                   platform_device_register_simple("tsi-ethernet", i++, &r[0],
                                                    1);
 
                if (IS_ERR(tsi_eth_dev)) {
@@ -154,6 +152,7 @@ static int __init tsi108_eth_of_init(void)
 unreg:
        platform_device_unregister(tsi_eth_dev);
 err:
+       of_node_put(np);
        return ret;
 }
 
index ae3eadddddbd7425e5de36a397717807bc5cb405..625b275c37950296ea93fd0506dcbefca92b2bb8 100644 (file)
@@ -309,28 +309,23 @@ void __init uic_init_tree(void)
        const u32 *interrupts;
 
        /* First locate and initialize the top-level UIC */
-
-       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
-       while (np) {
+       for_each_compatible_node(np, NULL, "ibm,uic") {
                interrupts = of_get_property(np, "interrupts", NULL);
-               if (! interrupts)
+               if (!interrupts)
                        break;
-
-               np = of_find_compatible_node(np, NULL, "ibm,uic");
        }
 
        BUG_ON(!np); /* uic_init_tree() assumes there's a UIC as the
                      * top-level interrupt controller */
        primary_uic = uic_init_one(np);
-       if (! primary_uic)
+       if (!primary_uic)
                panic("Unable to initialize primary UIC %s\n", np->full_name);
 
        irq_set_default_host(primary_uic->irqhost);
        of_node_put(np);
 
        /* The scan again for cascaded UICs */
-       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
-       while (np) {
+       for_each_compatible_node(np, NULL, "ibm,uic") {
                interrupts = of_get_property(np, "interrupts", NULL);
                if (interrupts) {
                        /* Secondary UIC */
@@ -348,8 +343,6 @@ void __init uic_init_tree(void)
 
                        /* FIXME: setup critical cascade?? */
                }
-
-               np = of_find_compatible_node(np, NULL, "ibm,uic");
        }
 }
 
index c2f17cc43dfa4d69a40d131e53a92d2e3acd8688..ba8eea2bcce0460f833adf4a968be19a209c75d7 100644 (file)
@@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
        struct device_node *np;
 
        /* find top level interrupt controller */
-       for_each_compatible_node(np, NULL, "xilinx,intc") {
+       for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
                if (!of_get_property(np, "interrupts", NULL))
                        break;
        }
+       if (!np) {
+               for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
+                       if (!of_get_property(np, "interrupts", NULL))
+                               break;
+               }
+       }
 
        /* xilinx interrupt controller needs to be top level */
        BUG_ON(!np);
index 276945d515130724e2c575b0a538aa8106b2449b..54f4942a2968ee8c9d92bf57703073c60adf4e07 100644 (file)
@@ -553,6 +553,7 @@ thermostat_init(void)
        struct device_node* np;
        const u32 *prop;
        int i = 0, offset = 0;
+       int err;
        
        np = of_find_node_by_name(NULL, "fan");
        if (!np)
@@ -612,17 +613,20 @@ thermostat_init(void)
                return -ENODEV;
        }
        
-       device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
-       device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
-       device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
-       device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
-       device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
-       device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
-       device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
-       device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
-       device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
+       err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
+       err |= device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
+       err |= device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
+       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
        if(therm_type == ADT7460)
-               device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
+               err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
+       if (err)
+               printk(KERN_WARNING
+                       "Failed to create tempertaure attribute file(s).\n");
 
 #ifndef CONFIG_I2C_POWERMAC
        request_module("i2c-powermac");
index 6fadc9ac66b0c514d64486261397da80fc3b3cba..1e0a69a5e8150664c7240c9793f76a8563a63687 100644 (file)
@@ -1157,6 +1157,8 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
  */
 static int init_cpu_state(struct cpu_pid_state *state, int index)
 {
+       int err;
+
        state->index = index;
        state->first = 1;
        state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000;
@@ -1182,18 +1184,21 @@ static int init_cpu_state(struct cpu_pid_state *state, int index)
        DBG("CPU %d Using %d power history entries\n", index, state->count_power);
 
        if (index == 0) {
-               device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
-               device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
-               device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
-               device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
-               device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
+               err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
        } else {
-               device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
-               device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
-               device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
-               device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
-               device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
+               err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
+               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
        }
+       if (err)
+               printk(KERN_WARNING "Failed to create some of the atribute"
+                       "files for CPU %d\n", index);
 
        return 0;
  fail:
@@ -1329,6 +1334,7 @@ static int init_backside_state(struct backside_pid_state *state)
 {
        struct device_node *u3;
        int u3h = 1; /* conservative by default */
+       int err;
 
        /*
         * There are different PID params for machines with U3 and machines
@@ -1380,8 +1386,11 @@ static int init_backside_state(struct backside_pid_state *state)
        if (state->monitor == NULL)
                return -ENODEV;
 
-       device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
-       device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
+       err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
+       err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
+       if (err)
+               printk(KERN_WARNING "Failed to create attribute file(s)"
+                       " for backside fan\n");
 
        return 0;
 }
@@ -1492,6 +1501,8 @@ static void do_monitor_drives(struct drives_pid_state *state)
  */
 static int init_drives_state(struct drives_pid_state *state)
 {
+       int err;
+
        state->ticks = 1;
        state->first = 1;
        state->rpm = 1000;
@@ -1500,8 +1511,11 @@ static int init_drives_state(struct drives_pid_state *state)
        if (state->monitor == NULL)
                return -ENODEV;
 
-       device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
-       device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
+       err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
+       err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
+       if (err)
+               printk(KERN_WARNING "Failed to create attribute file(s)"
+                       " for drives bay fan\n");
 
        return 0;
 }
@@ -1622,7 +1636,9 @@ static int init_dimms_state(struct dimm_pid_state *state)
        if (state->monitor == NULL)
                return -ENODEV;
 
-               device_create_file(&of_dev->dev, &dev_attr_dimms_temperature);
+       if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature))
+               printk(KERN_WARNING "Failed to create attribute file"
+                       " for DIMM temperature\n");
 
        return 0;
 }
@@ -1732,6 +1748,8 @@ static void do_monitor_slots(struct slots_pid_state *state)
  */
 static int init_slots_state(struct slots_pid_state *state)
 {
+       int err;
+
        state->ticks = 1;
        state->first = 1;
        state->pwm = 50;
@@ -1740,8 +1758,11 @@ static int init_slots_state(struct slots_pid_state *state)
        if (state->monitor == NULL)
                return -ENODEV;
 
-       device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
-       device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
+       err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
+       err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
+       if (err)
+               printk(KERN_WARNING "Failed to create attribute file(s)"
+                       " for slots bay fan\n");
 
        return 0;
 }
index 37224025f00eb5020c6a089dddafa0181e4bc8c6..63ef1f6faaed3f43795e4e915e6ad2cb112debe5 100644 (file)
@@ -223,6 +223,7 @@ static void
 setup_hardware( void )
 {
        int val;
+       int err;
 
        /* save registers (if we unload the module) */
        x.r0 = read_reg( x.fan, 0x00, 1 );
@@ -265,8 +266,11 @@ setup_hardware( void )
        x.upind = -1;
        /* tune_fan( fan_up_table[x.upind].fan_setting ); */
 
-       device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
-       device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
+       err = device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
+       err |= device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
+       if (err)
+               printk(KERN_WARNING
+                       "Failed to create temperature attribute file(s).\n");
 }
 
 static void
index cb06280dced5234806ec28c4c6235f0ab978769d..fced441face6f6c197811a691f27c1c865db045f 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/mii.h>
 #include <linux/bitops.h>
 #include <linux/workqueue.h>
+#include <linux/of.h>
 
 #include <asm/processor.h>
 #include <asm/io.h>
index 9377f3bc410ac0083e96f3fefb48400ae4342a43..b306fef1ac4151dffe03a89d4328ca4e6f703547 100644 (file)
@@ -273,3 +273,61 @@ struct device_node *of_find_compatible_node(struct device_node *from,
        return np;
 }
 EXPORT_SYMBOL(of_find_compatible_node);
+
+/**
+ * of_match_node - Tell if an device_node has a matching of_match structure
+ *     @matches:       array of of device match structures to search in
+ *     @node:          the of device structure to match against
+ *
+ *     Low level utility function used by device matching.
+ */
+const struct of_device_id *of_match_node(const struct of_device_id *matches,
+                                        const struct device_node *node)
+{
+       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
+               int match = 1;
+               if (matches->name[0])
+                       match &= node->name
+                               && !strcmp(matches->name, node->name);
+               if (matches->type[0])
+                       match &= node->type
+                               && !strcmp(matches->type, node->type);
+               if (matches->compatible[0])
+                       match &= of_device_is_compatible(node,
+                                               matches->compatible);
+               if (match)
+                       return matches;
+               matches++;
+       }
+       return NULL;
+}
+EXPORT_SYMBOL(of_match_node);
+
+/**
+ *     of_find_matching_node - Find a node based on an of_device_id match
+ *                             table.
+ *     @from:          The node to start searching from or NULL, the node
+ *                     you pass will not be searched, only the next one
+ *                     will; typically, you pass what the previous call
+ *                     returned. of_node_put() will be called on it
+ *     @matches:       array of of device match structures to search in
+ *
+ *     Returns a node pointer with refcount incremented, use
+ *     of_node_put() on it when done.
+ */
+struct device_node *of_find_matching_node(struct device_node *from,
+                                         const struct of_device_id *matches)
+{
+       struct device_node *np;
+
+       read_lock(&devtree_lock);
+       np = from ? from->allnext : allnodes;
+       for (; np; np = np->allnext) {
+               if (of_match_node(matches, np) && of_node_get(np))
+                       break;
+       }
+       of_node_put(from);
+       read_unlock(&devtree_lock);
+       return np;
+}
+EXPORT_SYMBOL(of_find_matching_node);
index 6245f060fb774a17780375b869d1950bb0266a67..29681c4b700b13d2fa8b4f106b40faceec403716 100644 (file)
@@ -9,35 +9,6 @@
 
 #include <asm/errno.h>
 
-/**
- * of_match_node - Tell if an device_node has a matching of_match structure
- * @ids: array of of device match structures to search in
- * @node: the of device structure to match against
- *
- * Low level utility function used by device matching.
- */
-const struct of_device_id *of_match_node(const struct of_device_id *matches,
-                                        const struct device_node *node)
-{
-       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
-               int match = 1;
-               if (matches->name[0])
-                       match &= node->name
-                               && !strcmp(matches->name, node->name);
-               if (matches->type[0])
-                       match &= node->type
-                               && !strcmp(matches->type, node->type);
-               if (matches->compatible[0])
-                       match &= of_device_is_compatible(node,
-                                               matches->compatible);
-               if (match)
-                       return matches;
-               matches++;
-       }
-       return NULL;
-}
-EXPORT_SYMBOL(of_match_node);
-
 /**
  * of_match_device - Tell if an of_device structure has a matching
  * of_match structure
index ec36ad78d2fe042aafa149eac1ed3a65d3ace527..7e3ba8b455a82a061b01b88d02345a9e8623a3a1 100644 (file)
@@ -72,7 +72,8 @@
 #include <asm/io.h>
 
 #if defined(CONFIG_PPC_MERGE)
-#include <asm/of_platform.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
 #else
 #include <linux/platform_device.h>
 #endif
index 3f593247c41e0d5e9b255720506bd2da2b872249..80943409edb000cd0c6202934325aaa1706c5f25 100644 (file)
@@ -539,7 +539,7 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
  *
  * @dev: pointer to device structure
  */
-static int __devinit ulite_release(struct device *dev)
+static int __devexit ulite_release(struct device *dev)
 {
        struct uart_port *port = dev_get_drvdata(dev);
        int rc = 0;
@@ -572,14 +572,14 @@ static int __devinit ulite_probe(struct platform_device *pdev)
        return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
 }
 
-static int ulite_remove(struct platform_device *pdev)
+static int __devexit ulite_remove(struct platform_device *pdev)
 {
        return ulite_release(&pdev->dev);
 }
 
 static struct platform_driver ulite_platform_driver = {
        .probe  = ulite_probe,
-       .remove = ulite_remove,
+       .remove = __devexit_p(ulite_remove),
        .driver = {
                   .owner = THIS_MODULE,
                   .name  = "uartlite",
index 12e5e773c67e765b6c1efbc1bae9e2a44fba8641..2a1b4040e20d505801b09bcc0254bb652ae635e3 100644 (file)
@@ -80,7 +80,7 @@ extern char initial_stab[];
 #define HPTE_V_AVPN_SHIFT      7
 #define HPTE_V_AVPN            ASM_CONST(0x3fffffffffffff80)
 #define HPTE_V_AVPN_VAL(x)     (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
-#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80))
+#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80UL))
 #define HPTE_V_BOLTED          ASM_CONST(0x0000000000000010)
 #define HPTE_V_LOCK            ASM_CONST(0x0000000000000008)
 #define HPTE_V_LARGE           ASM_CONST(0x0000000000000004)
@@ -278,6 +278,7 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access,
 extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
                             unsigned long pstart, unsigned long mode,
                             int psize, int ssize);
+extern void set_huge_psize(int psize);
 
 extern void htab_initialize(void);
 extern void htab_initialize_secondary(void);
index 9b16d3b171699f41c00af244bb4034fb873f3b06..a6ea49eb680b01ad46d4fdfe169974006153551a 100644 (file)
@@ -165,18 +165,17 @@ struct iommu_table;
 
 struct pci_dn {
        int     busno;                  /* pci bus number */
-       int     bussubno;               /* pci subordinate bus number */
        int     devfn;                  /* pci device and function number */
-       int     class_code;             /* pci device class */
 
        struct  pci_controller *phb;    /* for pci devices */
        struct  iommu_table *iommu_table;       /* for phb's or bridges */
-       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
        struct  device_node *node;      /* back-pointer to the device_node */
 
        int     pci_ext_config_space;   /* for pci devices */
 
 #ifdef CONFIG_EEH
+       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
+       int     class_code;             /* pci device class */
        int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
        int     eeh_config_addr;
        int     eeh_pe_config_addr; /* new-style partition endpoint address */
index c65af7bd1e9c6369757dfaeeecf74feccea83f97..b5f33efcb8e20006165336ffbcdd9e25c7e793b3 100644 (file)
@@ -17,6 +17,7 @@
  */
 #include <linux/types.h>
 #include <linux/bitops.h>
+#include <linux/mod_devicetable.h>
 
 #include <asm/prom.h>
 
@@ -41,6 +42,11 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
 #define for_each_compatible_node(dn, type, compatible) \
        for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
             dn = of_find_compatible_node(dn, type, compatible))
+extern struct device_node *of_find_matching_node(struct device_node *from,
+       const struct of_device_id *matches);
+#define for_each_matching_node(dn, matches) \
+       for (dn = of_find_matching_node(NULL, matches); dn; \
+            dn = of_find_matching_node(dn, matches))
 extern struct device_node *of_find_node_by_path(const char *path);
 extern struct device_node *of_find_node_by_phandle(phandle handle);
 extern struct device_node *of_get_parent(const struct device_node *node);
@@ -60,5 +66,7 @@ extern const void *of_get_property(const struct device_node *node,
                                int *lenp);
 extern int of_n_addr_cells(struct device_node *np);
 extern int of_n_size_cells(struct device_node *np);
+extern const struct of_device_id *of_match_node(
+       const struct of_device_id *matches, const struct device_node *node);
 
 #endif /* _LINUX_OF_H */
index 212bffb2b17453449ed9a6331372d5eff8cf3773..6dc11959770c23da51f4fa394c9b694f60aa1ff1 100644 (file)
@@ -10,8 +10,6 @@
 
 #define        to_of_device(d) container_of(d, struct of_device, dev)
 
-extern const struct of_device_id *of_match_node(
-       const struct of_device_id *matches, const struct device_node *node);
 extern const struct of_device_id *of_match_device(
        const struct of_device_id *matches, const struct of_device *dev);