aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/40x/Kconfig2
-rw-r--r--arch/powerpc/platforms/40x/Makefile2
-rw-r--r--arch/powerpc/platforms/40x/kilauea.c60
-rw-r--r--arch/powerpc/platforms/40x/makalu.c60
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c5
-rw-r--r--arch/powerpc/platforms/40x/virtex.c2
-rw-r--r--arch/powerpc/platforms/44x/Kconfig13
-rw-r--r--arch/powerpc/platforms/44x/Makefile1
-rw-r--r--arch/powerpc/platforms/44x/virtex.c2
-rw-r--r--arch/powerpc/platforms/44x/virtex_ml510.c29
-rw-r--r--arch/powerpc/platforms/44x/warp.c76
-rw-r--r--arch/powerpc/platforms/52xx/efika.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c4
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h13
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c43
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c52
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_smp.c8
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c1
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads.h4
-rw-r--r--arch/powerpc/platforms/Kconfig4
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype26
-rw-r--r--arch/powerpc/platforms/cell/celleb_pci.c10
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c13
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_pciex.c12
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c6
-rw-r--r--arch/powerpc/platforms/chrp/pci.c8
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c24
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c2
-rw-r--r--arch/powerpc/platforms/iseries/pci.c8
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/smp.c16
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c52
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c76
-rw-r--r--arch/powerpc/platforms/pseries/setup.c25
42 files changed, 340 insertions, 337 deletions
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index f39c953d5353..a6e43cb6f825 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -45,6 +45,7 @@ config KILAUEA
45 depends on 40x 45 depends on 40x
46 default n 46 default n
47 select 405EX 47 select 405EX
48 select PPC40x_SIMPLE
48 select PPC4xx_PCI_EXPRESS 49 select PPC4xx_PCI_EXPRESS
49 help 50 help
50 This option enables support for the AMCC PPC405EX evaluation board. 51 This option enables support for the AMCC PPC405EX evaluation board.
@@ -56,6 +57,7 @@ config MAKALU
56 select 405EX 57 select 405EX
57 select PCI 58 select PCI
58 select PPC4xx_PCI_EXPRESS 59 select PPC4xx_PCI_EXPRESS
60 select PPC40x_SIMPLE
59 help 61 help
60 This option enables support for the AMCC PPC405EX board. 62 This option enables support for the AMCC PPC405EX board.
61 63
diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
index 9bab76a652a6..56e89004c468 100644
--- a/arch/powerpc/platforms/40x/Makefile
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -1,6 +1,4 @@
1obj-$(CONFIG_KILAUEA) += kilauea.o
2obj-$(CONFIG_HCU4) += hcu4.o 1obj-$(CONFIG_HCU4) += hcu4.o
3obj-$(CONFIG_MAKALU) += makalu.o
4obj-$(CONFIG_WALNUT) += walnut.o 2obj-$(CONFIG_WALNUT) += walnut.o
5obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o 3obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
6obj-$(CONFIG_EP405) += ep405.o 4obj-$(CONFIG_EP405) += ep405.o
diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
deleted file mode 100644
index fd7d934dac8b..000000000000
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Kilauea board specific routines
3 *
4 * Copyright 2007-2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * Based on the Walnut code by
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 * Copyright 2007 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <linux/init.h>
16#include <linux/of_platform.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/pci-bridge.h>
23#include <asm/ppc4xx.h>
24
25static __initdata struct of_device_id kilauea_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init kilauea_device_probe(void)
33{
34 of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
35
36 return 0;
37}
38machine_device_initcall(kilauea, kilauea_device_probe);
39
40static int __init kilauea_probe(void)
41{
42 unsigned long root = of_get_flat_dt_root();
43
44 if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
45 return 0;
46
47 ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
48
49 return 1;
50}
51
52define_machine(kilauea) {
53 .name = "Kilauea",
54 .probe = kilauea_probe,
55 .progress = udbg_progress,
56 .init_IRQ = uic_init_tree,
57 .get_irq = uic_get_irq,
58 .restart = ppc4xx_reset_system,
59 .calibrate_decr = generic_calibrate_decr,
60};
diff --git a/arch/powerpc/platforms/40x/makalu.c b/arch/powerpc/platforms/40x/makalu.c
deleted file mode 100644
index a6a1d6017b71..000000000000
--- a/arch/powerpc/platforms/40x/makalu.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Makalu board specific routines
3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * Based on the Walnut code by
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 * Copyright 2007 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <linux/init.h>
16#include <linux/of_platform.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/pci-bridge.h>
23#include <asm/ppc4xx.h>
24
25static __initdata struct of_device_id makalu_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init makalu_device_probe(void)
33{
34 of_platform_bus_probe(NULL, makalu_of_bus, NULL);
35
36 return 0;
37}
38machine_device_initcall(makalu, makalu_device_probe);
39
40static int __init makalu_probe(void)
41{
42 unsigned long root = of_get_flat_dt_root();
43
44 if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
45 return 0;
46
47 ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
48
49 return 1;
50}
51
52define_machine(makalu) {
53 .name = "Makalu",
54 .probe = makalu_probe,
55 .progress = udbg_progress,
56 .init_IRQ = uic_init_tree,
57 .get_irq = uic_get_irq,
58 .restart = ppc4xx_reset_system,
59 .calibrate_decr = generic_calibrate_decr,
60};
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index f40ac9b8f99f..5fd5a5974001 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -51,7 +51,10 @@ machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
51 * board.c file for it rather than adding it to this list. 51 * board.c file for it rather than adding it to this list.
52 */ 52 */
53static char *board[] __initdata = { 53static char *board[] __initdata = {
54 "amcc,acadia" 54 "amcc,acadia",
55 "amcc,haleakala",
56 "amcc,kilauea",
57 "amcc,makalu"
55}; 58};
56 59
57static int __init ppc40x_probe(void) 60static int __init ppc40x_probe(void)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index fc7fb001276c..d0fc6866b00c 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -14,6 +14,7 @@
14#include <asm/prom.h> 14#include <asm/prom.h>
15#include <asm/time.h> 15#include <asm/time.h>
16#include <asm/xilinx_intc.h> 16#include <asm/xilinx_intc.h>
17#include <asm/xilinx_pci.h>
17#include <asm/ppc4xx.h> 18#include <asm/ppc4xx.h>
18 19
19static struct of_device_id xilinx_of_bus_ids[] __initdata = { 20static struct of_device_id xilinx_of_bus_ids[] __initdata = {
@@ -47,6 +48,7 @@ static int __init virtex_probe(void)
47define_machine(virtex) { 48define_machine(virtex) {
48 .name = "Xilinx Virtex", 49 .name = "Xilinx Virtex",
49 .probe = virtex_probe, 50 .probe = virtex_probe,
51 .setup_arch = xilinx_pci_init,
50 .init_IRQ = xilinx_intc_init_tree, 52 .init_IRQ = xilinx_intc_init_tree,
51 .get_irq = xilinx_intc_get_irq, 53 .get_irq = xilinx_intc_get_irq,
52 .restart = ppc4xx_reset_system, 54 .restart = ppc4xx_reset_system,
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 0d83a6a0397d..90e3192611a4 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -156,7 +156,7 @@ config YOSEMITE
156# This option enables support for the IBM PPC440GX evaluation board. 156# This option enables support for the IBM PPC440GX evaluation board.
157 157
158config XILINX_VIRTEX440_GENERIC_BOARD 158config XILINX_VIRTEX440_GENERIC_BOARD
159 bool "Generic Xilinx Virtex 440 board" 159 bool "Generic Xilinx Virtex 5 FXT board support"
160 depends on 44x 160 depends on 44x
161 default n 161 default n
162 select XILINX_VIRTEX_5_FXT 162 select XILINX_VIRTEX_5_FXT
@@ -171,6 +171,17 @@ config XILINX_VIRTEX440_GENERIC_BOARD
171 Most Virtex 5 designs should use this unless it needs to do some 171 Most Virtex 5 designs should use this unless it needs to do some
172 special configuration at board probe time. 172 special configuration at board probe time.
173 173
174config XILINX_ML510
175 bool "Xilinx ML510 extra support"
176 depends on XILINX_VIRTEX440_GENERIC_BOARD
177 select PPC_PCI_CHOICE
178 select XILINX_PCI if PCI
179 select PPC_INDIRECT_PCI if PCI
180 select PPC_I8259 if PCI
181 help
182 This option enables extra support for features on the Xilinx ML510
183 board. The ML510 has a PCI bus with ALI south bridge.
184
174config PPC44x_SIMPLE 185config PPC44x_SIMPLE
175 bool "Simple PowerPC 44x board support" 186 bool "Simple PowerPC 44x board support"
176 depends on 44x 187 depends on 44x
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 01f51daace13..ee6185aeaa3b 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_EBONY) += ebony.o
4obj-$(CONFIG_SAM440EP) += sam440ep.o 4obj-$(CONFIG_SAM440EP) += sam440ep.o
5obj-$(CONFIG_WARP) += warp.o 5obj-$(CONFIG_WARP) += warp.o
6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o 6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
7obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
diff --git a/arch/powerpc/platforms/44x/virtex.c b/arch/powerpc/platforms/44x/virtex.c
index 68637faf70ae..cf96ccaa760c 100644
--- a/arch/powerpc/platforms/44x/virtex.c
+++ b/arch/powerpc/platforms/44x/virtex.c
@@ -16,6 +16,7 @@
16#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/time.h> 17#include <asm/time.h>
18#include <asm/xilinx_intc.h> 18#include <asm/xilinx_intc.h>
19#include <asm/xilinx_pci.h>
19#include <asm/reg.h> 20#include <asm/reg.h>
20#include <asm/ppc4xx.h> 21#include <asm/ppc4xx.h>
21#include "44x.h" 22#include "44x.h"
@@ -53,6 +54,7 @@ static int __init virtex_probe(void)
53define_machine(virtex) { 54define_machine(virtex) {
54 .name = "Xilinx Virtex440", 55 .name = "Xilinx Virtex440",
55 .probe = virtex_probe, 56 .probe = virtex_probe,
57 .setup_arch = xilinx_pci_init,
56 .init_IRQ = xilinx_intc_init_tree, 58 .init_IRQ = xilinx_intc_init_tree,
57 .get_irq = xilinx_intc_get_irq, 59 .get_irq = xilinx_intc_get_irq,
58 .calibrate_decr = generic_calibrate_decr, 60 .calibrate_decr = generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c
new file mode 100644
index 000000000000..ba4a6e388a46
--- /dev/null
+++ b/arch/powerpc/platforms/44x/virtex_ml510.c
@@ -0,0 +1,29 @@
1#include <asm/i8259.h>
2#include <linux/pci.h>
3#include "44x.h"
4
5/**
6 * ml510_ail_quirk
7 */
8static void __devinit ml510_ali_quirk(struct pci_dev *dev)
9{
10 /* Enable the IDE controller */
11 pci_write_config_byte(dev, 0x58, 0x4c);
12 /* Assign irq 14 to the primary ide channel */
13 pci_write_config_byte(dev, 0x44, 0x0d);
14 /* Assign irq 15 to the secondary ide channel */
15 pci_write_config_byte(dev, 0x75, 0x0f);
16 /* Set the ide controller in native mode */
17 pci_write_config_byte(dev, 0x09, 0xff);
18
19 /* INTB = disabled, INTA = disabled */
20 pci_write_config_byte(dev, 0x48, 0x00);
21 /* INTD = disabled, INTC = disabled */
22 pci_write_config_byte(dev, 0x4a, 0x00);
23 /* Audio = INT7, Modem = disabled. */
24 pci_write_config_byte(dev, 0x4b, 0x60);
25 /* USB = INT7 */
26 pci_write_config_byte(dev, 0x74, 0x06);
27}
28DECLARE_PCI_FIXUP_EARLY(0x10b9, 0x1533, ml510_ali_quirk);
29
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 960edf89be51..c5118802a281 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * PIKA Warp(tm) board specific routines 2 * PIKA Warp(tm) board specific routines
3 * 3 *
4 * Copyright (c) 2008 PIKA Technologies 4 * Copyright (c) 2008-2009 PIKA Technologies
5 * Sean MacLennan <smaclennan@pikatech.com> 5 * Sean MacLennan <smaclennan@pikatech.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,7 @@
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/of_gpio.h>
18 19
19#include <asm/machdep.h> 20#include <asm/machdep.h>
20#include <asm/prom.h> 21#include <asm/prom.h>
@@ -23,6 +24,7 @@
23#include <asm/uic.h> 24#include <asm/uic.h>
24#include <asm/ppc4xx.h> 25#include <asm/ppc4xx.h>
25 26
27
26static __initdata struct of_device_id warp_of_bus[] = { 28static __initdata struct of_device_id warp_of_bus[] = {
27 { .compatible = "ibm,plb4", }, 29 { .compatible = "ibm,plb4", },
28 { .compatible = "ibm,opb", }, 30 { .compatible = "ibm,opb", },
@@ -55,6 +57,8 @@ define_machine(warp) {
55}; 57};
56 58
57 59
60static u32 post_info;
61
58/* I am not sure this is the best place for this... */ 62/* I am not sure this is the best place for this... */
59static int __init warp_post_info(void) 63static int __init warp_post_info(void)
60{ 64{
@@ -77,21 +81,21 @@ static int __init warp_post_info(void)
77 81
78 iounmap(fpga); 82 iounmap(fpga);
79 83
80 if (post1 || post2) 84 if (post1 || post2) {
81 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); 85 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
82 else 86 post_info = 1;
87 } else
83 printk(KERN_INFO "Warp POST OK\n"); 88 printk(KERN_INFO "Warp POST OK\n");
84 89
85 return 0; 90 return 0;
86} 91}
87machine_late_initcall(warp, warp_post_info);
88 92
89 93
90#ifdef CONFIG_SENSORS_AD7414 94#ifdef CONFIG_SENSORS_AD7414
91 95
92static LIST_HEAD(dtm_shutdown_list); 96static LIST_HEAD(dtm_shutdown_list);
93static void __iomem *dtm_fpga; 97static void __iomem *dtm_fpga;
94static void __iomem *gpio_base; 98static unsigned green_led, red_led;
95 99
96 100
97struct dtm_shutdown { 101struct dtm_shutdown {
@@ -134,14 +138,17 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
134static irqreturn_t temp_isr(int irq, void *context) 138static irqreturn_t temp_isr(int irq, void *context)
135{ 139{
136 struct dtm_shutdown *shutdown; 140 struct dtm_shutdown *shutdown;
141 int value = 1;
137 142
138 local_irq_disable(); 143 local_irq_disable();
139 144
145 gpio_set_value(green_led, 0);
146
140 /* Run through the shutdown list. */ 147 /* Run through the shutdown list. */
141 list_for_each_entry(shutdown, &dtm_shutdown_list, list) 148 list_for_each_entry(shutdown, &dtm_shutdown_list, list)
142 shutdown->func(shutdown->arg); 149 shutdown->func(shutdown->arg);
143 150
144 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n"); 151 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n\n");
145 152
146 while (1) { 153 while (1) {
147 if (dtm_fpga) { 154 if (dtm_fpga) {
@@ -149,52 +156,34 @@ static irqreturn_t temp_isr(int irq, void *context)
149 out_be32(dtm_fpga + 0x14, reset); 156 out_be32(dtm_fpga + 0x14, reset);
150 } 157 }
151 158
152 if (gpio_base) { 159 gpio_set_value(red_led, value);
153 unsigned leds = in_be32(gpio_base); 160 value ^= 1;
154
155 /* green off, red toggle */
156 leds &= ~0x80000000;
157 leds ^= 0x40000000;
158
159 out_be32(gpio_base, leds);
160 }
161
162 mdelay(500); 161 mdelay(500);
163 } 162 }
164} 163}
165 164
166static int pika_setup_leds(void) 165static int pika_setup_leds(void)
167{ 166{
168 struct device_node *np; 167 struct device_node *np, *child;
169 const u32 *gpios;
170 int len;
171 168
172 np = of_find_compatible_node(NULL, NULL, "linux,gpio-led"); 169 np = of_find_compatible_node(NULL, NULL, "gpio-leds");
173 if (!np) { 170 if (!np) {
174 printk(KERN_ERR __FILE__ ": Unable to find gpio-led\n"); 171 printk(KERN_ERR __FILE__ ": Unable to find leds\n");
175 return -ENOENT;
176 }
177
178 gpios = of_get_property(np, "gpios", &len);
179 of_node_put(np);
180 if (!gpios || len < 4) {
181 printk(KERN_ERR __FILE__
182 ": Unable to get gpios property (%d)\n", len);
183 return -ENOENT; 172 return -ENOENT;
184 } 173 }
185 174
186 np = of_find_node_by_phandle(gpios[0]); 175 for_each_child_of_node(np, child)
187 if (!np) { 176 if (strcmp(child->name, "green") == 0) {
188 printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); 177 green_led = of_get_gpio(child, 0);
189 return -ENOENT; 178 /* Turn back on the green LED */
190 } 179 gpio_set_value(green_led, 1);
180 } else if (strcmp(child->name, "red") == 0) {
181 red_led = of_get_gpio(child, 0);
182 /* Set based on post */
183 gpio_set_value(red_led, post_info);
184 }
191 185
192 gpio_base = of_iomap(np, 0);
193 of_node_put(np); 186 of_node_put(np);
194 if (!gpio_base) {
195 printk(KERN_ERR __FILE__ ": Unable to map gpio");
196 return -ENOMEM;
197 }
198 187
199 return 0; 188 return 0;
200} 189}
@@ -270,10 +259,10 @@ static int pika_dtm_thread(void __iomem *fpga)
270 } 259 }
271 260
272found_it: 261found_it:
273 i2c_put_adapter(adap);
274
275 pika_setup_critical_temp(client); 262 pika_setup_critical_temp(client);
276 263
264 i2c_put_adapter(adap);
265
277 printk(KERN_INFO "PIKA DTM thread running.\n"); 266 printk(KERN_INFO "PIKA DTM thread running.\n");
278 267
279 while (!kthread_should_stop()) { 268 while (!kthread_should_stop()) {
@@ -311,6 +300,9 @@ static int __init pika_dtm_start(void)
311 if (dtm_fpga == NULL) 300 if (dtm_fpga == NULL)
312 return -ENOENT; 301 return -ENOENT;
313 302
303 /* Must get post info before thread starts. */
304 warp_post_info();
305
314 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm"); 306 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm");
315 if (IS_ERR(dtm_thread)) { 307 if (IS_ERR(dtm_thread)) {
316 iounmap(dtm_fpga); 308 iounmap(dtm_fpga);
@@ -333,6 +325,8 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
333 return 0; 325 return 0;
334} 326}
335 327
328machine_late_initcall(warp, warp_post_info);
329
336#endif 330#endif
337 331
338EXPORT_SYMBOL(pika_dtm_register_shutdown); 332EXPORT_SYMBOL(pika_dtm_register_shutdown);
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a2068faef6ea..bcc69e1f77c1 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -34,7 +34,7 @@
34static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 34static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
35 int len, u32 * val) 35 int len, u32 * val)
36{ 36{
37 struct pci_controller *hose = bus->sysdata; 37 struct pci_controller *hose = pci_bus_to_host(bus);
38 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 38 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
39 | (((bus->number - hose->first_busno) & 0xff) << 16) 39 | (((bus->number - hose->first_busno) & 0xff) << 16)
40 | (hose->global_number << 24); 40 | (hose->global_number << 24);
@@ -49,7 +49,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
49static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, 49static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
50 int offset, int len, u32 val) 50 int offset, int len, u32 val)
51{ 51{
52 struct pci_controller *hose = bus->sysdata; 52 struct pci_controller *hose = pci_bus_to_host(bus);
53 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 53 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
54 | (((bus->number - hose->first_busno) & 0xff) << 16) 54 | (((bus->number - hose->first_busno) & 0xff) << 16)
55 | (hose->global_number << 24); 55 | (hose->global_number << 24);
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 87ff522f28b5..dd43114e9684 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -107,7 +107,7 @@ static int
107mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, 107mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
108 int offset, int len, u32 *val) 108 int offset, int len, u32 *val)
109{ 109{
110 struct pci_controller *hose = bus->sysdata; 110 struct pci_controller *hose = pci_bus_to_host(bus);
111 u32 value; 111 u32 value;
112 112
113 if (ppc_md.pci_exclude_device) 113 if (ppc_md.pci_exclude_device)
@@ -164,7 +164,7 @@ static int
164mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, 164mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
165 int offset, int len, u32 val) 165 int offset, int len, u32 val)
166{ 166{
167 struct pci_controller *hose = bus->sysdata; 167 struct pci_controller *hose = pci_bus_to_host(bus);
168 u32 value, mask; 168 u32 value, mask;
169 169
170 if (ppc_md.pci_exclude_device) 170 if (ppc_md.pci_exclude_device)
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 984db42cc8e7..6cf0f97486e2 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -24,10 +24,6 @@
24 24
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26 26
27/* Backword-compatibility stuff for the drivers */
28#define CPM_MAP_ADDR ((uint)0xf0000000)
29#define CPM_IRQ_OFFSET 0
30
31/* The ADS8260 has 16, 32-bit wide control/status registers, accessed 27/* The ADS8260 has 16, 32-bit wide control/status registers, accessed
32 * only on word boundaries. 28 * only on word boundaries.
33 * Not all are used (yet), or are interesting to us (yet). 29 * Not all are used (yet), or are interesting to us (yet).
@@ -44,14 +40,5 @@
44#define BCSR3_FETHIEN2 ((uint)0x10000000) /* 0 == enable*/ 40#define BCSR3_FETHIEN2 ((uint)0x10000000) /* 0 == enable*/
45#define BCSR3_FETH2_RST ((uint)0x80000000) /* 0 == reset */ 41#define BCSR3_FETH2_RST ((uint)0x80000000) /* 0 == reset */
46 42
47/* cpm serial driver works with constants below */
48
49#define SIU_INT_SMC1 ((uint)0x04+CPM_IRQ_OFFSET)
50#define SIU_INT_SMC2 ((uint)0x05+CPM_IRQ_OFFSET)
51#define SIU_INT_SCC1 ((uint)0x28+CPM_IRQ_OFFSET)
52#define SIU_INT_SCC2 ((uint)0x29+CPM_IRQ_OFFSET)
53#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET)
54#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET)
55
56#endif /* __MACH_ADS8260_DEFS */ 43#endif /* __MACH_ADS8260_DEFS */
57#endif /* __KERNEL__ */ 44#endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 7f066adc068c..43d385cedcd7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -34,6 +34,7 @@ config MPC85xx_MDS
34 bool "Freescale MPC85xx MDS" 34 bool "Freescale MPC85xx MDS"
35 select DEFAULT_UIMAGE 35 select DEFAULT_UIMAGE
36 select PHYLIB 36 select PHYLIB
37 select HAS_RAPIDIO
37 help 38 help
38 This option enables support for the MPC85xx MDS board 39 This option enables support for the MPC85xx MDS board
39 40
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index de66de7a9ca2..53d5851a6c97 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -163,7 +163,8 @@ static void __init mpc85xx_ds_setup_arch(void)
163#ifdef CONFIG_PCI 163#ifdef CONFIG_PCI
164 for_each_node_by_type(np, "pci") { 164 for_each_node_by_type(np, "pci") {
165 if (of_device_is_compatible(np, "fsl,mpc8540-pci") || 165 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
166 of_device_is_compatible(np, "fsl,mpc8548-pcie")) { 166 of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
167 of_device_is_compatible(np, "fsl,p2020-pcie")) {
167 struct resource rsrc; 168 struct resource rsrc;
168 of_address_to_resource(np, 0, &rsrc); 169 of_address_to_resource(np, 0, &rsrc);
169 if ((rsrc.start & 0xfffff) == primary_phb_addr) 170 if ((rsrc.start & 0xfffff) == primary_phb_addr)
@@ -195,9 +196,9 @@ static int __init mpc8544_ds_probe(void)
195 primary_phb_addr = 0xb000; 196 primary_phb_addr = 0xb000;
196#endif 197#endif
197 return 1; 198 return 1;
198 } else {
199 return 0;
200 } 199 }
200
201 return 0;
201} 202}
202 203
203static struct of_device_id __initdata mpc85xxds_ids[] = { 204static struct of_device_id __initdata mpc85xxds_ids[] = {
@@ -214,6 +215,7 @@ static int __init mpc85xxds_publish_devices(void)
214} 215}
215machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices); 216machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
216machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices); 217machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
218machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
217 219
218/* 220/*
219 * Called very early, device-tree isn't unflattened 221 * Called very early, device-tree isn't unflattened
@@ -227,9 +229,26 @@ static int __init mpc8572_ds_probe(void)
227 primary_phb_addr = 0x8000; 229 primary_phb_addr = 0x8000;
228#endif 230#endif
229 return 1; 231 return 1;
230 } else {
231 return 0;
232 } 232 }
233
234 return 0;
235}
236
237/*
238 * Called very early, device-tree isn't unflattened
239 */
240static int __init p2020_ds_probe(void)
241{
242 unsigned long root = of_get_flat_dt_root();
243
244 if (of_flat_dt_is_compatible(root, "fsl,P2020DS")) {
245#ifdef CONFIG_PCI
246 primary_phb_addr = 0x9000;
247#endif
248 return 1;
249 }
250
251 return 0;
233} 252}
234 253
235define_machine(mpc8544_ds) { 254define_machine(mpc8544_ds) {
@@ -259,3 +278,17 @@ define_machine(mpc8572_ds) {
259 .calibrate_decr = generic_calibrate_decr, 278 .calibrate_decr = generic_calibrate_decr,
260 .progress = udbg_progress, 279 .progress = udbg_progress,
261}; 280};
281
282define_machine(p2020_ds) {
283 .name = "P2020 DS",
284 .probe = p2020_ds_probe,
285 .setup_arch = mpc85xx_ds_setup_arch,
286 .init_IRQ = mpc85xx_ds_pic_init,
287#ifdef CONFIG_PCI
288 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
289#endif
290 .get_irq = mpic_get_irq,
291 .restart = fsl_rstcr_restart,
292 .calibrate_decr = generic_calibrate_decr,
293 .progress = udbg_progress,
294};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 7dd029034aec..b2c0a4319973 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -206,23 +206,24 @@ static void __init mpc85xx_mds_setup_arch(void)
206 } 206 }
207 207
208 if (bcsr_regs) { 208 if (bcsr_regs) {
209 if (machine_is(mpc8568_mds)) {
209#define BCSR_UCC1_GETH_EN (0x1 << 7) 210#define BCSR_UCC1_GETH_EN (0x1 << 7)
210#define BCSR_UCC2_GETH_EN (0x1 << 7) 211#define BCSR_UCC2_GETH_EN (0x1 << 7)
211#define BCSR_UCC1_MODE_MSK (0x3 << 4) 212#define BCSR_UCC1_MODE_MSK (0x3 << 4)
212#define BCSR_UCC2_MODE_MSK (0x3 << 0) 213#define BCSR_UCC2_MODE_MSK (0x3 << 0)
213 214
214 /* Turn off UCC1 & UCC2 */ 215 /* Turn off UCC1 & UCC2 */
215 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN); 216 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
216 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN); 217 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
217 218
218 /* Mode is RGMII, all bits clear */ 219 /* Mode is RGMII, all bits clear */
219 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK | 220 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK |
220 BCSR_UCC2_MODE_MSK); 221 BCSR_UCC2_MODE_MSK);
221
222 /* Turn UCC1 & UCC2 on */
223 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
224 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
225 222
223 /* Turn UCC1 & UCC2 on */
224 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
225 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
226 }
226 iounmap(bcsr_regs); 227 iounmap(bcsr_regs);
227 } 228 }
228#endif /* CONFIG_QUICC_ENGINE */ 229#endif /* CONFIG_QUICC_ENGINE */
@@ -257,7 +258,8 @@ static int __init board_fixups(void)
257 258
258 return 0; 259 return 0;
259} 260}
260machine_arch_initcall(mpc85xx_mds, board_fixups); 261machine_arch_initcall(mpc8568_mds, board_fixups);
262machine_arch_initcall(mpc8569_mds, board_fixups);
261 263
262static struct of_device_id mpc85xx_ids[] = { 264static struct of_device_id mpc85xx_ids[] = {
263 { .type = "soc", }, 265 { .type = "soc", },
@@ -276,7 +278,8 @@ static int __init mpc85xx_publish_devices(void)
276 278
277 return 0; 279 return 0;
278} 280}
279machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices); 281machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
282machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
280 283
281static void __init mpc85xx_mds_pic_init(void) 284static void __init mpc85xx_mds_pic_init(void)
282{ 285{
@@ -321,8 +324,8 @@ static int __init mpc85xx_mds_probe(void)
321 return of_flat_dt_is_compatible(root, "MPC85xxMDS"); 324 return of_flat_dt_is_compatible(root, "MPC85xxMDS");
322} 325}
323 326
324define_machine(mpc85xx_mds) { 327define_machine(mpc8568_mds) {
325 .name = "MPC85xx MDS", 328 .name = "MPC8568 MDS",
326 .probe = mpc85xx_mds_probe, 329 .probe = mpc85xx_mds_probe,
327 .setup_arch = mpc85xx_mds_setup_arch, 330 .setup_arch = mpc85xx_mds_setup_arch,
328 .init_IRQ = mpc85xx_mds_pic_init, 331 .init_IRQ = mpc85xx_mds_pic_init,
@@ -334,3 +337,24 @@ define_machine(mpc85xx_mds) {
334 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 337 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
335#endif 338#endif
336}; 339};
340
341static int __init mpc8569_mds_probe(void)
342{
343 unsigned long root = of_get_flat_dt_root();
344
345 return of_flat_dt_is_compatible(root, "fsl,MPC8569EMDS");
346}
347
348define_machine(mpc8569_mds) {
349 .name = "MPC8569 MDS",
350 .probe = mpc8569_mds_probe,
351 .setup_arch = mpc85xx_mds_setup_arch,
352 .init_IRQ = mpc85xx_mds_pic_init,
353 .get_irq = mpic_get_irq,
354 .restart = fsl_rstcr_restart,
355 .calibrate_decr = generic_calibrate_decr,
356 .progress = udbg_progress,
357#ifdef CONFIG_PCI
358 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
359#endif
360};
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index d79104669cdc..2efa052975e6 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index af14f852d747..90754e752bd8 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index ea2360639652..72b31a6010a0 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 3f49a6f893a3..51eec0cd5519 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index c4ec49b5f7f8..7e9e83c04a8a 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -24,7 +24,6 @@
24#include <asm/time.h> 24#include <asm/time.h>
25#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
27#include <asm/mpc86xx.h>
28#include <asm/prom.h> 27#include <asm/prom.h>
29#include <mm/mmu_decl.h> 28#include <mm/mmu_decl.h>
30#include <asm/udbg.h> 29#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
index 014e26cda08d..d84bbb508ee7 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -20,7 +20,6 @@
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
22#include <asm/mpic.h> 22#include <asm/mpic.h>
23#include <asm/mpc86xx.h>
24#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
25 24
26#include <sysdev/fsl_soc.h> 25#include <sysdev/fsl_soc.h>
@@ -30,6 +29,11 @@
30extern void __secondary_start_mpc86xx(void); 29extern void __secondary_start_mpc86xx(void);
31extern unsigned long __secondary_hold_acknowledge; 30extern unsigned long __secondary_hold_acknowledge;
32 31
32#define MCM_PORT_CONFIG_OFFSET 0x10
33
34/* Offset from CCSRBAR */
35#define MPC86xx_MCM_OFFSET (0x1000)
36#define MPC86xx_MCM_SIZE (0x1000)
33 37
34static void __init 38static void __init
35smp_86xx_release_core(int nr) 39smp_86xx_release_core(int nr)
@@ -48,6 +52,8 @@ smp_86xx_release_core(int nr)
48 pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2)); 52 pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
49 pcr |= 1 << (nr + 24); 53 pcr |= 1 << (nr + 24);
50 out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr); 54 out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
55
56 iounmap(mcm_vaddr);
51} 57}
52 58
53 59
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 2886a36fc085..51c8f331b671 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -25,7 +25,6 @@
25#include <asm/time.h> 25#include <asm/time.h>
26#include <asm/machdep.h> 26#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 27#include <asm/pci-bridge.h>
28#include <asm/mpc86xx.h>
29#include <asm/prom.h> 28#include <asm/prom.h>
30#include <mm/mmu_decl.h> 29#include <mm/mmu_decl.h>
31#include <asm/udbg.h> 30#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index a5076668bad6..19412f76fa3b 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -17,10 +17,6 @@
17 17
18#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
19 19
20#define MPC8xx_CPM_OFFSET (0x9c0)
21#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET)
22#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver
23
24/* Bits of interest in the BCSRs. 20/* Bits of interest in the BCSRs.
25 */ 21 */
26#define BCSR1_ETHEN ((uint)0x20000000) 22#define BCSR1_ETHEN ((uint)0x20000000)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index e3e87078d03f..04a8061045c4 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -329,4 +329,8 @@ config MCU_MPC8349EMITX
329 also register MCU GPIOs with the generic GPIO API, so you'll able 329 also register MCU GPIOs with the generic GPIO API, so you'll able
330 to use MCU pins as GPIOs. 330 to use MCU pins as GPIOs.
331 331
332config XILINX_PCI
333 bool "Xilinx PCI host bridge support"
334 depends on PCI && XILINX_VIRTEX
335
332endmenu 336endmenu
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 732ee93a8e98..cca6b4fc719a 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -10,7 +10,6 @@ menu "Processor support"
10choice 10choice
11 prompt "Processor Type" 11 prompt "Processor Type"
12 depends on PPC32 12 depends on PPC32
13 default 6xx
14 help 13 help
15 There are five families of 32 bit PowerPC chips supported. 14 There are five families of 32 bit PowerPC chips supported.
16 The most common ones are the desktop and server CPUs (601, 603, 15 The most common ones are the desktop and server CPUs (601, 603,
@@ -22,7 +21,7 @@ choice
22 21
23 If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx. 22 If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx.
24 23
25config 6xx 24config PPC_BOOK3S
26 bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx" 25 bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
27 select PPC_FPU 26 select PPC_FPU
28 27
@@ -58,13 +57,11 @@ config E200
58 57
59endchoice 58endchoice
60 59
61# Until we have a choice of exclusive CPU types on 64-bit, we always
62# use PPC_BOOK3S. On 32-bit, this is equivalent to 6xx which is
63# "classic" MMU
64
65config PPC_BOOK3S 60config PPC_BOOK3S
66 def_bool y 61 default y
67 depends on PPC64 || 6xx 62 depends on PPC64
63 select PPC_FPU
64
68 65
69config POWER4_ONLY 66config POWER4_ONLY
70 bool "Optimize for POWER4" 67 bool "Optimize for POWER4"
@@ -75,6 +72,10 @@ config POWER4_ONLY
75 The resulting binary will not work on POWER3 or RS64 processors 72 The resulting binary will not work on POWER3 or RS64 processors
76 when compiled with binutils 2.15 or later. 73 when compiled with binutils 2.15 or later.
77 74
75config 6xx
76 def_bool y
77 depends on PPC32 && PPC_BOOK3S
78
78config POWER3 79config POWER3
79 bool 80 bool
80 depends on PPC64 && PPC_BOOK3S 81 depends on PPC64 && PPC_BOOK3S
@@ -203,9 +204,8 @@ config SPE
203 If in doubt, say Y here. 204 If in doubt, say Y here.
204 205
205config PPC_STD_MMU 206config PPC_STD_MMU
206 bool 207 def_bool y
207 depends on 6xx || PPC64 208 depends on PPC_BOOK3S
208 default y
209 209
210config PPC_STD_MMU_32 210config PPC_STD_MMU_32
211 def_bool y 211 def_bool y
@@ -263,8 +263,8 @@ config SMP
263 If you don't know what to do here, say N. 263 If you don't know what to do here, say N.
264 264
265config NR_CPUS 265config NR_CPUS
266 int "Maximum number of CPUs (2-1024)" 266 int "Maximum number of CPUs (2-8192)"
267 range 2 1024 267 range 2 8192
268 depends on SMP 268 depends on SMP
269 default "32" if PPC64 269 default "32" if PPC64
270 default "4" 270 default "4"
diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index f39a3b2a1667..00eaaa71630f 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -162,8 +162,7 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
162 unsigned int devfn, int where, int size, u32 *val) 162 unsigned int devfn, int where, int size, u32 *val)
163{ 163{
164 char *config; 164 char *config;
165 struct device_node *node; 165 struct pci_controller *hose = pci_bus_to_host(bus);
166 struct pci_controller *hose;
167 unsigned int devno = devfn >> 3; 166 unsigned int devno = devfn >> 3;
168 unsigned int fn = devfn & 0x7; 167 unsigned int fn = devfn & 0x7;
169 168
@@ -171,8 +170,6 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
171 BUG_ON(where % size); 170 BUG_ON(where % size);
172 171
173 pr_debug(" fake read: bus=0x%x, ", bus->number); 172 pr_debug(" fake read: bus=0x%x, ", bus->number);
174 node = (struct device_node *)bus->sysdata;
175 hose = pci_find_hose_for_OF_device(node);
176 config = get_fake_config_start(hose, devno, fn); 173 config = get_fake_config_start(hose, devno, fn);
177 174
178 pr_debug("devno=0x%x, where=0x%x, size=0x%x, ", devno, where, size); 175 pr_debug("devno=0x%x, where=0x%x, size=0x%x, ", devno, where, size);
@@ -192,8 +189,7 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
192 unsigned int devfn, int where, int size, u32 val) 189 unsigned int devfn, int where, int size, u32 val)
193{ 190{
194 char *config; 191 char *config;
195 struct device_node *node; 192 struct pci_controller *hose = pci_bus_to_host(bus);
196 struct pci_controller *hose;
197 struct celleb_pci_resource *res; 193 struct celleb_pci_resource *res;
198 unsigned int devno = devfn >> 3; 194 unsigned int devno = devfn >> 3;
199 unsigned int fn = devfn & 0x7; 195 unsigned int fn = devfn & 0x7;
@@ -201,8 +197,6 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
201 /* allignment check */ 197 /* allignment check */
202 BUG_ON(where % size); 198 BUG_ON(where % size);
203 199
204 node = (struct device_node *)bus->sysdata;
205 hose = pci_find_hose_for_OF_device(node);
206 config = get_fake_config_start(hose, devno, fn); 200 config = get_fake_config_start(hose, devno, fn);
207 201
208 if (!config) 202 if (!config)
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 48ec88a38a12..05b0db3ef638 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -134,15 +134,11 @@ static int celleb_epci_read_config(struct pci_bus *bus,
134{ 134{
135 PCI_IO_ADDR epci_base; 135 PCI_IO_ADDR epci_base;
136 PCI_IO_ADDR addr; 136 PCI_IO_ADDR addr;
137 struct device_node *node; 137 struct pci_controller *hose = pci_bus_to_host(bus);
138 struct pci_controller *hose;
139 138
140 /* allignment check */ 139 /* allignment check */
141 BUG_ON(where % size); 140 BUG_ON(where % size);
142 141
143 node = (struct device_node *)bus->sysdata;
144 hose = pci_find_hose_for_OF_device(node);
145
146 if (!celleb_epci_get_epci_cfg(hose)) 142 if (!celleb_epci_get_epci_cfg(hose))
147 return PCIBIOS_DEVICE_NOT_FOUND; 143 return PCIBIOS_DEVICE_NOT_FOUND;
148 144
@@ -198,16 +194,11 @@ static int celleb_epci_write_config(struct pci_bus *bus,
198{ 194{
199 PCI_IO_ADDR epci_base; 195 PCI_IO_ADDR epci_base;
200 PCI_IO_ADDR addr; 196 PCI_IO_ADDR addr;
201 struct device_node *node; 197 struct pci_controller *hose = pci_bus_to_host(bus);
202 struct pci_controller *hose;
203 198
204 /* allignment check */ 199 /* allignment check */
205 BUG_ON(where % size); 200 BUG_ON(where % size);
206 201
207 node = (struct device_node *)bus->sysdata;
208 hose = pci_find_hose_for_OF_device(node);
209
210
211 if (!celleb_epci_get_epci_cfg(hose)) 202 if (!celleb_epci_get_epci_cfg(hose))
212 return PCIBIOS_DEVICE_NOT_FOUND; 203 return PCIBIOS_DEVICE_NOT_FOUND;
213 204
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
index 3e7e0f1568ef..7fca09f990ba 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
@@ -366,11 +366,7 @@ static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where,
366static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn, 366static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
367 int where, int size, unsigned int *val) 367 int where, int size, unsigned int *val)
368{ 368{
369 struct device_node *dn; 369 struct pci_controller *phb = pci_bus_to_host(bus);
370 struct pci_controller *phb;
371
372 dn = bus->sysdata;
373 phb = pci_find_hose_for_OF_device(dn);
374 370
375 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) { 371 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) {
376 *val = ~0; 372 *val = ~0;
@@ -389,11 +385,7 @@ static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
389static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn, 385static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
390 int where, int size, unsigned int val) 386 int where, int size, unsigned int val)
391{ 387{
392 struct device_node *dn; 388 struct pci_controller *phb = pci_bus_to_host(bus);
393 struct pci_controller *phb;
394
395 dn = bus->sysdata;
396 phb = pci_find_hose_for_OF_device(dn);
397 389
398 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) 390 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1)
399 return PCIBIOS_DEVICE_NOT_FOUND; 391 return PCIBIOS_DEVICE_NOT_FOUND;
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 706eb5c7e2ee..24b30b6909c4 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -631,10 +631,6 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
631 if (IS_ERR(dentry)) 631 if (IS_ERR(dentry))
632 goto out_dir; 632 goto out_dir;
633 633
634 ret = -EEXIST;
635 if (dentry->d_inode)
636 goto out_dput;
637
638 mode &= ~current_umask(); 634 mode &= ~current_umask();
639 635
640 if (flags & SPU_CREATE_GANG) 636 if (flags & SPU_CREATE_GANG)
@@ -648,8 +644,6 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
648 fsnotify_mkdir(nd->path.dentry->d_inode, dentry); 644 fsnotify_mkdir(nd->path.dentry->d_inode, dentry);
649 return ret; 645 return ret;
650 646
651out_dput:
652 dput(dentry);
653out_dir: 647out_dir:
654 mutex_unlock(&nd->path.dentry->d_inode->i_mutex); 648 mutex_unlock(&nd->path.dentry->d_inode->i_mutex);
655out: 649out:
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index f6b0c519d5a2..8f67a394b2d0 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -34,7 +34,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
34 int len, u32 *val) 34 int len, u32 *val)
35{ 35{
36 volatile void __iomem *cfg_data; 36 volatile void __iomem *cfg_data;
37 struct pci_controller *hose = bus->sysdata; 37 struct pci_controller *hose = pci_bus_to_host(bus);
38 38
39 if (bus->number > 7) 39 if (bus->number > 7)
40 return PCIBIOS_DEVICE_NOT_FOUND; 40 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -61,7 +61,7 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
61 int len, u32 val) 61 int len, u32 val)
62{ 62{
63 volatile void __iomem *cfg_data; 63 volatile void __iomem *cfg_data;
64 struct pci_controller *hose = bus->sysdata; 64 struct pci_controller *hose = pci_bus_to_host(bus);
65 65
66 if (bus->number > 7) 66 if (bus->number > 7)
67 return PCIBIOS_DEVICE_NOT_FOUND; 67 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -96,7 +96,7 @@ static struct pci_ops gg2_pci_ops =
96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val) 97 int len, u32 *val)
98{ 98{
99 struct pci_controller *hose = bus->sysdata; 99 struct pci_controller *hose = pci_bus_to_host(bus);
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
101 | (((bus->number - hose->first_busno) & 0xff) << 16) 101 | (((bus->number - hose->first_busno) & 0xff) << 16)
102 | (hose->global_number << 24); 102 | (hose->global_number << 24);
@@ -111,7 +111,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
112 int len, u32 val) 112 int len, u32 val)
113{ 113{
114 struct pci_controller *hose = bus->sysdata; 114 struct pci_controller *hose = pci_bus_to_host(bus);
115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
116 | (((bus->number - hose->first_busno) & 0xff) << 16) 116 | (((bus->number - hose->first_busno) & 0xff) << 16)
117 | (hose->global_number << 24); 117 | (hose->global_number << 24);
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 65a35f38e062..fd23a1d4b39d 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -51,13 +51,20 @@ u8 uli_pirq_to_irq[8] = {
51 ULI_8259_NONE, /* PIRQH */ 51 ULI_8259_NONE, /* PIRQH */
52}; 52};
53 53
54static inline bool is_quirk_valid(void)
55{
56 return (machine_is(mpc86xx_hpcn) ||
57 machine_is(mpc8544_ds) ||
58 machine_is(p2020_ds) ||
59 machine_is(mpc8572_ds));
60}
61
54/* Bridge */ 62/* Bridge */
55static void __devinit early_uli5249(struct pci_dev *dev) 63static void __devinit early_uli5249(struct pci_dev *dev)
56{ 64{
57 unsigned char temp; 65 unsigned char temp;
58 66
59 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 67 if (!is_quirk_valid())
60 !machine_is(mpc8572_ds))
61 return; 68 return;
62 69
63 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO | 70 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO |
@@ -80,8 +87,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
80{ 87{
81 int i; 88 int i;
82 89
83 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 90 if (!is_quirk_valid())
84 !machine_is(mpc8572_ds))
85 return; 91 return;
86 92
87 /* 93 /*
@@ -149,8 +155,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
149 * IRQ 14: Edge 155 * IRQ 14: Edge
150 * IRQ 15: Edge 156 * IRQ 15: Edge
151 */ 157 */
152 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 158 if (!is_quirk_valid())
153 !machine_is(mpc8572_ds))
154 return; 159 return;
155 160
156 outb(0xfa, 0x4d0); 161 outb(0xfa, 0x4d0);
@@ -176,8 +181,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)
176 unsigned char c; 181 unsigned char c;
177 unsigned int d; 182 unsigned int d;
178 183
179 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 184 if (!is_quirk_valid())
180 !machine_is(mpc8572_ds))
181 return; 185 return;
182 186
183 /* read/write lock */ 187 /* read/write lock */
@@ -201,8 +205,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
201{ 205{
202 unsigned short temp; 206 unsigned short temp;
203 207
204 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 208 if (!is_quirk_valid())
205 !machine_is(mpc8572_ds))
206 return; 209 return;
207 210
208 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE | 211 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE |
@@ -270,7 +273,6 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
270static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev) 273static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)
271{ 274{
272 unsigned char c; 275 unsigned char c;
273 unsigned short temp;
274 276
275 if (!machine_is(mpc86xx_hpcd)) 277 if (!machine_is(mpc86xx_hpcd))
276 return; 278 return;
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 40219823d9b0..6c1e1011959e 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -177,7 +177,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
177static void pci_dma_dev_setup_iseries(struct pci_dev *pdev) 177static void pci_dma_dev_setup_iseries(struct pci_dev *pdev)
178{ 178{
179 struct iommu_table *tbl; 179 struct iommu_table *tbl;
180 struct device_node *dn = pdev->sysdata; 180 struct device_node *dn = pci_device_to_OF_node(pdev);
181 struct pci_dn *pdn = PCI_DN(dn); 181 struct pci_dn *pdn = PCI_DN(dn);
182 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); 182 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL);
183 183
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 21cddc30220b..175aac8ca7e5 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -318,6 +318,7 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
318{ 318{
319 struct resource *bar_res = &dev->resource[bar_num]; 319 struct resource *bar_res = &dev->resource[bar_num];
320 long bar_size = pci_resource_len(dev, bar_num); 320 long bar_size = pci_resource_len(dev, bar_num);
321 struct device_node *dn = pci_device_to_OF_node(dev);
321 322
322 /* 323 /*
323 * No space to allocate, quick exit, skip Allocation. 324 * No space to allocate, quick exit, skip Allocation.
@@ -335,9 +336,9 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
335 * Allocate the number of table entries needed for BAR. 336 * Allocate the number of table entries needed for BAR.
336 */ 337 */
337 while (bar_size > 0 ) { 338 while (bar_size > 0 ) {
338 iomm_table[current_iomm_table_entry] = dev->sysdata; 339 iomm_table[current_iomm_table_entry] = dn;
339 ds_addr_table[current_iomm_table_entry] = 340 ds_addr_table[current_iomm_table_entry] =
340 iseries_ds_addr(dev->sysdata) | (bar_num << 24); 341 iseries_ds_addr(dn) | (bar_num << 24);
341 bar_size -= IOMM_TABLE_ENTRY_SIZE; 342 bar_size -= IOMM_TABLE_ENTRY_SIZE;
342 ++current_iomm_table_entry; 343 ++current_iomm_table_entry;
343 } 344 }
@@ -410,7 +411,7 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
410 struct device_node *node; 411 struct device_node *node;
411 int i; 412 int i;
412 413
413 node = find_device_node(bus, pdev->devfn); 414 node = pci_device_to_OF_node(pdev);
414 pr_debug("PCI: iSeries %s, pdev %p, node %p\n", 415 pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
415 pci_name(pdev), pdev, node); 416 pci_name(pdev), pdev, node);
416 if (!node) { 417 if (!node) {
@@ -441,7 +442,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
441 } 442 }
442 } 443 }
443 444
444 pdev->sysdata = node;
445 allocate_device_bars(pdev); 445 allocate_device_bars(pdev);
446 iseries_device_information(pdev, bus, *sub_bus); 446 iseries_device_information(pdev, bus, *sub_bus);
447} 447}
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 7039d8f1d3ba..dce736349107 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -221,7 +221,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
221 continue; 221 continue;
222 irq += __ilog2(bits); 222 irq += __ilog2(bits);
223 spin_unlock_irqrestore(&pmac_pic_lock, flags); 223 spin_unlock_irqrestore(&pmac_pic_lock, flags);
224 __do_IRQ(irq); 224 generic_handle_irq(irq);
225 spin_lock_irqsave(&pmac_pic_lock, flags); 225 spin_lock_irqsave(&pmac_pic_lock, flags);
226 rc = IRQ_HANDLED; 226 rc = IRQ_HANDLED;
227 } 227 }
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 45936c9ed0ec..86f69a4eb49b 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -655,7 +655,7 @@ static int __init pmac_probe(void)
655/* Move that to pci.c */ 655/* Move that to pci.c */
656static int pmac_pci_probe_mode(struct pci_bus *bus) 656static int pmac_pci_probe_mode(struct pci_bus *bus)
657{ 657{
658 struct device_node *node = bus->sysdata; 658 struct device_node *node = pci_bus_to_OF_node(bus);
659 659
660 /* We need to use normal PCI probing for the AGP bus, 660 /* We need to use normal PCI probing for the AGP bus,
661 * since the device for the AGP bridge isn't in the tree. 661 * since the device for the AGP bridge isn't in the tree.
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index a0927a3bacb7..f6e04bcc70ef 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -32,12 +32,6 @@
32#define DBG pr_debug 32#define DBG pr_debug
33#endif 33#endif
34 34
35static irqreturn_t ipi_function_handler(int irq, void *msg)
36{
37 smp_message_recv((int)(long)msg);
38 return IRQ_HANDLED;
39}
40
41/** 35/**
42 * ps3_ipi_virqs - a per cpu array of virqs for ipi use 36 * ps3_ipi_virqs - a per cpu array of virqs for ipi use
43 */ 37 */
@@ -45,13 +39,6 @@ static irqreturn_t ipi_function_handler(int irq, void *msg)
45#define MSG_COUNT 4 39#define MSG_COUNT 4
46static DEFINE_PER_CPU(unsigned int, ps3_ipi_virqs[MSG_COUNT]); 40static DEFINE_PER_CPU(unsigned int, ps3_ipi_virqs[MSG_COUNT]);
47 41
48static const char *names[MSG_COUNT] = {
49 "ipi call",
50 "ipi reschedule",
51 "ipi migrate",
52 "ipi debug brk"
53};
54
55static void do_message_pass(int target, int msg) 42static void do_message_pass(int target, int msg)
56{ 43{
57 int result; 44 int result;
@@ -119,8 +106,7 @@ static void __init ps3_smp_setup_cpu(int cpu)
119 DBG("%s:%d: (%d, %d) => virq %u\n", 106 DBG("%s:%d: (%d, %d) => virq %u\n",
120 __func__, __LINE__, cpu, i, virqs[i]); 107 __func__, __LINE__, cpu, i, virqs[i]);
121 108
122 result = request_irq(virqs[i], ipi_function_handler, 109 result = smp_request_message_ipi(virqs[i], i);
123 IRQF_DISABLED, names[i], (void*)(long)i);
124 110
125 if (result) 111 if (result)
126 virqs[i] = NO_IRQ; 112 virqs[i] = NO_IRQ;
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 3ee01b4f4257..661c8e02bcba 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -388,7 +388,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
388 388
389 while (pci->phb->dma_window_size * children > 0x80000000ul) 389 while (pci->phb->dma_window_size * children > 0x80000000ul)
390 pci->phb->dma_window_size >>= 1; 390 pci->phb->dma_window_size >>= 1;
391 pr_debug("No ISA/IDE, window size is 0x%lx\n", 391 pr_debug("No ISA/IDE, window size is 0x%llx\n",
392 pci->phb->dma_window_size); 392 pci->phb->dma_window_size);
393 pci->phb->dma_window_base_cur = 0; 393 pci->phb->dma_window_base_cur = 0;
394 394
@@ -414,7 +414,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
414 while (pci->phb->dma_window_size * children > 0x70000000ul) 414 while (pci->phb->dma_window_size * children > 0x70000000ul)
415 pci->phb->dma_window_size >>= 1; 415 pci->phb->dma_window_size >>= 1;
416 416
417 pr_debug("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size); 417 pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size);
418} 418}
419 419
420 420
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 52a80e5840e8..e3139fa5e556 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -609,3 +609,55 @@ void __init hpte_init_lpar(void)
609 ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range; 609 ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range;
610 ppc_md.hpte_clear_all = pSeries_lpar_hptab_clear; 610 ppc_md.hpte_clear_all = pSeries_lpar_hptab_clear;
611} 611}
612
613#ifdef CONFIG_PPC_SMLPAR
614#define CMO_FREE_HINT_DEFAULT 1
615static int cmo_free_hint_flag = CMO_FREE_HINT_DEFAULT;
616
617static int __init cmo_free_hint(char *str)
618{
619 char *parm;
620 parm = strstrip(str);
621
622 if (strcasecmp(parm, "no") == 0 || strcasecmp(parm, "off") == 0) {
623 printk(KERN_INFO "cmo_free_hint: CMO free page hinting is not active.\n");
624 cmo_free_hint_flag = 0;
625 return 1;
626 }
627
628 cmo_free_hint_flag = 1;
629 printk(KERN_INFO "cmo_free_hint: CMO free page hinting is active.\n");
630
631 if (strcasecmp(parm, "yes") == 0 || strcasecmp(parm, "on") == 0)
632 return 1;
633
634 return 0;
635}
636
637__setup("cmo_free_hint=", cmo_free_hint);
638
639static void pSeries_set_page_state(struct page *page, int order,
640 unsigned long state)
641{
642 int i, j;
643 unsigned long cmo_page_sz, addr;
644
645 cmo_page_sz = cmo_get_page_size();
646 addr = __pa((unsigned long)page_address(page));
647
648 for (i = 0; i < (1 << order); i++, addr += PAGE_SIZE) {
649 for (j = 0; j < PAGE_SIZE; j += cmo_page_sz)
650 plpar_hcall_norets(H_PAGE_INIT, state, addr + j, 0);
651 }
652}
653
654void arch_free_page(struct page *page, int order)
655{
656 if (!cmo_free_hint_flag || !firmware_has_feature(FW_FEATURE_CMO))
657 return;
658
659 pSeries_set_page_state(page, order, H_PAGE_SET_UNUSED);
660}
661EXPORT_SYMBOL(arch_free_page);
662
663#endif
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index afad9f5ac0ac..b3cbac855924 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -19,7 +19,7 @@
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <linux/delay.h> 22#include <linux/workqueue.h>
23 23
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/io.h> 25#include <asm/io.h>
@@ -387,36 +387,51 @@ static void do_event_scan(void)
387 } while(error == 0); 387 } while(error == 0);
388} 388}
389 389
390static void do_event_scan_all_cpus(long delay) 390static void rtas_event_scan(struct work_struct *w);
391DECLARE_DELAYED_WORK(event_scan_work, rtas_event_scan);
392
393/*
394 * Delay should be at least one second since some machines have problems if
395 * we call event-scan too quickly.
396 */
397static unsigned long event_scan_delay = 1*HZ;
398static int first_pass = 1;
399
400static void rtas_event_scan(struct work_struct *w)
391{ 401{
392 int cpu; 402 unsigned int cpu;
403
404 do_event_scan();
393 405
394 get_online_cpus(); 406 get_online_cpus();
395 cpu = first_cpu(cpu_online_map); 407
396 for (;;) { 408 cpu = next_cpu(smp_processor_id(), cpu_online_map);
397 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 409 if (cpu == NR_CPUS) {
398 do_event_scan(); 410 cpu = first_cpu(cpu_online_map);
399 set_cpus_allowed(current, CPU_MASK_ALL); 411
400 412 if (first_pass) {
401 /* Drop hotplug lock, and sleep for the specified delay */ 413 first_pass = 0;
402 put_online_cpus(); 414 event_scan_delay = 30*HZ/rtas_event_scan_rate;
403 msleep_interruptible(delay); 415
404 get_online_cpus(); 416 if (surveillance_timeout != -1) {
405 417 pr_debug("rtasd: enabling surveillance\n");
406 cpu = next_cpu(cpu, cpu_online_map); 418 enable_surveillance(surveillance_timeout);
407 if (cpu == NR_CPUS) 419 pr_debug("rtasd: surveillance enabled\n");
408 break; 420 }
421 }
409 } 422 }
423
424 schedule_delayed_work_on(cpu, &event_scan_work,
425 __round_jiffies_relative(event_scan_delay, cpu));
426
410 put_online_cpus(); 427 put_online_cpus();
411} 428}
412 429
413static int rtasd(void *unused) 430static void start_event_scan(void)
414{ 431{
415 unsigned int err_type; 432 unsigned int err_type;
416 int rc; 433 int rc;
417 434
418 daemonize("rtasd");
419
420 printk(KERN_DEBUG "RTAS daemon started\n"); 435 printk(KERN_DEBUG "RTAS daemon started\n");
421 pr_debug("rtasd: will sleep for %d milliseconds\n", 436 pr_debug("rtasd: will sleep for %d milliseconds\n",
422 (30000 / rtas_event_scan_rate)); 437 (30000 / rtas_event_scan_rate));
@@ -434,22 +449,8 @@ static int rtasd(void *unused)
434 } 449 }
435 } 450 }
436 451
437 /* First pass. */ 452 schedule_delayed_work_on(first_cpu(cpu_online_map), &event_scan_work,
438 do_event_scan_all_cpus(1000); 453 event_scan_delay);
439
440 if (surveillance_timeout != -1) {
441 pr_debug("rtasd: enabling surveillance\n");
442 enable_surveillance(surveillance_timeout);
443 pr_debug("rtasd: surveillance enabled\n");
444 }
445
446 /* Delay should be at least one second since some
447 * machines have problems if we call event-scan too
448 * quickly. */
449 for (;;)
450 do_event_scan_all_cpus(30000/rtas_event_scan_rate);
451
452 return -EINVAL;
453} 454}
454 455
455static int __init rtas_init(void) 456static int __init rtas_init(void)
@@ -487,8 +488,7 @@ static int __init rtas_init(void)
487 if (!entry) 488 if (!entry)
488 printk(KERN_ERR "Failed to create error_log proc entry\n"); 489 printk(KERN_ERR "Failed to create error_log proc entry\n");
489 490
490 if (kernel_thread(rtasd, NULL, CLONE_FS) < 0) 491 start_event_scan();
491 printk(KERN_ERR "Failed to start RTAS daemon\n");
492 492
493 return 0; 493 return 0;
494} 494}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ec341707e41b..8d75ea21296f 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -63,6 +63,7 @@
63#include <asm/smp.h> 63#include <asm/smp.h>
64#include <asm/firmware.h> 64#include <asm/firmware.h>
65#include <asm/eeh.h> 65#include <asm/eeh.h>
66#include <asm/pSeries_reconfig.h>
66 67
67#include "plpar_wrappers.h" 68#include "plpar_wrappers.h"
68#include "pseries.h" 69#include "pseries.h"
@@ -254,6 +255,29 @@ static void __init pseries_discover_pic(void)
254 " interrupt-controller\n"); 255 " interrupt-controller\n");
255} 256}
256 257
258static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
259{
260 struct device_node *np = node;
261 struct pci_dn *pci = NULL;
262 int err = NOTIFY_OK;
263
264 switch (action) {
265 case PSERIES_RECONFIG_ADD:
266 pci = np->parent->data;
267 if (pci)
268 update_dn_pci_info(np, pci->phb);
269 break;
270 default:
271 err = NOTIFY_DONE;
272 break;
273 }
274 return err;
275}
276
277static struct notifier_block pci_dn_reconfig_nb = {
278 .notifier_call = pci_dn_reconfig_notifier,
279};
280
257static void __init pSeries_setup_arch(void) 281static void __init pSeries_setup_arch(void)
258{ 282{
259 /* Discover PIC type and setup ppc_md accordingly */ 283 /* Discover PIC type and setup ppc_md accordingly */
@@ -271,6 +295,7 @@ static void __init pSeries_setup_arch(void)
271 /* Find and initialize PCI host bridges */ 295 /* Find and initialize PCI host bridges */
272 init_pci_config_tokens(); 296 init_pci_config_tokens();
273 find_and_init_phbs(); 297 find_and_init_phbs();
298 pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
274 eeh_init(); 299 eeh_init();
275 300
276 pSeries_nvram_init(); 301 pSeries_nvram_init();