diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r-- | arch/powerpc/platforms/pseries/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/firmware.h | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/kexec.c | 72 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pci.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pseries.h | 36 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/ras.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/ras.h | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 60 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/smp.c | 1 |
9 files changed, 119 insertions, 83 deletions
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile index 69590fbf83da..dc0583bdbc63 100644 --- a/arch/powerpc/platforms/pseries/Makefile +++ b/arch/powerpc/platforms/pseries/Makefile | |||
@@ -9,6 +9,7 @@ obj-$(CONFIG_SMP) += smp.o | |||
9 | obj-$(CONFIG_XICS) += xics.o | 9 | obj-$(CONFIG_XICS) += xics.o |
10 | obj-$(CONFIG_SCANLOG) += scanlog.o | 10 | obj-$(CONFIG_SCANLOG) += scanlog.o |
11 | obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o | 11 | obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o |
12 | obj-$(CONFIG_KEXEC) += kexec.o | ||
12 | 13 | ||
13 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o | 14 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o |
14 | 15 | ||
diff --git a/arch/powerpc/platforms/pseries/firmware.h b/arch/powerpc/platforms/pseries/firmware.h deleted file mode 100644 index 714f56f55362..000000000000 --- a/arch/powerpc/platforms/pseries/firmware.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2006 IBM Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef _PSERIES_FIRMWARE_H | ||
11 | #define _PSERIES_FIRMWARE_H | ||
12 | |||
13 | #include <asm/firmware.h> | ||
14 | |||
15 | extern void __init fw_feature_init(void); | ||
16 | |||
17 | #endif /* _PSERIES_FIRMWARE_H */ | ||
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c new file mode 100644 index 000000000000..af2685607458 --- /dev/null +++ b/arch/powerpc/platforms/pseries/kexec.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Copyright 2006 Michael Ellerman, IBM Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #include <asm/machdep.h> | ||
11 | #include <asm/page.h> | ||
12 | #include <asm/firmware.h> | ||
13 | #include <asm/kexec.h> | ||
14 | #include <asm/mpic.h> | ||
15 | |||
16 | #include "pseries.h" | ||
17 | #include "xics.h" | ||
18 | #include "plpar_wrappers.h" | ||
19 | |||
20 | static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) | ||
21 | { | ||
22 | /* Don't risk a hypervisor call if we're crashing */ | ||
23 | if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { | ||
24 | unsigned long addr; | ||
25 | |||
26 | addr = __pa(get_slb_shadow()); | ||
27 | if (unregister_slb_shadow(hard_smp_processor_id(), addr)) | ||
28 | printk("SLB shadow buffer deregistration of " | ||
29 | "cpu %u (hw_cpu_id %d) failed\n", | ||
30 | smp_processor_id(), | ||
31 | hard_smp_processor_id()); | ||
32 | |||
33 | addr = __pa(get_lppaca()); | ||
34 | if (unregister_vpa(hard_smp_processor_id(), addr)) { | ||
35 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " | ||
36 | "failed\n", smp_processor_id(), | ||
37 | hard_smp_processor_id()); | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
42 | static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary) | ||
43 | { | ||
44 | pseries_kexec_cpu_down(crash_shutdown, secondary); | ||
45 | mpic_teardown_this_cpu(secondary); | ||
46 | } | ||
47 | |||
48 | void __init setup_kexec_cpu_down_mpic(void) | ||
49 | { | ||
50 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic; | ||
51 | } | ||
52 | |||
53 | static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) | ||
54 | { | ||
55 | pseries_kexec_cpu_down(crash_shutdown, secondary); | ||
56 | xics_teardown_cpu(secondary); | ||
57 | } | ||
58 | |||
59 | void __init setup_kexec_cpu_down_xics(void) | ||
60 | { | ||
61 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; | ||
62 | } | ||
63 | |||
64 | static int __init pseries_kexec_setup(void) | ||
65 | { | ||
66 | ppc_md.machine_kexec = default_machine_kexec; | ||
67 | ppc_md.machine_kexec_prepare = default_machine_kexec_prepare; | ||
68 | ppc_md.machine_crash_shutdown = default_machine_crash_shutdown; | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | __initcall(pseries_kexec_setup); | ||
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index c69bd15ced9c..fa59124ce3fe 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -98,6 +98,10 @@ static void fixup_winbond_82c105(struct pci_dev* dev) | |||
98 | if (dev->resource[i].flags & IORESOURCE_IO | 98 | if (dev->resource[i].flags & IORESOURCE_IO |
99 | && dev->bus->number == 0 && dev->devfn == 0x81) | 99 | && dev->bus->number == 0 && dev->devfn == 0x81) |
100 | dev->resource[i].flags &= ~IORESOURCE_IO; | 100 | dev->resource[i].flags &= ~IORESOURCE_IO; |
101 | if (dev->resource[i].start == 0 && dev->resource[i].end) { | ||
102 | dev->resource[i].flags = 0; | ||
103 | dev->resource[i].end = 0; | ||
104 | } | ||
101 | } | 105 | } |
102 | } | 106 | } |
103 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, | 107 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, |
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h new file mode 100644 index 000000000000..b43f1397a5b6 --- /dev/null +++ b/arch/powerpc/platforms/pseries/pseries.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Copyright 2006 IBM Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef _PSERIES_PSERIES_H | ||
11 | #define _PSERIES_PSERIES_H | ||
12 | |||
13 | extern void __init fw_feature_init(void); | ||
14 | |||
15 | struct pt_regs; | ||
16 | |||
17 | extern int pSeries_system_reset_exception(struct pt_regs *regs); | ||
18 | extern int pSeries_machine_check_exception(struct pt_regs *regs); | ||
19 | |||
20 | #ifdef CONFIG_SMP | ||
21 | extern void smp_init_pseries_mpic(void); | ||
22 | extern void smp_init_pseries_xics(void); | ||
23 | #else | ||
24 | static inline smp_init_pseries_mpic(void) { }; | ||
25 | static inline smp_init_pseries_xics(void) { }; | ||
26 | #endif | ||
27 | |||
28 | #ifdef CONFIG_KEXEC | ||
29 | extern void setup_kexec_cpu_down_xics(void); | ||
30 | extern void setup_kexec_cpu_down_mpic(void); | ||
31 | #else | ||
32 | static inline setup_kexec_cpu_down_xics(void) { }; | ||
33 | static inline setup_kexec_cpu_down_mpic(void) { }; | ||
34 | #endif | ||
35 | |||
36 | #endif /* _PSERIES_PSERIES_H */ | ||
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index b1d3d161249e..edc038873113 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <asm/udbg.h> | 51 | #include <asm/udbg.h> |
52 | #include <asm/firmware.h> | 52 | #include <asm/firmware.h> |
53 | 53 | ||
54 | #include "ras.h" | 54 | #include "pseries.h" |
55 | 55 | ||
56 | static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; | 56 | static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; |
57 | static DEFINE_SPINLOCK(ras_log_buf_lock); | 57 | static DEFINE_SPINLOCK(ras_log_buf_lock); |
diff --git a/arch/powerpc/platforms/pseries/ras.h b/arch/powerpc/platforms/pseries/ras.h deleted file mode 100644 index 0e66b0da55e2..000000000000 --- a/arch/powerpc/platforms/pseries/ras.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _PSERIES_RAS_H | ||
2 | #define _PSERIES_RAS_H | ||
3 | |||
4 | struct pt_regs; | ||
5 | |||
6 | extern int pSeries_system_reset_exception(struct pt_regs *regs); | ||
7 | extern int pSeries_machine_check_exception(struct pt_regs *regs); | ||
8 | |||
9 | #endif /* _PSERIES_RAS_H */ | ||
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 042ecae107ac..435a04596526 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -55,7 +55,6 @@ | |||
55 | #include <asm/dma.h> | 55 | #include <asm/dma.h> |
56 | #include <asm/machdep.h> | 56 | #include <asm/machdep.h> |
57 | #include <asm/irq.h> | 57 | #include <asm/irq.h> |
58 | #include <asm/kexec.h> | ||
59 | #include <asm/time.h> | 58 | #include <asm/time.h> |
60 | #include <asm/nvram.h> | 59 | #include <asm/nvram.h> |
61 | #include "xics.h" | 60 | #include "xics.h" |
@@ -65,10 +64,10 @@ | |||
65 | #include <asm/i8259.h> | 64 | #include <asm/i8259.h> |
66 | #include <asm/udbg.h> | 65 | #include <asm/udbg.h> |
67 | #include <asm/smp.h> | 66 | #include <asm/smp.h> |
67 | #include <asm/firmware.h> | ||
68 | 68 | ||
69 | #include "plpar_wrappers.h" | 69 | #include "plpar_wrappers.h" |
70 | #include "ras.h" | 70 | #include "pseries.h" |
71 | #include "firmware.h" | ||
72 | 71 | ||
73 | #ifdef DEBUG | 72 | #ifdef DEBUG |
74 | #define DBG(fmt...) udbg_printf(fmt) | 73 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -77,8 +76,6 @@ | |||
77 | #endif | 76 | #endif |
78 | 77 | ||
79 | /* move those away to a .h */ | 78 | /* move those away to a .h */ |
80 | extern void smp_init_pseries_mpic(void); | ||
81 | extern void smp_init_pseries_xics(void); | ||
82 | extern void find_udbg_vterm(void); | 79 | extern void find_udbg_vterm(void); |
83 | 80 | ||
84 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ | 81 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ |
@@ -221,42 +218,6 @@ static void pseries_lpar_enable_pmcs(void) | |||
221 | get_lppaca()->pmcregs_in_use = 1; | 218 | get_lppaca()->pmcregs_in_use = 1; |
222 | } | 219 | } |
223 | 220 | ||
224 | #ifdef CONFIG_KEXEC | ||
225 | static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) | ||
226 | { | ||
227 | /* Don't risk a hypervisor call if we're crashing */ | ||
228 | if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { | ||
229 | unsigned long addr; | ||
230 | |||
231 | addr = __pa(get_slb_shadow()); | ||
232 | if (unregister_slb_shadow(hard_smp_processor_id(), addr)) | ||
233 | printk("SLB shadow buffer deregistration of " | ||
234 | "cpu %u (hw_cpu_id %d) failed\n", | ||
235 | smp_processor_id(), | ||
236 | hard_smp_processor_id()); | ||
237 | |||
238 | addr = __pa(get_lppaca()); | ||
239 | if (unregister_vpa(hard_smp_processor_id(), addr)) { | ||
240 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " | ||
241 | "failed\n", smp_processor_id(), | ||
242 | hard_smp_processor_id()); | ||
243 | } | ||
244 | } | ||
245 | } | ||
246 | |||
247 | static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary) | ||
248 | { | ||
249 | pseries_kexec_cpu_down(crash_shutdown, secondary); | ||
250 | mpic_teardown_this_cpu(secondary); | ||
251 | } | ||
252 | |||
253 | static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) | ||
254 | { | ||
255 | pseries_kexec_cpu_down(crash_shutdown, secondary); | ||
256 | xics_teardown_cpu(secondary); | ||
257 | } | ||
258 | #endif /* CONFIG_KEXEC */ | ||
259 | |||
260 | static void __init pseries_discover_pic(void) | 221 | static void __init pseries_discover_pic(void) |
261 | { | 222 | { |
262 | struct device_node *np; | 223 | struct device_node *np; |
@@ -269,21 +230,13 @@ static void __init pseries_discover_pic(void) | |||
269 | pSeries_mpic_node = of_node_get(np); | 230 | pSeries_mpic_node = of_node_get(np); |
270 | ppc_md.init_IRQ = pseries_mpic_init_IRQ; | 231 | ppc_md.init_IRQ = pseries_mpic_init_IRQ; |
271 | ppc_md.get_irq = mpic_get_irq; | 232 | ppc_md.get_irq = mpic_get_irq; |
272 | #ifdef CONFIG_KEXEC | 233 | setup_kexec_cpu_down_mpic(); |
273 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic; | ||
274 | #endif | ||
275 | #ifdef CONFIG_SMP | ||
276 | smp_init_pseries_mpic(); | 234 | smp_init_pseries_mpic(); |
277 | #endif | ||
278 | return; | 235 | return; |
279 | } else if (strstr(typep, "ppc-xicp")) { | 236 | } else if (strstr(typep, "ppc-xicp")) { |
280 | ppc_md.init_IRQ = xics_init_IRQ; | 237 | ppc_md.init_IRQ = xics_init_IRQ; |
281 | #ifdef CONFIG_KEXEC | 238 | setup_kexec_cpu_down_xics(); |
282 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; | ||
283 | #endif | ||
284 | #ifdef CONFIG_SMP | ||
285 | smp_init_pseries_xics(); | 239 | smp_init_pseries_xics(); |
286 | #endif | ||
287 | return; | 240 | return; |
288 | } | 241 | } |
289 | } | 242 | } |
@@ -554,9 +507,4 @@ define_machine(pseries) { | |||
554 | .check_legacy_ioport = pSeries_check_legacy_ioport, | 507 | .check_legacy_ioport = pSeries_check_legacy_ioport, |
555 | .system_reset_exception = pSeries_system_reset_exception, | 508 | .system_reset_exception = pSeries_system_reset_exception, |
556 | .machine_check_exception = pSeries_machine_check_exception, | 509 | .machine_check_exception = pSeries_machine_check_exception, |
557 | #ifdef CONFIG_KEXEC | ||
558 | .machine_kexec = default_machine_kexec, | ||
559 | .machine_kexec_prepare = default_machine_kexec_prepare, | ||
560 | .machine_crash_shutdown = default_machine_crash_shutdown, | ||
561 | #endif | ||
562 | }; | 510 | }; |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 4408518eaebe..116305b22a2b 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <asm/vdso_datapage.h> | 48 | #include <asm/vdso_datapage.h> |
49 | 49 | ||
50 | #include "plpar_wrappers.h" | 50 | #include "plpar_wrappers.h" |
51 | #include "pseries.h" | ||
51 | 52 | ||
52 | #ifdef DEBUG | 53 | #ifdef DEBUG |
53 | #include <asm/udbg.h> | 54 | #include <asm/udbg.h> |