From 600b10fd2171d06b977edef0a93b38788a62fb3d Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 2 Jan 2008 12:35:50 -0600 Subject: [PATCH] --- yaml --- r: 81256 b: refs/heads/master c: f0d4577c4d19f439b8f05e2c540519343e6f71e1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 1 - .../powerpc/booting-without-of.txt | 67 +++++----- trunk/arch/powerpc/boot/.gitignore | 1 - trunk/arch/powerpc/boot/4xx.c | 81 ++---------- trunk/arch/powerpc/boot/4xx.h | 1 - trunk/arch/powerpc/boot/dcr.h | 5 - trunk/arch/powerpc/boot/dtc-src/.gitignore | 3 - trunk/arch/powerpc/boot/serial.c | 3 +- trunk/arch/powerpc/configs/bamboo_defconfig | 4 +- trunk/arch/powerpc/configs/kilauea_defconfig | 23 +--- trunk/arch/powerpc/configs/sequoia_defconfig | 24 +--- trunk/arch/powerpc/kernel/Makefile | 10 -- trunk/arch/powerpc/kernel/btext.c | 2 +- trunk/arch/powerpc/kernel/ibmebus.c | 3 +- trunk/arch/powerpc/kernel/legacy_serial.c | 8 +- trunk/arch/powerpc/kernel/of_device.c | 2 +- trunk/arch/powerpc/kernel/of_platform.c | 5 +- trunk/arch/powerpc/kernel/pci_32.c | 24 ++-- trunk/arch/powerpc/kernel/pci_64.c | 4 +- trunk/arch/powerpc/kernel/pci_dn.c | 5 + trunk/arch/powerpc/kernel/rtas_pci.c | 5 +- trunk/arch/powerpc/kernel/systbl_chk.c | 58 --------- trunk/arch/powerpc/kernel/systbl_chk.sh | 33 ----- trunk/arch/powerpc/mm/hash_utils_64.c | 11 +- trunk/arch/powerpc/mm/hugetlbpage.c | 119 ++++-------------- trunk/arch/powerpc/platforms/40x/virtex.c | 12 +- trunk/arch/powerpc/platforms/44x/rainier.c | 3 +- trunk/arch/powerpc/platforms/44x/sequoia.c | 2 +- .../powerpc/platforms/cell/io-workarounds.c | 5 +- trunk/arch/powerpc/platforms/cell/iommu.c | 7 +- trunk/arch/powerpc/platforms/cell/pmu.c | 5 +- trunk/arch/powerpc/platforms/cell/setup.c | 5 +- .../powerpc/platforms/celleb/io-workarounds.c | 1 - trunk/arch/powerpc/platforms/celleb/iommu.c | 5 +- trunk/arch/powerpc/platforms/celleb/pci.c | 1 - trunk/arch/powerpc/platforms/celleb/setup.c | 7 +- trunk/arch/powerpc/platforms/iseries/pci.c | 13 +- trunk/arch/powerpc/platforms/maple/setup.c | 2 +- trunk/arch/powerpc/platforms/pasemi/setup.c | 2 +- .../arch/powerpc/platforms/powermac/low_i2c.c | 10 +- .../powerpc/platforms/powermac/pfunc_base.c | 3 +- trunk/arch/powerpc/platforms/powermac/pic.c | 3 +- trunk/arch/powerpc/platforms/powermac/setup.c | 12 +- trunk/arch/powerpc/platforms/pseries/eeh.c | 43 +++---- trunk/arch/powerpc/sysdev/fsl_soc.c | 7 +- trunk/arch/powerpc/sysdev/mv64x60_dev.c | 24 ++-- trunk/arch/powerpc/sysdev/mv64x60_pci.c | 4 +- trunk/arch/powerpc/sysdev/mv64x60_udbg.c | 4 +- trunk/arch/powerpc/sysdev/ppc4xx_pci.c | 2 +- trunk/arch/powerpc/sysdev/tsi108_dev.c | 9 +- trunk/arch/powerpc/sysdev/uic.c | 15 ++- trunk/arch/powerpc/sysdev/xilinx_intc.c | 8 +- trunk/drivers/macintosh/therm_adt746x.c | 24 ++-- trunk/drivers/macintosh/therm_pm72.c | 55 +++----- trunk/drivers/macintosh/therm_windtunnel.c | 8 +- trunk/drivers/net/ibm_newemac/core.c | 1 - trunk/drivers/of/base.c | 58 --------- trunk/drivers/of/device.c | 29 +++++ trunk/drivers/serial/mpc52xx_uart.c | 3 +- trunk/drivers/serial/uartlite.c | 6 +- trunk/include/asm-powerpc/mmu-hash64.h | 3 +- trunk/include/asm-powerpc/pci-bridge.h | 5 +- trunk/include/linux/of.h | 8 -- trunk/include/linux/of_device.h | 2 + 65 files changed, 298 insertions(+), 622 deletions(-) delete mode 100644 trunk/arch/powerpc/boot/dtc-src/.gitignore delete mode 100644 trunk/arch/powerpc/kernel/systbl_chk.c delete mode 100644 trunk/arch/powerpc/kernel/systbl_chk.sh diff --git a/[refs] b/[refs] index ab58a731605b..142ba5643092 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0173d422aa32fa1e5141f1759202b955215c1da2 +refs/heads/master: f0d4577c4d19f439b8f05e2c540519343e6f71e1 diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 2fc1fb896afc..33121d6c827c 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -685,7 +685,6 @@ 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 diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index 6d1d0856063e..ee0209a7de3e 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -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 -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. +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. 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,7 +2091,8 @@ platforms are moved over to use the flattened-device-tree model. Example: localbus@f0010100 { - compatible = "fsl,mpc8272-localbus", + compatible = "fsl,mpc8272ads-localbus", + "fsl,mpc8272-localbus", "fsl,pq2-localbus"; #address-cells = <2>; #size-cells = <1>; @@ -2291,7 +2292,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): (generic-name)@(base-address) { + (name)@(base-address) { compatible = "xlnx,(ip-core-name)-(HW_VER)" [, (list of compatible devices), ...]; reg = <(baseaddr) (size)>; @@ -2301,9 +2302,6 @@ 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 '-'. @@ -2312,9 +2310,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 baseaddr parameter value (often named C_BASEADDR). + (baseaddr): the C_BASEADDR parameter. (HW_VER): from the HW_VER parameter. - (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1). + (size): equals 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 @@ -2344,11 +2342,11 @@ platforms are moved over to use the flattened-device-tree model. becomes the following device tree node: - opb_uartlite_0: serial@ec100000 { + opb-uartlite-0@ec100000 { device_type = "serial"; compatible = "xlnx,opb-uartlite-1.00.b"; reg = ; - interrupt-parent = <&opb_intc_0>; + interrupt-parent = <&opb-intc>; interrupts = <1 0>; // got this from the opb_intc parameters current-speed = ; // standard serial device prop clock-frequency = ; // standard serial device prop @@ -2357,19 +2355,16 @@ 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. 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. + 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. BEGIN opb_ps2_dual_ref PARAMETER INSTANCE = opb_ps2_dual_ref_0 @@ -2391,24 +2386,21 @@ 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: opb-ps2-dual-ref@a9000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "xlnx,compound"; + opb_ps2_dual_ref_0@a9000000 { 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_0>; + interrupt-parent = <&opb-intc>; interrupts = <3 0>; cell-index = <0>; }; ps2@1000 { compatible = "xlnx,opb-ps2-dual-ref-1.00.a"; reg = <1000 40>; - interrupt-parent = <&opb_intc_0>; + interrupt-parent = <&opb-intc>; interrupts = <3 0>; cell-index = <0>; }; @@ -2471,18 +2463,17 @@ platforms are moved over to use the flattened-device-tree model. Gives this device tree (some properties removed for clarity): - plb@0 { + plb-v34-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: bram@ffff0000 { + plb-bram-if-cntrl-0@ffff0000 { reg = ; } - opb@20000000 { + opb-v20-0 { #address-cells = <1>; #size-cells = <1>; ranges = <20000000 20000000 20000000 @@ -2490,11 +2481,11 @@ platforms are moved over to use the flattened-device-tree model. 80000000 80000000 40000000 c0000000 c0000000 20000000>; - opb_uart16550_0: serial@a0000000 { + opb-uart16550-0@a0000000 { reg = ; }; - opb_intc_0: interrupt-controller@d1000fc0 { + opb-intc-0@d1000fc0 { reg = ; }; }; diff --git a/trunk/arch/powerpc/boot/.gitignore b/trunk/arch/powerpc/boot/.gitignore index b160322a87ad..65f4118cbe78 100644 --- a/trunk/arch/powerpc/boot/.gitignore +++ b/trunk/arch/powerpc/boot/.gitignore @@ -1,5 +1,4 @@ addnote -dtc empty.c hack-coff infblock.c diff --git a/trunk/arch/powerpc/boot/4xx.c b/trunk/arch/powerpc/boot/4xx.c index 61a4045324cb..33f25b671340 100644 --- a/trunk/arch/powerpc/boot/4xx.c +++ b/trunk/arch/powerpc/boot/4xx.c @@ -499,45 +499,20 @@ 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, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv; + u32 fwdv, fbdv, cbdv, opdv, epdv, udiv; fwdv = (8 - ((pllmr & 0xe0000000) >> 29)); fbdv = (pllmr & 0x1e000000) >> 25; - 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 */ + cbdv = ((pllmr & 0x00060000) >> 17) + 1; + opdv = ((pllmr & 0x00018000) >> 15) + 1; + epdv = ((pllmr & 0x00001800) >> 13) + 2; udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1; - /* 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; + m = fwdv * fbdv * 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; - } + cpu = sys_clk * m / fwdv; + plb = cpu / cbdv; opb = plb / opdv; ebc = plb / epdv; @@ -566,45 +541,3 @@ 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); -} diff --git a/trunk/arch/powerpc/boot/4xx.h b/trunk/arch/powerpc/boot/4xx.h index 2606e64f0c4b..fbe0632621ca 100644 --- a/trunk/arch/powerpc/boot/4xx.h +++ b/trunk/arch/powerpc/boot/4xx.h @@ -20,7 +20,6 @@ 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); diff --git a/trunk/arch/powerpc/boot/dcr.h b/trunk/arch/powerpc/boot/dcr.h index 95b9f5344016..55655f78505a 100644 --- a/trunk/arch/powerpc/boot/dcr.h +++ b/trunk/arch/powerpc/boot/dcr.h @@ -146,12 +146,7 @@ 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/trunk/arch/powerpc/boot/dtc-src/.gitignore b/trunk/arch/powerpc/boot/dtc-src/.gitignore deleted file mode 100644 index a7c3f94e5e75..000000000000 --- a/trunk/arch/powerpc/boot/dtc-src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -dtc-lexer.lex.c -dtc-parser.tab.c -dtc-parser.tab.h diff --git a/trunk/arch/powerpc/boot/serial.c b/trunk/arch/powerpc/boot/serial.c index b6c68ef46809..cafeece20ac7 100644 --- a/trunk/arch/powerpc/boot/serial.c +++ b/trunk/arch/powerpc/boot/serial.c @@ -128,8 +128,7 @@ 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, "xlnx,opb-uartlite-1.00.b") || - dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a")) + else if (dt_is_compatible(devp, "xilinx,uartlite")) rc = uartlite_console_init(devp, &serial_cd); /* Add other serial console driver calls here */ diff --git a/trunk/arch/powerpc/configs/bamboo_defconfig b/trunk/arch/powerpc/configs/bamboo_defconfig index 1ed9afc9b281..0dc9c4b4794d 100644 --- a/trunk/arch/powerpc/configs/bamboo_defconfig +++ b/trunk/arch/powerpc/configs/bamboo_defconfig @@ -376,7 +376,9 @@ CONFIG_MISC_DEVICES=y # CONFIG_FIREWIRE is not set # CONFIG_IEEE1394 is not set # CONFIG_I2O is not set -# CONFIG_MACINTOSH_DRIVERS is not set +CONFIG_MACINTOSH_DRIVERS=y +# CONFIG_MAC_EMUMOUSEBTN is not set +# CONFIG_WINDFARM is not set CONFIG_NETDEVICES=y # CONFIG_NETDEVICES_MULTIQUEUE is not set # CONFIG_DUMMY is not set diff --git a/trunk/arch/powerpc/configs/kilauea_defconfig b/trunk/arch/powerpc/configs/kilauea_defconfig index 8dca3d451c0e..c86e7565adc6 100644 --- a/trunk/arch/powerpc/configs/kilauea_defconfig +++ b/trunk/arch/powerpc/configs/kilauea_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.24-rc6 -# Thu Jan 3 14:21:31 2008 +# Mon Dec 24 11:18:12 2007 # # CONFIG_PPC64 is not set @@ -453,28 +453,9 @@ CONFIG_NETDEVICES=y # CONFIG_VETH is not set # CONFIG_IP1000 is not set # CONFIG_ARCNET 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_NET_ETHERNET 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 diff --git a/trunk/arch/powerpc/configs/sequoia_defconfig b/trunk/arch/powerpc/configs/sequoia_defconfig index abbfed6582e1..2bb4df82fbda 100644 --- a/trunk/arch/powerpc/configs/sequoia_defconfig +++ b/trunk/arch/powerpc/configs/sequoia_defconfig @@ -449,7 +449,9 @@ CONFIG_MISC_DEVICES=y # CONFIG_FIREWIRE is not set # CONFIG_IEEE1394 is not set # CONFIG_I2O is not set -# CONFIG_MACINTOSH_DRIVERS is not set +CONFIG_MACINTOSH_DRIVERS=y +# CONFIG_MAC_EMUMOUSEBTN is not set +# CONFIG_WINDFARM is not set CONFIG_NETDEVICES=y # CONFIG_NETDEVICES_MULTIQUEUE is not set # CONFIG_DUMMY is not set @@ -460,28 +462,10 @@ CONFIG_NETDEVICES=y # CONFIG_VETH is not set # CONFIG_IP1000 is not set # CONFIG_ARCNET 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_NET_ETHERNET 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 diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index d9b377070caa..9374bc9a2dd1 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -91,13 +91,3 @@ 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) diff --git a/trunk/arch/powerpc/kernel/btext.c b/trunk/arch/powerpc/kernel/btext.c index 80e2eef05b2e..9c74fdf29eec 100644 --- a/trunk/arch/powerpc/kernel/btext.c +++ b/trunk/arch/powerpc/kernel/btext.c @@ -236,7 +236,7 @@ int __init btext_find_display(int allow_nonstdout) if (rc == 0 || !allow_nonstdout) return rc; - for_each_node_by_type(np, "display") { + for (np = NULL; (np = of_find_node_by_type(np, "display"));) { if (of_get_property(np, "linux,opened", NULL)) { printk("trying %s ...\n", np->full_name); rc = btext_initialize(np); diff --git a/trunk/arch/powerpc/kernel/ibmebus.c b/trunk/arch/powerpc/kernel/ibmebus.c index fd5ae8d17c96..caae49ff0668 100644 --- a/trunk/arch/powerpc/kernel/ibmebus.c +++ b/trunk/arch/powerpc/kernel/ibmebus.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -172,7 +171,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches) root = of_find_node_by_path("/"); - for_each_child_of_node(root, child) { + for (child = NULL; (child = of_get_next_child(root, child)); ) { if (!of_match_node(matches, child)) continue; diff --git a/trunk/arch/powerpc/kernel/legacy_serial.c b/trunk/arch/powerpc/kernel/legacy_serial.c index 4bfff8863bcb..b9cae6b1f8ca 100644 --- a/trunk/arch/powerpc/kernel/legacy_serial.c +++ b/trunk/arch/powerpc/kernel/legacy_serial.c @@ -307,7 +307,7 @@ void __init find_legacy_serial_ports(void) } /* First fill our array with SOC ports */ - for_each_compatible_node(np, "serial", "ns16550") { + for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) { 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_each_node_by_type(np, "serial") { + for (np = NULL; (np = of_find_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_each_compatible_node(np, "serial", "ns16550") { + for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) { 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_each_compatible_node(np, "serial", "ns16550") { + for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) { struct device_node *opb = of_get_parent(np); if (opb && (!strcmp(opb->type, "opb") || of_device_is_compatible(opb, "ibm,opb"))) { diff --git a/trunk/arch/powerpc/kernel/of_device.c b/trunk/arch/powerpc/kernel/of_device.c index 5748ddb47d9f..3388ad619996 100644 --- a/trunk/arch/powerpc/kernel/of_device.c +++ b/trunk/arch/powerpc/kernel/of_device.c @@ -5,10 +5,10 @@ #include #include #include -#include #include #include +#include static void of_device_make_bus_id(struct of_device *dev) { diff --git a/trunk/arch/powerpc/kernel/of_platform.c b/trunk/arch/powerpc/kernel/of_platform.c index fb698d47082d..de36e235a60a 100644 --- a/trunk/arch/powerpc/kernel/of_platform.c +++ b/trunk/arch/powerpc/kernel/of_platform.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -109,7 +108,7 @@ static int of_platform_bus_create(const struct device_node *bus, struct of_device *dev; int rc = 0; - for_each_child_of_node(bus, child) { + for (child = NULL; (child = of_get_next_child(bus, child)); ) { pr_debug(" create child: %s\n", child->full_name); dev = of_platform_device_create(child, NULL, parent); if (dev == NULL) @@ -171,7 +170,7 @@ int of_platform_bus_probe(struct device_node *root, rc = of_platform_bus_create(root, matches, &dev->dev); goto bail; } - for_each_child_of_node(root, child) { + for (child = NULL; (child = of_get_next_child(root, child)); ) { if (!of_match_node(matches, child)) continue; diff --git a/trunk/arch/powerpc/kernel/pci_32.c b/trunk/arch/powerpc/kernel/pci_32.c index 14e300f85ce4..a9c6cb24aab0 100644 --- a/trunk/arch/powerpc/kernel/pci_32.c +++ b/trunk/arch/powerpc/kernel/pci_32.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -172,7 +171,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus) } else pci_to_OF_bus_map[pci_bus] = bus_range[0]; - for_each_child_of_node(node, node) { + for (node=node->child; node != 0;node = node->sibling) { struct pci_dev* dev; const unsigned int *class_code, *reg; @@ -241,18 +240,15 @@ 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 *parent, pci_OF_scan_iterator filter, void* data) +scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data) { - struct device_node *node; struct device_node* sub_node; - for_each_child_of_node(parent, node) { + for (; node != 0;node = node->sibling) { const unsigned int *class_code; - if (filter(node, data)) { - of_node_put(node); + if (filter(node, data)) return node; - } /* For PCI<->PCI bridges or CardBus bridges, we go down * Note: some OFs create a parent node "multifunc-device" as @@ -264,11 +260,9 @@ scan_OF_pci_childs(struct device_node *parent, 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, filter, data); - if (sub_node) { - of_node_put(node); + sub_node = scan_OF_pci_childs(node->child, filter, data); + if (sub_node) return sub_node; - } } return NULL; } @@ -276,11 +270,11 @@ scan_OF_pci_childs(struct device_node *parent, 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; + struct device_node *np = NULL; const u32 *reg; unsigned int psize; - for_each_child_of_node(parent, np) { + while ((np = of_get_next_child(parent, np)) != NULL) { reg = of_get_property(np, "reg", &psize); if (reg == NULL || psize < 4) continue; @@ -372,7 +366,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, + if (!scan_OF_pci_childs(hose->dn->child, find_OF_pci_device_filter, (void *)node)) return -ENODEV; reg = of_get_property(node, "reg", NULL); diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index 1930f393d01c..5949bbabd7fb 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -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; + struct device_node *child = NULL; 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 */ - for_each_child_of_node(node, child) { + while ((child = of_get_next_child(node, child)) != NULL) { DBG(" * %s\n", child->full_name); reg = of_get_property(child, "reg", ®len); if (reg == NULL || reglen < 20) diff --git a/trunk/arch/powerpc/kernel/pci_dn.c b/trunk/arch/powerpc/kernel/pci_dn.c index 1c67de52e3ce..85d4d8924b5c 100644 --- a/trunk/arch/powerpc/kernel/pci_dn.c +++ b/trunk/arch/powerpc/kernel/pci_dn.c @@ -56,6 +56,11 @@ 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; diff --git a/trunk/arch/powerpc/kernel/rtas_pci.c b/trunk/arch/powerpc/kernel/rtas_pci.c index 433a0a0949fb..99aaae3409c0 100644 --- a/trunk/arch/powerpc/kernel/rtas_pci.c +++ b/trunk/arch/powerpc/kernel/rtas_pci.c @@ -280,7 +280,10 @@ void __init find_and_init_phbs(void) struct pci_controller *phb; struct device_node *root = of_find_node_by_path("/"); - for_each_child_of_node(root, node) { + for (node = of_get_next_child(root, NULL); + node != NULL; + node = of_get_next_child(root, node)) { + if (node->type == NULL || (strcmp(node->type, "pci") != 0 && strcmp(node->type, "pciex") != 0)) continue; diff --git a/trunk/arch/powerpc/kernel/systbl_chk.c b/trunk/arch/powerpc/kernel/systbl_chk.c deleted file mode 100644 index 77824d1cb150..000000000000 --- a/trunk/arch/powerpc/kernel/systbl_chk.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 - -#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 -END_TABLE __NR_syscalls diff --git a/trunk/arch/powerpc/kernel/systbl_chk.sh b/trunk/arch/powerpc/kernel/systbl_chk.sh deleted file mode 100644 index 367d208301d2..000000000000 --- a/trunk/arch/powerpc/kernel/systbl_chk.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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" diff --git a/trunk/arch/powerpc/mm/hash_utils_64.c b/trunk/arch/powerpc/mm/hash_utils_64.c index 9326a6962b42..cbbd8b0bc8f4 100644 --- a/trunk/arch/powerpc/mm/hash_utils_64.c +++ b/trunk/arch/powerpc/mm/hash_utils_64.c @@ -369,11 +369,18 @@ static void __init htab_init_page_sizes(void) * on what is available */ if (mmu_psize_defs[MMU_PAGE_16M].shift) - set_huge_psize(MMU_PAGE_16M); + mmu_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) - set_huge_psize(MMU_PAGE_1M); + 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 ! */ #endif /* CONFIG_HUGETLB_PAGE */ } diff --git a/trunk/arch/powerpc/mm/hugetlbpage.c b/trunk/arch/powerpc/mm/hugetlbpage.c index a02266dad215..71efb38d599b 100644 --- a/trunk/arch/powerpc/mm/hugetlbpage.c +++ b/trunk/arch/powerpc/mm/hugetlbpage.c @@ -24,17 +24,18 @@ #include #include -#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) -unsigned int hugepte_shift; -#define PTRS_PER_HUGEPTE (1 << hugepte_shift) -#define HUGEPTE_TABLE_SIZE (sizeof(pte_t) << hugepte_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) -#define HUGEPD_SHIFT (HPAGE_SHIFT + hugepte_shift) +#define HUGEPD_SHIFT (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE) #define HUGEPD_SIZE (1UL << HUGEPD_SHIFT) #define HUGEPD_MASK (~(HUGEPD_SIZE-1)) @@ -81,35 +82,11 @@ 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); @@ -119,9 +96,14 @@ 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)) { - pm = hpmd_offset(pu, addr); +#ifdef CONFIG_PPC_64K_PAGES + pmd_t *pm; + pm = pmd_offset(pu, addr); if (!pmd_none(*pm)) return hugepte_offset((hugepd_t *)pm, addr); +#else + return hugepte_offset((hugepd_t *)pu, addr); +#endif } } @@ -132,7 +114,6 @@ 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); @@ -143,9 +124,14 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) pu = pud_alloc(mm, pg, addr); if (pu) { - pm = hpmd_alloc(mm, pu, addr); +#ifdef CONFIG_PPC_64K_PAGES + pmd_t *pm; + pm = pmd_alloc(mm, pu, addr); if (pm) hpdp = (hugepd_t *)pm; +#else + hpdp = (hugepd_t *)pu; +#endif } if (! hpdp) @@ -172,6 +158,7 @@ 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) @@ -204,6 +191,7 @@ 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, @@ -222,15 +210,9 @@ 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 (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); - } + if (pud_none(*pud)) + continue; + free_hugepte_range(tlb, (hugepd_t *)pud); #endif } while (pud++, addr = next, addr != end); @@ -544,57 +526,6 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, 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)); diff --git a/trunk/arch/powerpc/platforms/40x/virtex.c b/trunk/arch/powerpc/platforms/40x/virtex.c index 88b66444dfb2..43fcc8e9f7d0 100644 --- a/trunk/arch/powerpc/platforms/40x/virtex.c +++ b/trunk/arch/powerpc/platforms/40x/virtex.c @@ -15,19 +15,9 @@ #include #include -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, xilinx_of_bus_ids, NULL); + of_platform_bus_probe(NULL, NULL, NULL); return 0; } diff --git a/trunk/arch/powerpc/platforms/44x/rainier.c b/trunk/arch/powerpc/platforms/44x/rainier.c index a7fae1cf69c1..a4ce5ba8fe32 100644 --- a/trunk/arch/powerpc/platforms/44x/rainier.c +++ b/trunk/arch/powerpc/platforms/44x/rainier.c @@ -14,13 +14,12 @@ * option) any later version. */ #include -#include - #include #include #include #include #include +#include #include #include "44x.h" diff --git a/trunk/arch/powerpc/platforms/44x/sequoia.c b/trunk/arch/powerpc/platforms/44x/sequoia.c index d279db42c896..374f8c7fcd01 100644 --- a/trunk/arch/powerpc/platforms/44x/sequoia.c +++ b/trunk/arch/powerpc/platforms/44x/sequoia.c @@ -38,7 +38,7 @@ static int __init sequoia_device_probe(void) return 0; } -machine_device_initcall(sequoia, sequoia_device_probe); +machien_device_initcall(sequoia, sequoia_device_probe); static int __init sequoia_probe(void) { diff --git a/trunk/arch/powerpc/platforms/cell/io-workarounds.c b/trunk/arch/powerpc/platforms/cell/io-workarounds.c index 979d4b67efb4..b86076e3c09e 100644 --- a/trunk/arch/powerpc/platforms/cell/io-workarounds.c +++ b/trunk/arch/powerpc/platforms/cell/io-workarounds.c @@ -309,6 +309,9 @@ 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 @@ -340,4 +343,4 @@ static int __init spider_pci_workaround_init(void) return 0; } -machine_arch_initcall(cell, spider_pci_workaround_init); +arch_initcall(spider_pci_workaround_init); diff --git a/trunk/arch/powerpc/platforms/cell/iommu.c b/trunk/arch/powerpc/platforms/cell/iommu.c index bceb5e13da5c..1221c6d8650f 100644 --- a/trunk/arch/powerpc/platforms/cell/iommu.c +++ b/trunk/arch/powerpc/platforms/cell/iommu.c @@ -700,6 +700,10 @@ 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. * @@ -742,6 +746,5 @@ static int __init cell_iommu_init(void) return 0; } -machine_arch_initcall(cell, cell_iommu_init); -machine_arch_initcall(celleb_native, cell_iommu_init); +arch_initcall(cell_iommu_init); diff --git a/trunk/arch/powerpc/platforms/cell/pmu.c b/trunk/arch/powerpc/platforms/cell/pmu.c index 69ed0d7f1646..99d688e88cbe 100644 --- a/trunk/arch/powerpc/platforms/cell/pmu.c +++ b/trunk/arch/powerpc/platforms/cell/pmu.c @@ -381,6 +381,9 @@ 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)); @@ -401,7 +404,7 @@ static int __init cbe_init_pm_irq(void) return 0; } -machine_arch_initcall(cell, cbe_init_pm_irq); +arch_initcall(cbe_init_pm_irq); void cbe_sync_irq(int node) { diff --git a/trunk/arch/powerpc/platforms/cell/setup.c b/trunk/arch/powerpc/platforms/cell/setup.c index e6534b519c9a..4f6347c9fe68 100644 --- a/trunk/arch/powerpc/platforms/cell/setup.c +++ b/trunk/arch/powerpc/platforms/cell/setup.c @@ -85,6 +85,9 @@ 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); @@ -98,7 +101,7 @@ static int __init cell_publish_devices(void) } return 0; } -machine_device_initcall(cell, cell_publish_devices); +device_initcall(cell_publish_devices); static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc) { diff --git a/trunk/arch/powerpc/platforms/celleb/io-workarounds.c b/trunk/arch/powerpc/platforms/celleb/io-workarounds.c index 423339be1bac..b939c0e98af8 100644 --- a/trunk/arch/powerpc/platforms/celleb/io-workarounds.c +++ b/trunk/arch/powerpc/platforms/celleb/io-workarounds.c @@ -22,7 +22,6 @@ #undef DEBUG -#include #include #include diff --git a/trunk/arch/powerpc/platforms/celleb/iommu.c b/trunk/arch/powerpc/platforms/celleb/iommu.c index 41e1e6f8e059..fbe718d517a6 100644 --- a/trunk/arch/powerpc/platforms/celleb/iommu.c +++ b/trunk/arch/powerpc/platforms/celleb/iommu.c @@ -92,6 +92,9 @@ 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); @@ -99,4 +102,4 @@ static int __init celleb_init_iommu(void) return 0; } -machine_arch_initcall(celleb_beat, celleb_init_iommu); +arch_initcall(celleb_init_iommu); diff --git a/trunk/arch/powerpc/platforms/celleb/pci.c b/trunk/arch/powerpc/platforms/celleb/pci.c index 51b390d34e4d..5d399e038c23 100644 --- a/trunk/arch/powerpc/platforms/celleb/pci.c +++ b/trunk/arch/powerpc/platforms/celleb/pci.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/powerpc/platforms/celleb/setup.c b/trunk/arch/powerpc/platforms/celleb/setup.c index f27ae1e3fb58..0f0c4680bf01 100644 --- a/trunk/arch/powerpc/platforms/celleb/setup.c +++ b/trunk/arch/powerpc/platforms/celleb/setup.c @@ -111,6 +111,10 @@ 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); @@ -118,8 +122,7 @@ static int __init celleb_publish_devices(void) return 0; } -machine_device_initcall(celleb_beat, celleb_publish_devices); -machine_device_initcall(celleb_native, celleb_publish_devices); +device_initcall(celleb_publish_devices); /* diff --git a/trunk/arch/powerpc/platforms/iseries/pci.c b/trunk/arch/powerpc/platforms/iseries/pci.c index cc562e4c2f32..30e3d992dc0d 100644 --- a/trunk/arch/powerpc/platforms/iseries/pci.c +++ b/trunk/arch/powerpc/platforms/iseries/pci.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -71,7 +70,7 @@ static long current_iomm_table_entry; * Lookup Tables. */ static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES]; -static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES]; +static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES]; static DEFINE_SPINLOCK(iomm_table_lock); @@ -81,9 +80,8 @@ 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)(sbp ? *sbp : 0) << 40) + return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40) + ((u64)0x10 << 32); } @@ -335,8 +333,7 @@ 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; - ds_addr_table[current_iomm_table_entry] = - iseries_ds_addr(dev->sysdata) | (bar_num << 24); + iobar_table[current_iomm_table_entry] = bar_num; bar_size -= IOMM_TABLE_ENTRY_SIZE; ++current_iomm_table_entry; } @@ -441,6 +438,7 @@ 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); @@ -601,7 +599,8 @@ static inline struct device_node *xlate_iomm_address( dn = iomm_table[ind]; if (dn != NULL) { - *dsaptr = ds_addr_table[ind]; + int barnum = iobar_table[ind]; + *dsaptr = iseries_ds_addr(dn) | (barnum << 24); *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE; } else panic("PCI: Invalid PCI IO address detected!\n"); diff --git a/trunk/arch/powerpc/platforms/maple/setup.c b/trunk/arch/powerpc/platforms/maple/setup.c index 3ce2d73b4177..144177d77cf1 100644 --- a/trunk/arch/powerpc/platforms/maple/setup.c +++ b/trunk/arch/powerpc/platforms/maple/setup.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -57,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/pasemi/setup.c b/trunk/arch/powerpc/platforms/pasemi/setup.c index 1940e678878e..a89d098e41bf 100644 --- a/trunk/arch/powerpc/platforms/pasemi/setup.c +++ b/trunk/arch/powerpc/platforms/pasemi/setup.c @@ -264,7 +264,7 @@ static int pas_machine_check_handler(struct pt_regs *regs) srr0 = regs->nip; srr1 = regs->msr; - if (mpic_get_mcirq() == nmi_virq) { + if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) { printk(KERN_ERR "NMI delivered\n"); debugger(regs); mpic_end_irq(nmi_virq); diff --git a/trunk/arch/powerpc/platforms/powermac/low_i2c.c b/trunk/arch/powerpc/platforms/powermac/low_i2c.c index 21226b74c9b2..da2007e3db0e 100644 --- a/trunk/arch/powerpc/platforms/powermac/low_i2c.c +++ b/trunk/arch/powerpc/platforms/powermac/low_i2c.c @@ -585,7 +585,8 @@ static void __init kw_i2c_probe(void) struct device_node *np, *child, *parent; /* Probe keywest-i2c busses */ - for_each_compatible_node(np, "i2c","keywest-i2c") { + for (np = NULL; + (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){ struct pmac_i2c_host_kw *host; int multibus, chans, i; @@ -1461,6 +1462,9 @@ int __init pmac_i2c_init(void) return 0; i2c_inited = 1; + if (!machine_is(powermac)) + return 0; + /* Probe keywest-i2c busses */ kw_i2c_probe(); @@ -1479,7 +1483,7 @@ int __init pmac_i2c_init(void) return 0; } -machine_arch_initcall(powermac, pmac_i2c_init); +arch_initcall(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 @@ -1511,4 +1515,4 @@ static int __init pmac_i2c_create_platform_devices(void) return 0; } -machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices); +subsys_initcall(pmac_i2c_create_platform_devices); diff --git a/trunk/arch/powerpc/platforms/powermac/pfunc_base.c b/trunk/arch/powerpc/platforms/powermac/pfunc_base.c index db20de512f3e..45d54b9ad9e0 100644 --- a/trunk/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/trunk/arch/powerpc/platforms/powermac/pfunc_base.c @@ -363,7 +363,8 @@ int __init pmac_pfunc_base_install(void) return 0; } -machine_arch_initcall(powermac, pmac_pfunc_base_install); + +arch_initcall(pmac_pfunc_base_install); #ifdef CONFIG_PM diff --git a/trunk/arch/powerpc/platforms/powermac/pic.c b/trunk/arch/powerpc/platforms/powermac/pic.c index cd7216437416..999f5e160897 100644 --- a/trunk/arch/powerpc/platforms/powermac/pic.c +++ b/trunk/arch/powerpc/platforms/powermac/pic.c @@ -690,5 +690,6 @@ static int __init init_pmacpic_sysfs(void) sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic); return 0; } -machine_subsys_initcall(powermac, init_pmacpic_sysfs); + +subsys_initcall(init_pmacpic_sysfs); diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c index 36ff1b6b7fac..adad4e976381 100644 --- a/trunk/arch/powerpc/platforms/powermac/setup.c +++ b/trunk/arch/powerpc/platforms/powermac/setup.c @@ -397,13 +397,17 @@ 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; } -machine_late_initcall(powermac, pmac_late_init); + +late_initcall(pmac_late_init); /* * This is __init_refok because we check for "initializing" before @@ -530,6 +534,9 @@ 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); @@ -544,7 +551,8 @@ static int __init pmac_declare_of_platform_devices(void) return 0; } -machine_device_initcall(powermac, pmac_declare_of_platform_devices); + +device_initcall(pmac_declare_of_platform_devices); /* * Called very early, MMU is off, device-tree isn't unflattened diff --git a/trunk/arch/powerpc/platforms/pseries/eeh.c b/trunk/arch/powerpc/platforms/pseries/eeh.c index 9eb539ee5f9a..aa14a8559edb 100644 --- a/trunk/arch/powerpc/platforms/pseries/eeh.c +++ b/trunk/arch/powerpc/platforms/pseries/eeh.c @@ -29,8 +29,6 @@ #include #include #include -#include - #include #include #include @@ -171,6 +169,7 @@ 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; @@ -244,12 +243,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) { - struct device_node *dn; - - for_each_child_of_node(pdn->node, dn) { + dn = pdn->node->child; + while (dn) { pdn = PCI_DN(dn); if (pdn) n += gather_pci_data(pdn, buf+n, len-n); + dn = dn->sibling; } } @@ -373,7 +372,7 @@ struct device_node * find_device_pe(struct device_node *dn) return dn; } -/** Mark all devices that are children of this device as failed. +/** Mark all devices that are peers 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, @@ -381,11 +380,9 @@ struct device_node * find_device_pe(struct device_node *dn) * an interrupt context, which is bad. */ -static void __eeh_mark_slot(struct device_node *parent, int mode_flag) +static void __eeh_mark_slot (struct device_node *dn, int mode_flag) { - struct device_node *dn; - - for_each_child_of_node(parent, dn) { + while (dn) { if (PCI_DN(dn)) { /* Mark the pci device driver too */ struct pci_dev *dev = PCI_DN(dn)->pcidev; @@ -395,8 +392,10 @@ static void __eeh_mark_slot(struct device_node *parent, int mode_flag) if (dev && dev->driver) dev->error_state = pci_channel_io_frozen; - __eeh_mark_slot(dn, mode_flag); + if (dn->child) + __eeh_mark_slot (dn->child, mode_flag); } + dn = dn->sibling; } } @@ -416,19 +415,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, mode_flag); + __eeh_mark_slot (dn->child, mode_flag); } -static void __eeh_clear_slot(struct device_node *parent, int mode_flag) +static void __eeh_clear_slot (struct device_node *dn, int mode_flag) { - struct device_node *dn; - - for_each_child_of_node(parent, dn) { + while (dn) { if (PCI_DN(dn)) { PCI_DN(dn)->eeh_mode &= ~mode_flag; PCI_DN(dn)->eeh_check_count = 0; - __eeh_clear_slot(dn, mode_flag); + if (dn->child) + __eeh_clear_slot (dn->child, mode_flag); } + dn = dn->sibling; } } @@ -445,7 +444,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, mode_flag); + __eeh_clear_slot (dn->child, mode_flag); spin_unlock_irqrestore(&confirm_error_lock, flags); } @@ -850,8 +849,11 @@ void eeh_restore_bars(struct pci_dn *pdn) if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code)) __restore_bars (pdn); - for_each_child_of_node(pdn->node, dn) + dn = pdn->node->child; + while (dn) { eeh_restore_bars (PCI_DN(dn)); + dn = dn->sibling; + } } /** @@ -1129,8 +1131,7 @@ 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_each_child_of_node(dn, sib) + for (sib = dn->child; sib; sib = sib->sibling) eeh_add_device_tree_early(sib); eeh_add_device_early(dn); } diff --git a/trunk/arch/powerpc/sysdev/fsl_soc.c b/trunk/arch/powerpc/sysdev/fsl_soc.c index 217bcc2e8f86..4baad80ab731 100644 --- a/trunk/arch/powerpc/sysdev/fsl_soc.c +++ b/trunk/arch/powerpc/sysdev/fsl_soc.c @@ -1128,12 +1128,13 @@ arch_initcall(fs_enet_of_init); static int __init fsl_pcmcia_of_init(void) { - struct device_node *np; + struct device_node *np = NULL; /* * Register all the devices which type is "pcmcia" */ - for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia") - of_platform_device_create(np, "m8xx-pcmcia", NULL); + while ((np = of_find_compatible_node(np, + "pcmcia", "fsl,pq-pcmcia")) != NULL) + of_platform_device_create(np, "m8xx-pcmcia", NULL); return 0; } diff --git a/trunk/arch/powerpc/sysdev/mv64x60_dev.c b/trunk/arch/powerpc/sysdev/mv64x60_dev.c index 304056cafb1e..548a32082e4a 100644 --- a/trunk/arch/powerpc/sysdev/mv64x60_dev.c +++ b/trunk/arch/powerpc/sysdev/mv64x60_dev.c @@ -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,19 +451,22 @@ static int __init mv64x60_device_setup(void) int id; int err; - id = 0; - for_each_compatible_node(np, "serial", "marvell,mpsc") - if ((err = mv64x60_mpsc_device_setup(np, id++))) + for (id = 0; + (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++) + if ((err = mv64x60_mpsc_device_setup(np, id))) goto error; - id = 0; - for_each_compatible_node(np, "network", "marvell,mv64x60-eth") - if ((err = mv64x60_eth_device_setup(np, id++))) + for (id = 0; + (np = of_find_compatible_node(np, "network", + "marvell,mv64x60-eth")); + id++) + if ((err = mv64x60_eth_device_setup(np, id))) goto error; - id = 0; - for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c") - if ((err = mv64x60_i2c_device_setup(np, id++))) + for (id = 0; + (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c")); + id++) + if ((err = mv64x60_i2c_device_setup(np, id))) goto error; /* support up to one watchdog timer */ @@ -474,6 +477,7 @@ static int __init mv64x60_device_setup(void) of_node_put(np); } + return 0; error: diff --git a/trunk/arch/powerpc/sysdev/mv64x60_pci.c b/trunk/arch/powerpc/sysdev/mv64x60_pci.c index d21ab8fa4993..6933f9c73b43 100644 --- a/trunk/arch/powerpc/sysdev/mv64x60_pci.c +++ b/trunk/arch/powerpc/sysdev/mv64x60_pci.c @@ -164,8 +164,8 @@ static int __init mv64x60_add_bridge(struct device_node *dev) void __init mv64x60_pci_init(void) { - struct device_node *np; + struct device_node *np = NULL; - for_each_compatible_node(np, "pci", "marvell,mv64x60-pci") + while ((np = of_find_compatible_node(np, "pci", "marvell,mv64x60-pci"))) mv64x60_add_bridge(np); } diff --git a/trunk/arch/powerpc/sysdev/mv64x60_udbg.c b/trunk/arch/powerpc/sysdev/mv64x60_udbg.c index 35c77c7d0616..367e7b13ec00 100644 --- a/trunk/arch/powerpc/sysdev/mv64x60_udbg.c +++ b/trunk/arch/powerpc/sysdev/mv64x60_udbg.c @@ -85,10 +85,10 @@ static void mv64x60_udbg_init(void) if (!stdout) return; - for_each_compatible_node(np, "serial", "marvell,mpsc") { + for (np = NULL; + (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); ) if (np == stdout) break; - } of_node_put(stdout); if (!np) diff --git a/trunk/arch/powerpc/sysdev/ppc4xx_pci.c b/trunk/arch/powerpc/sysdev/ppc4xx_pci.c index 5abfcd157483..3c2c14c32e76 100644 --- a/trunk/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/trunk/arch/powerpc/sysdev/ppc4xx_pci.c @@ -533,7 +533,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np) * */ -#define MAX_PCIE_BUS_MAPPED 0x40 +#define MAX_PCIE_BUS_MAPPED 0x10 struct ppc4xx_pciex_port { diff --git a/trunk/arch/powerpc/sysdev/tsi108_dev.c b/trunk/arch/powerpc/sysdev/tsi108_dev.c index be2808a292f7..a113d800cbf0 100644 --- a/trunk/arch/powerpc/sysdev/tsi108_dev.c +++ b/trunk/arch/powerpc/sysdev/tsi108_dev.c @@ -66,12 +66,14 @@ EXPORT_SYMBOL(get_vir_csrbase); static int __init tsi108_eth_of_init(void) { struct device_node *np; - unsigned int i = 0; + unsigned int i; struct platform_device *tsi_eth_dev; struct resource res; int ret; - for_each_compatible_node(np, "network", "tsi108-ethernet") { + for (np = NULL, i = 0; + (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL; + i++) { struct resource r[2]; struct device_node *phy, *mdio; hw_info tsi_eth_data; @@ -96,7 +98,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)) { @@ -152,7 +154,6 @@ static int __init tsi108_eth_of_init(void) unreg: platform_device_unregister(tsi_eth_dev); err: - of_node_put(np); return ret; } diff --git a/trunk/arch/powerpc/sysdev/uic.c b/trunk/arch/powerpc/sysdev/uic.c index 625b275c3795..ae3eadddddbd 100644 --- a/trunk/arch/powerpc/sysdev/uic.c +++ b/trunk/arch/powerpc/sysdev/uic.c @@ -309,23 +309,28 @@ void __init uic_init_tree(void) const u32 *interrupts; /* First locate and initialize the top-level UIC */ - for_each_compatible_node(np, NULL, "ibm,uic") { + + np = of_find_compatible_node(NULL, NULL, "ibm,uic"); + while (np) { 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 */ - for_each_compatible_node(np, NULL, "ibm,uic") { + np = of_find_compatible_node(NULL, NULL, "ibm,uic"); + while (np) { interrupts = of_get_property(np, "interrupts", NULL); if (interrupts) { /* Secondary UIC */ @@ -343,6 +348,8 @@ void __init uic_init_tree(void) /* FIXME: setup critical cascade?? */ } + + np = of_find_compatible_node(np, NULL, "ibm,uic"); } } diff --git a/trunk/arch/powerpc/sysdev/xilinx_intc.c b/trunk/arch/powerpc/sysdev/xilinx_intc.c index ba8eea2bcce0..c2f17cc43dfa 100644 --- a/trunk/arch/powerpc/sysdev/xilinx_intc.c +++ b/trunk/arch/powerpc/sysdev/xilinx_intc.c @@ -135,16 +135,10 @@ void __init xilinx_intc_init_tree(void) struct device_node *np; /* find top level interrupt controller */ - for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") { + for_each_compatible_node(np, NULL, "xilinx,intc") { 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); diff --git a/trunk/drivers/macintosh/therm_adt746x.c b/trunk/drivers/macintosh/therm_adt746x.c index 54f4942a2968..276945d51513 100644 --- a/trunk/drivers/macintosh/therm_adt746x.c +++ b/trunk/drivers/macintosh/therm_adt746x.c @@ -553,7 +553,6 @@ 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) @@ -613,20 +612,17 @@ thermostat_init(void) return -ENODEV; } - 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); + 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); if(therm_type == ADT7460) - 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"); + device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed); #ifndef CONFIG_I2C_POWERMAC request_module("i2c-powermac"); diff --git a/trunk/drivers/macintosh/therm_pm72.c b/trunk/drivers/macintosh/therm_pm72.c index 1e0a69a5e815..6fadc9ac66b0 100644 --- a/trunk/drivers/macintosh/therm_pm72.c +++ b/trunk/drivers/macintosh/therm_pm72.c @@ -1157,8 +1157,6 @@ 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; @@ -1184,21 +1182,18 @@ 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) { - 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); + 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); } else { - 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); + 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); } - if (err) - printk(KERN_WARNING "Failed to create some of the atribute" - "files for CPU %d\n", index); return 0; fail: @@ -1334,7 +1329,6 @@ 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 @@ -1386,11 +1380,8 @@ static int init_backside_state(struct backside_pid_state *state) if (state->monitor == NULL) return -ENODEV; - 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"); + device_create_file(&of_dev->dev, &dev_attr_backside_temperature); + device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm); return 0; } @@ -1501,8 +1492,6 @@ 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; @@ -1511,11 +1500,8 @@ static int init_drives_state(struct drives_pid_state *state) if (state->monitor == NULL) return -ENODEV; - 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"); + device_create_file(&of_dev->dev, &dev_attr_drives_temperature); + device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm); return 0; } @@ -1636,9 +1622,7 @@ static int init_dimms_state(struct dimm_pid_state *state) if (state->monitor == NULL) return -ENODEV; - if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature)) - printk(KERN_WARNING "Failed to create attribute file" - " for DIMM temperature\n"); + device_create_file(&of_dev->dev, &dev_attr_dimms_temperature); return 0; } @@ -1748,8 +1732,6 @@ 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; @@ -1758,11 +1740,8 @@ static int init_slots_state(struct slots_pid_state *state) if (state->monitor == NULL) return -ENODEV; - 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"); + device_create_file(&of_dev->dev, &dev_attr_slots_temperature); + device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm); return 0; } diff --git a/trunk/drivers/macintosh/therm_windtunnel.c b/trunk/drivers/macintosh/therm_windtunnel.c index 63ef1f6faaed..37224025f00e 100644 --- a/trunk/drivers/macintosh/therm_windtunnel.c +++ b/trunk/drivers/macintosh/therm_windtunnel.c @@ -223,7 +223,6 @@ static void setup_hardware( void ) { int val; - int err; /* save registers (if we unload the module) */ x.r0 = read_reg( x.fan, 0x00, 1 ); @@ -266,11 +265,8 @@ setup_hardware( void ) x.upind = -1; /* tune_fan( fan_up_table[x.upind].fan_setting ); */ - 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"); + device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature ); + device_create_file( &x.of_dev->dev, &dev_attr_case_temperature ); } static void diff --git a/trunk/drivers/net/ibm_newemac/core.c b/trunk/drivers/net/ibm_newemac/core.c index fced441face6..cb06280dced5 100644 --- a/trunk/drivers/net/ibm_newemac/core.c +++ b/trunk/drivers/net/ibm_newemac/core.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/of/base.c b/trunk/drivers/of/base.c index b306fef1ac41..9377f3bc410a 100644 --- a/trunk/drivers/of/base.c +++ b/trunk/drivers/of/base.c @@ -273,61 +273,3 @@ 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); diff --git a/trunk/drivers/of/device.c b/trunk/drivers/of/device.c index 29681c4b700b..6245f060fb77 100644 --- a/trunk/drivers/of/device.c +++ b/trunk/drivers/of/device.c @@ -9,6 +9,35 @@ #include +/** + * 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 diff --git a/trunk/drivers/serial/mpc52xx_uart.c b/trunk/drivers/serial/mpc52xx_uart.c index 7e3ba8b455a8..ec36ad78d2fe 100644 --- a/trunk/drivers/serial/mpc52xx_uart.c +++ b/trunk/drivers/serial/mpc52xx_uart.c @@ -72,8 +72,7 @@ #include #if defined(CONFIG_PPC_MERGE) -#include -#include +#include #else #include #endif diff --git a/trunk/drivers/serial/uartlite.c b/trunk/drivers/serial/uartlite.c index 80943409edb0..3f593247c41e 100644 --- a/trunk/drivers/serial/uartlite.c +++ b/trunk/drivers/serial/uartlite.c @@ -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 __devexit ulite_release(struct device *dev) +static int __devinit 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 __devexit ulite_remove(struct platform_device *pdev) +static int ulite_remove(struct platform_device *pdev) { return ulite_release(&pdev->dev); } static struct platform_driver ulite_platform_driver = { .probe = ulite_probe, - .remove = __devexit_p(ulite_remove), + .remove = ulite_remove, .driver = { .owner = THIS_MODULE, .name = "uartlite", diff --git a/trunk/include/asm-powerpc/mmu-hash64.h b/trunk/include/asm-powerpc/mmu-hash64.h index 2a1b4040e20d..12e5e773c67e 100644 --- a/trunk/include/asm-powerpc/mmu-hash64.h +++ b/trunk/include/asm-powerpc/mmu-hash64.h @@ -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)) & 0xffffffffffffff80UL)) +#define HPTE_V_COMPARE(x,y) (!(((x) ^ (y)) & 0xffffffffffffff80)) #define HPTE_V_BOLTED ASM_CONST(0x0000000000000010) #define HPTE_V_LOCK ASM_CONST(0x0000000000000008) #define HPTE_V_LARGE ASM_CONST(0x0000000000000004) @@ -278,7 +278,6 @@ 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); diff --git a/trunk/include/asm-powerpc/pci-bridge.h b/trunk/include/asm-powerpc/pci-bridge.h index a6ea49eb680b..9b16d3b17169 100644 --- a/trunk/include/asm-powerpc/pci-bridge.h +++ b/trunk/include/asm-powerpc/pci-bridge.h @@ -165,17 +165,18 @@ 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 */ diff --git a/trunk/include/linux/of.h b/trunk/include/linux/of.h index b5f33efcb8e2..c65af7bd1e9c 100644 --- a/trunk/include/linux/of.h +++ b/trunk/include/linux/of.h @@ -17,7 +17,6 @@ */ #include #include -#include #include @@ -42,11 +41,6 @@ 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); @@ -66,7 +60,5 @@ 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 */ diff --git a/trunk/include/linux/of_device.h b/trunk/include/linux/of_device.h index 6dc11959770c..212bffb2b174 100644 --- a/trunk/include/linux/of_device.h +++ b/trunk/include/linux/of_device.h @@ -10,6 +10,8 @@ #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);