diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 01:59:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 01:59:39 -0400 |
commit | 184475029a724b6b900d88fc3a5f462a6107d5af (patch) | |
tree | 408320b46df221a2424bf94282b1b8e5b7aff7a1 /arch/powerpc/platforms | |
parent | 3b76eefe0f970c2e19f165d4a1650abc523d10bc (diff) | |
parent | f1f4ee01c0d3dce0e3aa7d04e4332677db7af478 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits)
drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
powerpc/85xx: fix mpic configuration in CAMP mode
powerpc: Copy back TIF flags on return from softirq stack
powerpc/64: Make server perfmon only built on ppc64 server devices
powerpc/pseries: Fix hvc_vio.c build due to recent changes
powerpc: Exporting boot_cpuid_phys
powerpc: Add CFAR to oops output
hvc_console: Add kdb support
powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon
powerpc/irq: Quieten irq mapping printks
powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
powerpc: Disable IRQs off tracer in ppc64 defconfig
powerpc: Sync pseries and ppc64 defconfigs
powerpc/pseries/hvconsole: Fix dropped console output
hvc_console: Improve tty/console put_chars handling
powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
powerpc/mm: Fix output of total_ram.
powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
powerpc: Correct annotations of pmu registration functions
...
Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and
drivers/cpufreq
Diffstat (limited to 'arch/powerpc/platforms')
30 files changed, 663 insertions, 370 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index b6976e1726e4..498534cd5265 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
@@ -67,6 +67,16 @@ config MPC85xx_RDB | |||
67 | help | 67 | help |
68 | This option enables support for the MPC85xx RDB (P2020 RDB) board | 68 | This option enables support for the MPC85xx RDB (P2020 RDB) board |
69 | 69 | ||
70 | config P1010_RDB | ||
71 | bool "Freescale P1010RDB" | ||
72 | select DEFAULT_UIMAGE | ||
73 | help | ||
74 | This option enables support for the MPC85xx RDB (P1010 RDB) board | ||
75 | |||
76 | P1010RDB contains P1010Si, which provides CPU performance up to 800 | ||
77 | MHz and 1600 DMIPS, additional functionality and faster interfaces | ||
78 | (DDR3/3L, SATA II, and PCI Express). | ||
79 | |||
70 | config P1022_DS | 80 | config P1022_DS |
71 | bool "Freescale P1022 DS" | 81 | bool "Freescale P1022 DS" |
72 | select DEFAULT_UIMAGE | 82 | select DEFAULT_UIMAGE |
@@ -75,6 +85,12 @@ config P1022_DS | |||
75 | help | 85 | help |
76 | This option enables support for the Freescale P1022DS reference board. | 86 | This option enables support for the Freescale P1022DS reference board. |
77 | 87 | ||
88 | config P1023_RDS | ||
89 | bool "Freescale P1023 RDS" | ||
90 | select DEFAULT_UIMAGE | ||
91 | help | ||
92 | This option enables support for the P1023 RDS board | ||
93 | |||
78 | config SOCRATES | 94 | config SOCRATES |
79 | bool "Socrates" | 95 | bool "Socrates" |
80 | select DEFAULT_UIMAGE | 96 | select DEFAULT_UIMAGE |
@@ -155,6 +171,18 @@ config SBC8560 | |||
155 | help | 171 | help |
156 | This option enables support for the Wind River SBC8560 board | 172 | This option enables support for the Wind River SBC8560 board |
157 | 173 | ||
174 | config P2040_RDB | ||
175 | bool "Freescale P2040 RDB" | ||
176 | select DEFAULT_UIMAGE | ||
177 | select PPC_E500MC | ||
178 | select PHYS_64BIT | ||
179 | select SWIOTLB | ||
180 | select MPC8xxx_GPIO | ||
181 | select HAS_RAPIDIO | ||
182 | select PPC_EPAPR_HV_PIC | ||
183 | help | ||
184 | This option enables support for the P2040 RDB board | ||
185 | |||
158 | config P3041_DS | 186 | config P3041_DS |
159 | bool "Freescale P3041 DS" | 187 | bool "Freescale P3041 DS" |
160 | select DEFAULT_UIMAGE | 188 | select DEFAULT_UIMAGE |
@@ -163,6 +191,7 @@ config P3041_DS | |||
163 | select SWIOTLB | 191 | select SWIOTLB |
164 | select MPC8xxx_GPIO | 192 | select MPC8xxx_GPIO |
165 | select HAS_RAPIDIO | 193 | select HAS_RAPIDIO |
194 | select PPC_EPAPR_HV_PIC | ||
166 | help | 195 | help |
167 | This option enables support for the P3041 DS board | 196 | This option enables support for the P3041 DS board |
168 | 197 | ||
@@ -174,6 +203,7 @@ config P4080_DS | |||
174 | select SWIOTLB | 203 | select SWIOTLB |
175 | select MPC8xxx_GPIO | 204 | select MPC8xxx_GPIO |
176 | select HAS_RAPIDIO | 205 | select HAS_RAPIDIO |
206 | select PPC_EPAPR_HV_PIC | ||
177 | help | 207 | help |
178 | This option enables support for the P4080 DS board | 208 | This option enables support for the P4080 DS board |
179 | 209 | ||
@@ -188,6 +218,7 @@ config P5020_DS | |||
188 | select SWIOTLB | 218 | select SWIOTLB |
189 | select MPC8xxx_GPIO | 219 | select MPC8xxx_GPIO |
190 | select HAS_RAPIDIO | 220 | select HAS_RAPIDIO |
221 | select PPC_EPAPR_HV_PIC | ||
191 | help | 222 | help |
192 | This option enables support for the P5020 DS board | 223 | This option enables support for the P5020 DS board |
193 | 224 | ||
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index dd70db77d63e..a971b32c5c0a 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -10,7 +10,10 @@ obj-$(CONFIG_MPC8536_DS) += mpc8536_ds.o | |||
10 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o | 10 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o |
11 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o | 11 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o |
12 | obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o | 12 | obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o |
13 | obj-$(CONFIG_P1010_RDB) += p1010rdb.o | ||
13 | obj-$(CONFIG_P1022_DS) += p1022_ds.o | 14 | obj-$(CONFIG_P1022_DS) += p1022_ds.o |
15 | obj-$(CONFIG_P1023_RDS) += p1023_rds.o | ||
16 | obj-$(CONFIG_P2040_RDB) += p2040_rdb.o corenet_ds.o | ||
14 | obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o | 17 | obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o |
15 | obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o | 18 | obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o |
16 | obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o | 19 | obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o |
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index 2ab338c9ac37..802ad110b757 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Maintained by Kumar Gala (see MAINTAINERS for contact information) | 4 | * Maintained by Kumar Gala (see MAINTAINERS for contact information) |
5 | * | 5 | * |
6 | * Copyright 2009 Freescale Semiconductor Inc. | 6 | * Copyright 2009-2011 Freescale Semiconductor Inc. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
9 | * under the terms of the GNU General Public License as published by the | 9 | * under the terms of the GNU General Public License as published by the |
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/time.h> | 22 | #include <asm/time.h> |
23 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
24 | #include <asm/pci-bridge.h> | 24 | #include <asm/pci-bridge.h> |
25 | #include <asm/ppc-pci.h> | ||
25 | #include <mm/mmu_decl.h> | 26 | #include <mm/mmu_decl.h> |
26 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
27 | #include <asm/udbg.h> | 28 | #include <asm/udbg.h> |
@@ -61,10 +62,6 @@ void __init corenet_ds_pic_init(void) | |||
61 | mpic_init(mpic); | 62 | mpic_init(mpic); |
62 | } | 63 | } |
63 | 64 | ||
64 | #ifdef CONFIG_PCI | ||
65 | static int primary_phb_addr; | ||
66 | #endif | ||
67 | |||
68 | /* | 65 | /* |
69 | * Setup the architecture | 66 | * Setup the architecture |
70 | */ | 67 | */ |
@@ -85,18 +82,19 @@ void __init corenet_ds_setup_arch(void) | |||
85 | #endif | 82 | #endif |
86 | 83 | ||
87 | #ifdef CONFIG_PCI | 84 | #ifdef CONFIG_PCI |
88 | for_each_compatible_node(np, "pci", "fsl,p4080-pcie") { | 85 | for_each_node_by_type(np, "pci") { |
89 | struct resource rsrc; | 86 | if (of_device_is_compatible(np, "fsl,p4080-pcie") || |
90 | of_address_to_resource(np, 0, &rsrc); | 87 | of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) { |
91 | if ((rsrc.start & 0xfffff) == primary_phb_addr) | ||
92 | fsl_add_bridge(np, 1); | ||
93 | else | ||
94 | fsl_add_bridge(np, 0); | 88 | fsl_add_bridge(np, 0); |
95 | 89 | hose = pci_find_hose_for_OF_device(np); | |
96 | hose = pci_find_hose_for_OF_device(np); | 90 | max = min(max, hose->dma_window_base_cur + |
97 | max = min(max, hose->dma_window_base_cur + | 91 | hose->dma_window_size); |
98 | hose->dma_window_size); | 92 | } |
99 | } | 93 | } |
94 | |||
95 | #ifdef CONFIG_PPC64 | ||
96 | pci_devs_phb_init(); | ||
97 | #endif | ||
100 | #endif | 98 | #endif |
101 | 99 | ||
102 | #ifdef CONFIG_SWIOTLB | 100 | #ifdef CONFIG_SWIOTLB |
@@ -116,6 +114,19 @@ static const struct of_device_id of_device_ids[] __devinitconst = { | |||
116 | { | 114 | { |
117 | .compatible = "fsl,rapidio-delta", | 115 | .compatible = "fsl,rapidio-delta", |
118 | }, | 116 | }, |
117 | { | ||
118 | .compatible = "fsl,p4080-pcie", | ||
119 | }, | ||
120 | { | ||
121 | .compatible = "fsl,qoriq-pcie-v2.2", | ||
122 | }, | ||
123 | /* The following two are for the Freescale hypervisor */ | ||
124 | { | ||
125 | .name = "hypervisor", | ||
126 | }, | ||
127 | { | ||
128 | .name = "handles", | ||
129 | }, | ||
119 | {} | 130 | {} |
120 | }; | 131 | }; |
121 | 132 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index c7b97f70312e..1b9a8cf1873a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -83,7 +83,8 @@ void __init mpc85xx_ds_pic_init(void) | |||
83 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { | 83 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { |
84 | mpic = mpic_alloc(np, r.start, | 84 | mpic = mpic_alloc(np, r.start, |
85 | MPIC_PRIMARY | | 85 | MPIC_PRIMARY | |
86 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 86 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
87 | MPIC_SINGLE_DEST_CPU, | ||
87 | 0, 256, " OpenPIC "); | 88 | 0, 256, " OpenPIC "); |
88 | } else { | 89 | } else { |
89 | mpic = mpic_alloc(np, r.start, | 90 | mpic = mpic_alloc(np, r.start, |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 088f30b0c088..f5ff9110c97e 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -58,10 +58,11 @@ void __init mpc85xx_rdb_pic_init(void) | |||
58 | return; | 58 | return; |
59 | } | 59 | } |
60 | 60 | ||
61 | if (of_flat_dt_is_compatible(root, "fsl,85XXRDB-CAMP")) { | 61 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { |
62 | mpic = mpic_alloc(np, r.start, | 62 | mpic = mpic_alloc(np, r.start, |
63 | MPIC_PRIMARY | | 63 | MPIC_PRIMARY | |
64 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 64 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
65 | MPIC_SINGLE_DEST_CPU, | ||
65 | 0, 256, " OpenPIC "); | 66 | 0, 256, " OpenPIC "); |
66 | } else { | 67 | } else { |
67 | mpic = mpic_alloc(np, r.start, | 68 | mpic = mpic_alloc(np, r.start, |
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c new file mode 100644 index 000000000000..d7387fa7f534 --- /dev/null +++ b/arch/powerpc/platforms/85xx/p1010rdb.c | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * P1010RDB Board Setup | ||
3 | * | ||
4 | * Copyright 2011 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/stddef.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/pci.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/of_platform.h> | ||
18 | |||
19 | #include <asm/system.h> | ||
20 | #include <asm/time.h> | ||
21 | #include <asm/machdep.h> | ||
22 | #include <asm/pci-bridge.h> | ||
23 | #include <mm/mmu_decl.h> | ||
24 | #include <asm/prom.h> | ||
25 | #include <asm/udbg.h> | ||
26 | #include <asm/mpic.h> | ||
27 | |||
28 | #include <sysdev/fsl_soc.h> | ||
29 | #include <sysdev/fsl_pci.h> | ||
30 | |||
31 | void __init p1010_rdb_pic_init(void) | ||
32 | { | ||
33 | struct mpic *mpic; | ||
34 | struct resource r; | ||
35 | struct device_node *np; | ||
36 | |||
37 | np = of_find_node_by_type(NULL, "open-pic"); | ||
38 | if (np == NULL) { | ||
39 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | if (of_address_to_resource(np, 0, &r)) { | ||
44 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
45 | of_node_put(np); | ||
46 | return; | ||
47 | } | ||
48 | |||
49 | mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
50 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | ||
51 | 0, 256, " OpenPIC "); | ||
52 | |||
53 | BUG_ON(mpic == NULL); | ||
54 | of_node_put(np); | ||
55 | |||
56 | mpic_init(mpic); | ||
57 | |||
58 | } | ||
59 | |||
60 | |||
61 | /* | ||
62 | * Setup the architecture | ||
63 | */ | ||
64 | static void __init p1010_rdb_setup_arch(void) | ||
65 | { | ||
66 | #ifdef CONFIG_PCI | ||
67 | struct device_node *np; | ||
68 | #endif | ||
69 | |||
70 | if (ppc_md.progress) | ||
71 | ppc_md.progress("p1010_rdb_setup_arch()", 0); | ||
72 | |||
73 | #ifdef CONFIG_PCI | ||
74 | for_each_node_by_type(np, "pci") { | ||
75 | if (of_device_is_compatible(np, "fsl,p1010-pcie")) | ||
76 | fsl_add_bridge(np, 0); | ||
77 | } | ||
78 | |||
79 | #endif | ||
80 | |||
81 | printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n"); | ||
82 | } | ||
83 | |||
84 | static struct of_device_id __initdata p1010rdb_ids[] = { | ||
85 | { .type = "soc", }, | ||
86 | { .compatible = "soc", }, | ||
87 | { .compatible = "simple-bus", }, | ||
88 | {}, | ||
89 | }; | ||
90 | |||
91 | static int __init p1010rdb_publish_devices(void) | ||
92 | { | ||
93 | return of_platform_bus_probe(NULL, p1010rdb_ids, NULL); | ||
94 | } | ||
95 | machine_device_initcall(p1010_rdb, p1010rdb_publish_devices); | ||
96 | machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); | ||
97 | |||
98 | /* | ||
99 | * Called very early, device-tree isn't unflattened | ||
100 | */ | ||
101 | static int __init p1010_rdb_probe(void) | ||
102 | { | ||
103 | unsigned long root = of_get_flat_dt_root(); | ||
104 | |||
105 | if (of_flat_dt_is_compatible(root, "fsl,P1010RDB")) | ||
106 | return 1; | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | define_machine(p1010_rdb) { | ||
111 | .name = "P1010 RDB", | ||
112 | .probe = p1010_rdb_probe, | ||
113 | .setup_arch = p1010_rdb_setup_arch, | ||
114 | .init_IRQ = p1010_rdb_pic_init, | ||
115 | #ifdef CONFIG_PCI | ||
116 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
117 | #endif | ||
118 | .get_irq = mpic_get_irq, | ||
119 | .restart = fsl_rstcr_restart, | ||
120 | .calibrate_decr = generic_calibrate_decr, | ||
121 | .progress = udbg_progress, | ||
122 | }; | ||
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 7eb5c40c069f..266b3aadfe5e 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -129,6 +129,7 @@ static void p1022ds_set_gamma_table(int monitor_port, char *gamma_table_base) | |||
129 | static void p1022ds_set_monitor_port(int monitor_port) | 129 | static void p1022ds_set_monitor_port(int monitor_port) |
130 | { | 130 | { |
131 | struct device_node *pixis_node; | 131 | struct device_node *pixis_node; |
132 | void __iomem *pixis; | ||
132 | u8 __iomem *brdcfg1; | 133 | u8 __iomem *brdcfg1; |
133 | 134 | ||
134 | pixis_node = of_find_compatible_node(NULL, NULL, "fsl,p1022ds-pixis"); | 135 | pixis_node = of_find_compatible_node(NULL, NULL, "fsl,p1022ds-pixis"); |
@@ -137,12 +138,12 @@ static void p1022ds_set_monitor_port(int monitor_port) | |||
137 | return; | 138 | return; |
138 | } | 139 | } |
139 | 140 | ||
140 | brdcfg1 = of_iomap(pixis_node, 0); | 141 | pixis = of_iomap(pixis_node, 0); |
141 | if (!brdcfg1) { | 142 | if (!pixis) { |
142 | pr_err("p1022ds: could not map ngPIXIS registers\n"); | 143 | pr_err("p1022ds: could not map ngPIXIS registers\n"); |
143 | return; | 144 | return; |
144 | } | 145 | } |
145 | brdcfg1 += 9; /* BRDCFG1 is at offset 9 in the ngPIXIS */ | 146 | brdcfg1 = pixis + 9; /* BRDCFG1 is at offset 9 in the ngPIXIS */ |
146 | 147 | ||
147 | switch (monitor_port) { | 148 | switch (monitor_port) { |
148 | case 0: /* DVI */ | 149 | case 0: /* DVI */ |
@@ -158,6 +159,8 @@ static void p1022ds_set_monitor_port(int monitor_port) | |||
158 | default: | 159 | default: |
159 | pr_err("p1022ds: unsupported monitor port %i\n", monitor_port); | 160 | pr_err("p1022ds: unsupported monitor port %i\n", monitor_port); |
160 | } | 161 | } |
162 | |||
163 | iounmap(pixis); | ||
161 | } | 164 | } |
162 | 165 | ||
163 | /** | 166 | /** |
@@ -192,8 +195,13 @@ void p1022ds_set_pixel_clock(unsigned int pixclock) | |||
192 | do_div(temp, pixclock); | 195 | do_div(temp, pixclock); |
193 | freq = temp; | 196 | freq = temp; |
194 | 197 | ||
195 | /* pixclk is the ratio of the platform clock to the pixel clock */ | 198 | /* |
199 | * 'pxclk' is the ratio of the platform clock to the pixel clock. | ||
200 | * This number is programmed into the CLKDVDR register, and the valid | ||
201 | * range of values is 2-255. | ||
202 | */ | ||
196 | pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq); | 203 | pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq); |
204 | pxclk = clamp_t(u32, pxclk, 2, 255); | ||
197 | 205 | ||
198 | /* Disable the pixel clock, and set it to non-inverted and no delay */ | 206 | /* Disable the pixel clock, and set it to non-inverted and no delay */ |
199 | clrbits32(&guts->clkdvdr, | 207 | clrbits32(&guts->clkdvdr, |
@@ -201,6 +209,8 @@ void p1022ds_set_pixel_clock(unsigned int pixclock) | |||
201 | 209 | ||
202 | /* Enable the clock and set the pxclk */ | 210 | /* Enable the clock and set the pxclk */ |
203 | setbits32(&guts->clkdvdr, CLKDVDR_PXCKEN | (pxclk << 16)); | 211 | setbits32(&guts->clkdvdr, CLKDVDR_PXCKEN | (pxclk << 16)); |
212 | |||
213 | iounmap(guts); | ||
204 | } | 214 | } |
205 | 215 | ||
206 | /** | 216 | /** |
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c new file mode 100644 index 000000000000..835e0b335bfa --- /dev/null +++ b/arch/powerpc/platforms/85xx/p1023_rds.c | |||
@@ -0,0 +1,162 @@ | |||
1 | /* | ||
2 | * Copyright 2010-2011 Freescale Semiconductor, Inc. | ||
3 | * | ||
4 | * Author: Roy Zang <tie-fei.zang@freescale.com> | ||
5 | * | ||
6 | * Description: | ||
7 | * P1023 RDS Board Setup | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/pci.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/fsl_devices.h> | ||
22 | #include <linux/of_platform.h> | ||
23 | #include <linux/of_device.h> | ||
24 | |||
25 | #include <asm/system.h> | ||
26 | #include <asm/time.h> | ||
27 | #include <asm/machdep.h> | ||
28 | #include <asm/pci-bridge.h> | ||
29 | #include <mm/mmu_decl.h> | ||
30 | #include <asm/prom.h> | ||
31 | #include <asm/udbg.h> | ||
32 | #include <asm/mpic.h> | ||
33 | |||
34 | #include <sysdev/fsl_soc.h> | ||
35 | #include <sysdev/fsl_pci.h> | ||
36 | |||
37 | /* ************************************************************************ | ||
38 | * | ||
39 | * Setup the architecture | ||
40 | * | ||
41 | */ | ||
42 | #ifdef CONFIG_SMP | ||
43 | void __init mpc85xx_smp_init(void); | ||
44 | #endif | ||
45 | |||
46 | static void __init mpc85xx_rds_setup_arch(void) | ||
47 | { | ||
48 | struct device_node *np; | ||
49 | |||
50 | if (ppc_md.progress) | ||
51 | ppc_md.progress("p1023_rds_setup_arch()", 0); | ||
52 | |||
53 | /* Map BCSR area */ | ||
54 | np = of_find_node_by_name(NULL, "bcsr"); | ||
55 | if (np != NULL) { | ||
56 | static u8 __iomem *bcsr_regs; | ||
57 | |||
58 | bcsr_regs = of_iomap(np, 0); | ||
59 | of_node_put(np); | ||
60 | |||
61 | if (!bcsr_regs) { | ||
62 | printk(KERN_ERR | ||
63 | "BCSR: Failed to map bcsr register space\n"); | ||
64 | return; | ||
65 | } else { | ||
66 | #define BCSR15_I2C_BUS0_SEG_CLR 0x07 | ||
67 | #define BCSR15_I2C_BUS0_SEG2 0x02 | ||
68 | /* | ||
69 | * Note: Accessing exclusively i2c devices. | ||
70 | * | ||
71 | * The i2c controller selects initially ID EEPROM in the u-boot; | ||
72 | * but if menu configuration selects RTC support in the kernel, | ||
73 | * the i2c controller switches to select RTC chip in the kernel. | ||
74 | */ | ||
75 | #ifdef CONFIG_RTC_CLASS | ||
76 | /* Enable RTC chip on the segment #2 of i2c */ | ||
77 | clrbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG_CLR); | ||
78 | setbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG2); | ||
79 | #endif | ||
80 | |||
81 | iounmap(bcsr_regs); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | #ifdef CONFIG_PCI | ||
86 | for_each_compatible_node(np, "pci", "fsl,p1023-pcie") | ||
87 | fsl_add_bridge(np, 0); | ||
88 | #endif | ||
89 | |||
90 | #ifdef CONFIG_SMP | ||
91 | mpc85xx_smp_init(); | ||
92 | #endif | ||
93 | } | ||
94 | |||
95 | static struct of_device_id p1023_ids[] = { | ||
96 | { .type = "soc", }, | ||
97 | { .compatible = "soc", }, | ||
98 | { .compatible = "simple-bus", }, | ||
99 | {}, | ||
100 | }; | ||
101 | |||
102 | |||
103 | static int __init p1023_publish_devices(void) | ||
104 | { | ||
105 | of_platform_bus_probe(NULL, p1023_ids, NULL); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | machine_device_initcall(p1023_rds, p1023_publish_devices); | ||
111 | |||
112 | static void __init mpc85xx_rds_pic_init(void) | ||
113 | { | ||
114 | struct mpic *mpic; | ||
115 | struct resource r; | ||
116 | struct device_node *np = NULL; | ||
117 | |||
118 | np = of_find_node_by_type(NULL, "open-pic"); | ||
119 | if (!np) { | ||
120 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
121 | return; | ||
122 | } | ||
123 | |||
124 | if (of_address_to_resource(np, 0, &r)) { | ||
125 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
126 | of_node_put(np); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | mpic = mpic_alloc(np, r.start, | ||
131 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | ||
132 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | ||
133 | 0, 256, " OpenPIC "); | ||
134 | |||
135 | BUG_ON(mpic == NULL); | ||
136 | of_node_put(np); | ||
137 | |||
138 | mpic_init(mpic); | ||
139 | } | ||
140 | |||
141 | static int __init p1023_rds_probe(void) | ||
142 | { | ||
143 | unsigned long root = of_get_flat_dt_root(); | ||
144 | |||
145 | return of_flat_dt_is_compatible(root, "fsl,P1023RDS"); | ||
146 | |||
147 | } | ||
148 | |||
149 | define_machine(p1023_rds) { | ||
150 | .name = "P1023 RDS", | ||
151 | .probe = p1023_rds_probe, | ||
152 | .setup_arch = mpc85xx_rds_setup_arch, | ||
153 | .init_IRQ = mpc85xx_rds_pic_init, | ||
154 | .get_irq = mpic_get_irq, | ||
155 | .restart = fsl_rstcr_restart, | ||
156 | .calibrate_decr = generic_calibrate_decr, | ||
157 | .progress = udbg_progress, | ||
158 | #ifdef CONFIG_PCI | ||
159 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
160 | #endif | ||
161 | }; | ||
162 | |||
diff --git a/arch/powerpc/platforms/85xx/p2040_rdb.c b/arch/powerpc/platforms/85xx/p2040_rdb.c new file mode 100644 index 000000000000..32b56ac73dfb --- /dev/null +++ b/arch/powerpc/platforms/85xx/p2040_rdb.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * P2040 RDB Setup | ||
3 | * | ||
4 | * Copyright 2011 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/pci.h> | ||
14 | #include <linux/kdev_t.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/phy.h> | ||
18 | |||
19 | #include <asm/system.h> | ||
20 | #include <asm/time.h> | ||
21 | #include <asm/machdep.h> | ||
22 | #include <asm/pci-bridge.h> | ||
23 | #include <mm/mmu_decl.h> | ||
24 | #include <asm/prom.h> | ||
25 | #include <asm/udbg.h> | ||
26 | #include <asm/mpic.h> | ||
27 | |||
28 | #include <linux/of_platform.h> | ||
29 | #include <sysdev/fsl_soc.h> | ||
30 | #include <sysdev/fsl_pci.h> | ||
31 | #include <asm/ehv_pic.h> | ||
32 | |||
33 | #include "corenet_ds.h" | ||
34 | |||
35 | /* | ||
36 | * Called very early, device-tree isn't unflattened | ||
37 | */ | ||
38 | static int __init p2040_rdb_probe(void) | ||
39 | { | ||
40 | unsigned long root = of_get_flat_dt_root(); | ||
41 | #ifdef CONFIG_SMP | ||
42 | extern struct smp_ops_t smp_85xx_ops; | ||
43 | #endif | ||
44 | |||
45 | if (of_flat_dt_is_compatible(root, "fsl,P2040RDB")) | ||
46 | return 1; | ||
47 | |||
48 | /* Check if we're running under the Freescale hypervisor */ | ||
49 | if (of_flat_dt_is_compatible(root, "fsl,P2040RDB-hv")) { | ||
50 | ppc_md.init_IRQ = ehv_pic_init; | ||
51 | ppc_md.get_irq = ehv_pic_get_irq; | ||
52 | ppc_md.restart = fsl_hv_restart; | ||
53 | ppc_md.power_off = fsl_hv_halt; | ||
54 | ppc_md.halt = fsl_hv_halt; | ||
55 | #ifdef CONFIG_SMP | ||
56 | /* | ||
57 | * Disable the timebase sync operations because we can't write | ||
58 | * to the timebase registers under the hypervisor. | ||
59 | */ | ||
60 | smp_85xx_ops.give_timebase = NULL; | ||
61 | smp_85xx_ops.take_timebase = NULL; | ||
62 | #endif | ||
63 | return 1; | ||
64 | } | ||
65 | |||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | define_machine(p2040_rdb) { | ||
70 | .name = "P2040 RDB", | ||
71 | .probe = p2040_rdb_probe, | ||
72 | .setup_arch = corenet_ds_setup_arch, | ||
73 | .init_IRQ = corenet_ds_pic_init, | ||
74 | #ifdef CONFIG_PCI | ||
75 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
76 | #endif | ||
77 | .get_irq = mpic_get_coreint_irq, | ||
78 | .restart = fsl_rstcr_restart, | ||
79 | .calibrate_decr = generic_calibrate_decr, | ||
80 | .progress = udbg_progress, | ||
81 | .power_save = e500_idle, | ||
82 | }; | ||
83 | |||
84 | machine_device_initcall(p2040_rdb, corenet_ds_publish_devices); | ||
85 | |||
86 | #ifdef CONFIG_SWIOTLB | ||
87 | machine_arch_initcall(p2040_rdb, swiotlb_setup_bus_notifier); | ||
88 | #endif | ||
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c index 0ed52e18298c..96d99a374dcf 100644 --- a/arch/powerpc/platforms/85xx/p3041_ds.c +++ b/arch/powerpc/platforms/85xx/p3041_ds.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/of_platform.h> | 30 | #include <linux/of_platform.h> |
31 | #include <sysdev/fsl_soc.h> | 31 | #include <sysdev/fsl_soc.h> |
32 | #include <sysdev/fsl_pci.h> | 32 | #include <sysdev/fsl_pci.h> |
33 | #include <asm/ehv_pic.h> | ||
33 | 34 | ||
34 | #include "corenet_ds.h" | 35 | #include "corenet_ds.h" |
35 | 36 | ||
@@ -39,8 +40,32 @@ | |||
39 | static int __init p3041_ds_probe(void) | 40 | static int __init p3041_ds_probe(void) |
40 | { | 41 | { |
41 | unsigned long root = of_get_flat_dt_root(); | 42 | unsigned long root = of_get_flat_dt_root(); |
43 | #ifdef CONFIG_SMP | ||
44 | extern struct smp_ops_t smp_85xx_ops; | ||
45 | #endif | ||
46 | |||
47 | if (of_flat_dt_is_compatible(root, "fsl,P3041DS")) | ||
48 | return 1; | ||
49 | |||
50 | /* Check if we're running under the Freescale hypervisor */ | ||
51 | if (of_flat_dt_is_compatible(root, "fsl,P3041DS-hv")) { | ||
52 | ppc_md.init_IRQ = ehv_pic_init; | ||
53 | ppc_md.get_irq = ehv_pic_get_irq; | ||
54 | ppc_md.restart = fsl_hv_restart; | ||
55 | ppc_md.power_off = fsl_hv_halt; | ||
56 | ppc_md.halt = fsl_hv_halt; | ||
57 | #ifdef CONFIG_SMP | ||
58 | /* | ||
59 | * Disable the timebase sync operations because we can't write | ||
60 | * to the timebase registers under the hypervisor. | ||
61 | */ | ||
62 | smp_85xx_ops.give_timebase = NULL; | ||
63 | smp_85xx_ops.take_timebase = NULL; | ||
64 | #endif | ||
65 | return 1; | ||
66 | } | ||
42 | 67 | ||
43 | return of_flat_dt_is_compatible(root, "fsl,P3041DS"); | 68 | return 0; |
44 | } | 69 | } |
45 | 70 | ||
46 | define_machine(p3041_ds) { | 71 | define_machine(p3041_ds) { |
@@ -55,6 +80,7 @@ define_machine(p3041_ds) { | |||
55 | .restart = fsl_rstcr_restart, | 80 | .restart = fsl_rstcr_restart, |
56 | .calibrate_decr = generic_calibrate_decr, | 81 | .calibrate_decr = generic_calibrate_decr, |
57 | .progress = udbg_progress, | 82 | .progress = udbg_progress, |
83 | .power_save = e500_idle, | ||
58 | }; | 84 | }; |
59 | 85 | ||
60 | machine_device_initcall(p3041_ds, corenet_ds_publish_devices); | 86 | machine_device_initcall(p3041_ds, corenet_ds_publish_devices); |
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c index 84170460497b..d1b21d7663e3 100644 --- a/arch/powerpc/platforms/85xx/p4080_ds.c +++ b/arch/powerpc/platforms/85xx/p4080_ds.c | |||
@@ -29,31 +29,42 @@ | |||
29 | #include <linux/of_platform.h> | 29 | #include <linux/of_platform.h> |
30 | #include <sysdev/fsl_soc.h> | 30 | #include <sysdev/fsl_soc.h> |
31 | #include <sysdev/fsl_pci.h> | 31 | #include <sysdev/fsl_pci.h> |
32 | #include <asm/ehv_pic.h> | ||
32 | 33 | ||
33 | #include "corenet_ds.h" | 34 | #include "corenet_ds.h" |
34 | 35 | ||
35 | #ifdef CONFIG_PCI | ||
36 | static int primary_phb_addr; | ||
37 | #endif | ||
38 | |||
39 | /* | 36 | /* |
40 | * Called very early, device-tree isn't unflattened | 37 | * Called very early, device-tree isn't unflattened |
41 | */ | 38 | */ |
42 | static int __init p4080_ds_probe(void) | 39 | static int __init p4080_ds_probe(void) |
43 | { | 40 | { |
44 | unsigned long root = of_get_flat_dt_root(); | 41 | unsigned long root = of_get_flat_dt_root(); |
42 | #ifdef CONFIG_SMP | ||
43 | extern struct smp_ops_t smp_85xx_ops; | ||
44 | #endif | ||
45 | 45 | ||
46 | if (of_flat_dt_is_compatible(root, "fsl,P4080DS")) { | 46 | if (of_flat_dt_is_compatible(root, "fsl,P4080DS")) |
47 | #ifdef CONFIG_PCI | 47 | return 1; |
48 | /* treat PCIe1 as primary, | 48 | |
49 | * shouldn't matter as we have no ISA on the board | 49 | /* Check if we're running under the Freescale hypervisor */ |
50 | */ | 50 | if (of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) { |
51 | primary_phb_addr = 0x0000; | 51 | ppc_md.init_IRQ = ehv_pic_init; |
52 | ppc_md.get_irq = ehv_pic_get_irq; | ||
53 | ppc_md.restart = fsl_hv_restart; | ||
54 | ppc_md.power_off = fsl_hv_halt; | ||
55 | ppc_md.halt = fsl_hv_halt; | ||
56 | #ifdef CONFIG_SMP | ||
57 | /* | ||
58 | * Disable the timebase sync operations because we can't write | ||
59 | * to the timebase registers under the hypervisor. | ||
60 | */ | ||
61 | smp_85xx_ops.give_timebase = NULL; | ||
62 | smp_85xx_ops.take_timebase = NULL; | ||
52 | #endif | 63 | #endif |
53 | return 1; | 64 | return 1; |
54 | } else { | ||
55 | return 0; | ||
56 | } | 65 | } |
66 | |||
67 | return 0; | ||
57 | } | 68 | } |
58 | 69 | ||
59 | define_machine(p4080_ds) { | 70 | define_machine(p4080_ds) { |
@@ -68,7 +79,10 @@ define_machine(p4080_ds) { | |||
68 | .restart = fsl_rstcr_restart, | 79 | .restart = fsl_rstcr_restart, |
69 | .calibrate_decr = generic_calibrate_decr, | 80 | .calibrate_decr = generic_calibrate_decr, |
70 | .progress = udbg_progress, | 81 | .progress = udbg_progress, |
82 | .power_save = e500_idle, | ||
71 | }; | 83 | }; |
72 | 84 | ||
73 | machine_device_initcall(p4080_ds, corenet_ds_publish_devices); | 85 | machine_device_initcall(p4080_ds, corenet_ds_publish_devices); |
86 | #ifdef CONFIG_SWIOTLB | ||
74 | machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier); | 87 | machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier); |
88 | #endif | ||
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c index 7467b712ee00..e8cba5004fd8 100644 --- a/arch/powerpc/platforms/85xx/p5020_ds.c +++ b/arch/powerpc/platforms/85xx/p5020_ds.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/of_platform.h> | 30 | #include <linux/of_platform.h> |
31 | #include <sysdev/fsl_soc.h> | 31 | #include <sysdev/fsl_soc.h> |
32 | #include <sysdev/fsl_pci.h> | 32 | #include <sysdev/fsl_pci.h> |
33 | #include <asm/ehv_pic.h> | ||
33 | 34 | ||
34 | #include "corenet_ds.h" | 35 | #include "corenet_ds.h" |
35 | 36 | ||
@@ -39,8 +40,32 @@ | |||
39 | static int __init p5020_ds_probe(void) | 40 | static int __init p5020_ds_probe(void) |
40 | { | 41 | { |
41 | unsigned long root = of_get_flat_dt_root(); | 42 | unsigned long root = of_get_flat_dt_root(); |
43 | #ifdef CONFIG_SMP | ||
44 | extern struct smp_ops_t smp_85xx_ops; | ||
45 | #endif | ||
46 | |||
47 | if (of_flat_dt_is_compatible(root, "fsl,P5020DS")) | ||
48 | return 1; | ||
49 | |||
50 | /* Check if we're running under the Freescale hypervisor */ | ||
51 | if (of_flat_dt_is_compatible(root, "fsl,P5020DS-hv")) { | ||
52 | ppc_md.init_IRQ = ehv_pic_init; | ||
53 | ppc_md.get_irq = ehv_pic_get_irq; | ||
54 | ppc_md.restart = fsl_hv_restart; | ||
55 | ppc_md.power_off = fsl_hv_halt; | ||
56 | ppc_md.halt = fsl_hv_halt; | ||
57 | #ifdef CONFIG_SMP | ||
58 | /* | ||
59 | * Disable the timebase sync operations because we can't write | ||
60 | * to the timebase registers under the hypervisor. | ||
61 | */ | ||
62 | smp_85xx_ops.give_timebase = NULL; | ||
63 | smp_85xx_ops.take_timebase = NULL; | ||
64 | #endif | ||
65 | return 1; | ||
66 | } | ||
42 | 67 | ||
43 | return of_flat_dt_is_compatible(root, "fsl,P5020DS"); | 68 | return 0; |
44 | } | 69 | } |
45 | 70 | ||
46 | define_machine(p5020_ds) { | 71 | define_machine(p5020_ds) { |
@@ -60,6 +85,11 @@ define_machine(p5020_ds) { | |||
60 | .restart = fsl_rstcr_restart, | 85 | .restart = fsl_rstcr_restart, |
61 | .calibrate_decr = generic_calibrate_decr, | 86 | .calibrate_decr = generic_calibrate_decr, |
62 | .progress = udbg_progress, | 87 | .progress = udbg_progress, |
88 | #ifdef CONFIG_PPC64 | ||
89 | .power_save = book3e_idle, | ||
90 | #else | ||
91 | .power_save = e500_idle, | ||
92 | #endif | ||
63 | }; | 93 | }; |
64 | 94 | ||
65 | machine_device_initcall(p5020_ds, corenet_ds_publish_devices); | 95 | machine_device_initcall(p5020_ds, corenet_ds_publish_devices); |
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index d6a93a10c0f5..5b9b901f6443 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Author: Andy Fleming <afleming@freescale.com> | 2 | * Author: Andy Fleming <afleming@freescale.com> |
3 | * Kumar Gala <galak@kernel.crashing.org> | 3 | * Kumar Gala <galak@kernel.crashing.org> |
4 | * | 4 | * |
5 | * Copyright 2006-2008 Freescale Semiconductor Inc. | 5 | * Copyright 2006-2008, 2011 Freescale Semiconductor Inc. |
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 |
8 | * under the terms of the GNU General Public License as published by the | 8 | * under the terms of the GNU General Public License as published by the |
@@ -111,14 +111,6 @@ smp_85xx_kick_cpu(int nr) | |||
111 | return 0; | 111 | return 0; |
112 | } | 112 | } |
113 | 113 | ||
114 | static void __init | ||
115 | smp_85xx_setup_cpu(int cpu_nr) | ||
116 | { | ||
117 | mpic_setup_this_cpu(); | ||
118 | if (cpu_has_feature(CPU_FTR_DBELL)) | ||
119 | doorbell_setup_this_cpu(); | ||
120 | } | ||
121 | |||
122 | struct smp_ops_t smp_85xx_ops = { | 114 | struct smp_ops_t smp_85xx_ops = { |
123 | .kick_cpu = smp_85xx_kick_cpu, | 115 | .kick_cpu = smp_85xx_kick_cpu, |
124 | #ifdef CONFIG_KEXEC | 116 | #ifdef CONFIG_KEXEC |
@@ -224,24 +216,36 @@ static void mpc85xx_smp_machine_kexec(struct kimage *image) | |||
224 | } | 216 | } |
225 | #endif /* CONFIG_KEXEC */ | 217 | #endif /* CONFIG_KEXEC */ |
226 | 218 | ||
219 | static void __init | ||
220 | smp_85xx_setup_cpu(int cpu_nr) | ||
221 | { | ||
222 | if (smp_85xx_ops.probe == smp_mpic_probe) | ||
223 | mpic_setup_this_cpu(); | ||
224 | |||
225 | if (cpu_has_feature(CPU_FTR_DBELL)) | ||
226 | doorbell_setup_this_cpu(); | ||
227 | } | ||
228 | |||
227 | void __init mpc85xx_smp_init(void) | 229 | void __init mpc85xx_smp_init(void) |
228 | { | 230 | { |
229 | struct device_node *np; | 231 | struct device_node *np; |
230 | 232 | ||
233 | smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; | ||
234 | |||
231 | np = of_find_node_by_type(NULL, "open-pic"); | 235 | np = of_find_node_by_type(NULL, "open-pic"); |
232 | if (np) { | 236 | if (np) { |
233 | smp_85xx_ops.probe = smp_mpic_probe; | 237 | smp_85xx_ops.probe = smp_mpic_probe; |
234 | smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; | ||
235 | smp_85xx_ops.message_pass = smp_mpic_message_pass; | 238 | smp_85xx_ops.message_pass = smp_mpic_message_pass; |
236 | } | 239 | } |
237 | 240 | ||
238 | if (cpu_has_feature(CPU_FTR_DBELL)) { | 241 | if (cpu_has_feature(CPU_FTR_DBELL)) { |
239 | smp_85xx_ops.message_pass = smp_muxed_ipi_message_pass; | 242 | /* |
243 | * If left NULL, .message_pass defaults to | ||
244 | * smp_muxed_ipi_message_pass | ||
245 | */ | ||
240 | smp_85xx_ops.cause_ipi = doorbell_cause_ipi; | 246 | smp_85xx_ops.cause_ipi = doorbell_cause_ipi; |
241 | } | 247 | } |
242 | 248 | ||
243 | BUG_ON(!smp_85xx_ops.message_pass); | ||
244 | |||
245 | smp_ops = &smp_85xx_ops; | 249 | smp_ops = &smp_85xx_ops; |
246 | 250 | ||
247 | #ifdef CONFIG_KEXEC | 251 | #ifdef CONFIG_KEXEC |
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index a896511690c2..74e018ef724b 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c | |||
@@ -39,12 +39,19 @@ | |||
39 | #include <sysdev/fsl_pci.h> | 39 | #include <sysdev/fsl_pci.h> |
40 | #include <sysdev/fsl_soc.h> | 40 | #include <sysdev/fsl_soc.h> |
41 | #include <sysdev/simple_gpio.h> | 41 | #include <sysdev/simple_gpio.h> |
42 | #include <asm/fsl_guts.h> | ||
42 | 43 | ||
43 | #include "mpc86xx.h" | 44 | #include "mpc86xx.h" |
44 | 45 | ||
45 | static struct device_node *pixis_node; | 46 | static struct device_node *pixis_node; |
46 | static unsigned char *pixis_bdcfg0, *pixis_arch; | 47 | static unsigned char *pixis_bdcfg0, *pixis_arch; |
47 | 48 | ||
49 | /* DIU Pixel Clock bits of the CLKDVDR Global Utilities register */ | ||
50 | #define CLKDVDR_PXCKEN 0x80000000 | ||
51 | #define CLKDVDR_PXCKINV 0x10000000 | ||
52 | #define CLKDVDR_PXCKDLY 0x06000000 | ||
53 | #define CLKDVDR_PXCLK_MASK 0x001F0000 | ||
54 | |||
48 | #ifdef CONFIG_SUSPEND | 55 | #ifdef CONFIG_SUSPEND |
49 | static irqreturn_t mpc8610_sw9_irq(int irq, void *data) | 56 | static irqreturn_t mpc8610_sw9_irq(int irq, void *data) |
50 | { | 57 | { |
@@ -205,72 +212,54 @@ void mpc8610hpcd_set_monitor_port(int monitor_port) | |||
205 | bdcfg[monitor_port]); | 212 | bdcfg[monitor_port]); |
206 | } | 213 | } |
207 | 214 | ||
215 | /** | ||
216 | * mpc8610hpcd_set_pixel_clock: program the DIU's clock | ||
217 | * | ||
218 | * @pixclock: the wavelength, in picoseconds, of the clock | ||
219 | */ | ||
208 | void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) | 220 | void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) |
209 | { | 221 | { |
210 | u32 __iomem *clkdvdr; | 222 | struct device_node *guts_np = NULL; |
211 | u32 temp; | 223 | struct ccsr_guts_86xx __iomem *guts; |
212 | /* variables for pixel clock calcs */ | 224 | unsigned long freq; |
213 | ulong bestval, bestfreq, speed_ccb, minpixclock, maxpixclock; | 225 | u64 temp; |
214 | ulong pixval; | 226 | u32 pxclk; |
215 | long err; | 227 | |
216 | int i; | 228 | /* Map the global utilities registers. */ |
217 | 229 | guts_np = of_find_compatible_node(NULL, NULL, "fsl,mpc8610-guts"); | |
218 | clkdvdr = ioremap(get_immrbase() + 0xe0800, sizeof(u32)); | 230 | if (!guts_np) { |
219 | if (!clkdvdr) { | 231 | pr_err("mpc8610hpcd: missing global utilties device node\n"); |
220 | printk(KERN_ERR "Err: can't map clock divider register!\n"); | ||
221 | return; | 232 | return; |
222 | } | 233 | } |
223 | 234 | ||
224 | /* Pixel Clock configuration */ | 235 | guts = of_iomap(guts_np, 0); |
225 | speed_ccb = fsl_get_sys_freq(); | 236 | of_node_put(guts_np); |
226 | 237 | if (!guts) { | |
227 | /* Calculate the pixel clock with the smallest error */ | 238 | pr_err("mpc8610hpcd: could not map global utilties device\n"); |
228 | /* calculate the following in steps to avoid overflow */ | 239 | return; |
229 | pr_debug("DIU pixclock in ps - %d\n", pixclock); | ||
230 | temp = 1000000000/pixclock; | ||
231 | temp *= 1000; | ||
232 | pixclock = temp; | ||
233 | pr_debug("DIU pixclock freq - %u\n", pixclock); | ||
234 | |||
235 | temp = pixclock * 5 / 100; | ||
236 | pr_debug("deviation = %d\n", temp); | ||
237 | minpixclock = pixclock - temp; | ||
238 | maxpixclock = pixclock + temp; | ||
239 | pr_debug("DIU minpixclock - %lu\n", minpixclock); | ||
240 | pr_debug("DIU maxpixclock - %lu\n", maxpixclock); | ||
241 | pixval = speed_ccb/pixclock; | ||
242 | pr_debug("DIU pixval = %lu\n", pixval); | ||
243 | |||
244 | err = 100000000; | ||
245 | bestval = pixval; | ||
246 | pr_debug("DIU bestval = %lu\n", bestval); | ||
247 | |||
248 | bestfreq = 0; | ||
249 | for (i = -1; i <= 1; i++) { | ||
250 | temp = speed_ccb / ((pixval+i) + 1); | ||
251 | pr_debug("DIU test pixval i= %d, pixval=%lu, temp freq. = %u\n", | ||
252 | i, pixval, temp); | ||
253 | if ((temp < minpixclock) || (temp > maxpixclock)) | ||
254 | pr_debug("DIU exceeds monitor range (%lu to %lu)\n", | ||
255 | minpixclock, maxpixclock); | ||
256 | else if (abs(temp - pixclock) < err) { | ||
257 | pr_debug("Entered the else if block %d\n", i); | ||
258 | err = abs(temp - pixclock); | ||
259 | bestval = pixval+i; | ||
260 | bestfreq = temp; | ||
261 | } | ||
262 | } | 240 | } |
263 | 241 | ||
264 | pr_debug("DIU chose = %lx\n", bestval); | 242 | /* Convert pixclock from a wavelength to a frequency */ |
265 | pr_debug("DIU error = %ld\n NomPixClk ", err); | 243 | temp = 1000000000000ULL; |
266 | pr_debug("DIU: Best Freq = %lx\n", bestfreq); | 244 | do_div(temp, pixclock); |
267 | /* Modify PXCLK in GUTS CLKDVDR */ | 245 | freq = temp; |
268 | pr_debug("DIU: Current value of CLKDVDR = 0x%08x\n", (*clkdvdr)); | 246 | |
269 | temp = (*clkdvdr) & 0x2000FFFF; | 247 | /* |
270 | *clkdvdr = temp; /* turn off clock */ | 248 | * 'pxclk' is the ratio of the platform clock to the pixel clock. |
271 | *clkdvdr = temp | 0x80000000 | (((bestval) & 0x1F) << 16); | 249 | * On the MPC8610, the value programmed into CLKDVDR is the ratio |
272 | pr_debug("DIU: Modified value of CLKDVDR = 0x%08x\n", (*clkdvdr)); | 250 | * minus one. The valid range of values is 2-31. |
273 | iounmap(clkdvdr); | 251 | */ |
252 | pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq) - 1; | ||
253 | pxclk = clamp_t(u32, pxclk, 2, 31); | ||
254 | |||
255 | /* Disable the pixel clock, and set it to non-inverted and no delay */ | ||
256 | clrbits32(&guts->clkdvdr, | ||
257 | CLKDVDR_PXCKEN | CLKDVDR_PXCKDLY | CLKDVDR_PXCLK_MASK); | ||
258 | |||
259 | /* Enable the clock and set the pxclk */ | ||
260 | setbits32(&guts->clkdvdr, CLKDVDR_PXCKEN | (pxclk << 16)); | ||
261 | |||
262 | iounmap(guts); | ||
274 | } | 263 | } |
275 | 264 | ||
276 | ssize_t mpc8610hpcd_show_monitor_port(int monitor_port, char *buf) | 265 | ssize_t mpc8610hpcd_show_monitor_port(int monitor_port, char *buf) |
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index f970ca2b180c..d0af7fb2f344 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -78,6 +78,10 @@ config MPIC | |||
78 | bool | 78 | bool |
79 | default n | 79 | default n |
80 | 80 | ||
81 | config PPC_EPAPR_HV_PIC | ||
82 | bool | ||
83 | default n | ||
84 | |||
81 | config MPIC_WEIRD | 85 | config MPIC_WEIRD |
82 | bool | 86 | bool |
83 | default n | 87 | default n |
@@ -266,7 +270,7 @@ config TAU_AVERAGE | |||
266 | 270 | ||
267 | config QUICC_ENGINE | 271 | config QUICC_ENGINE |
268 | bool "Freescale QUICC Engine (QE) Support" | 272 | bool "Freescale QUICC Engine (QE) Support" |
269 | depends on FSL_SOC | 273 | depends on FSL_SOC && PPC32 |
270 | select PPC_LIB_RHEAP | 274 | select PPC_LIB_RHEAP |
271 | select CRC32 | 275 | select CRC32 |
272 | help | 276 | help |
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 2165b65876f9..e06e39589a09 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -1,7 +1,6 @@ | |||
1 | config PPC64 | 1 | config PPC64 |
2 | bool "64-bit kernel" | 2 | bool "64-bit kernel" |
3 | default n | 3 | default n |
4 | select PPC_HAVE_PMU_SUPPORT | ||
5 | help | 4 | help |
6 | This option selects whether a 32-bit or a 64-bit kernel | 5 | This option selects whether a 32-bit or a 64-bit kernel |
7 | will be built. | 6 | will be built. |
@@ -69,6 +68,7 @@ choice | |||
69 | config PPC_BOOK3S_64 | 68 | config PPC_BOOK3S_64 |
70 | bool "Server processors" | 69 | bool "Server processors" |
71 | select PPC_FPU | 70 | select PPC_FPU |
71 | select PPC_HAVE_PMU_SUPPORT | ||
72 | 72 | ||
73 | config PPC_BOOK3E_64 | 73 | config PPC_BOOK3E_64 |
74 | bool "Embedded processors" | 74 | bool "Embedded processors" |
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c index e3265adde5d3..2df48c2287bd 100644 --- a/arch/powerpc/platforms/iseries/smp.c +++ b/arch/powerpc/platforms/iseries/smp.c | |||
@@ -75,7 +75,7 @@ static void __devinit smp_iSeries_setup_cpu(int nr) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static struct smp_ops_t iSeries_smp_ops = { | 77 | static struct smp_ops_t iSeries_smp_ops = { |
78 | .message_pass = smp_muxed_ipi_message_pass, | 78 | .message_pass = NULL, /* Use smp_muxed_ipi_message_pass */ |
79 | .cause_ipi = smp_iSeries_cause_ipi, | 79 | .cause_ipi = smp_iSeries_cause_ipi, |
80 | .probe = smp_iSeries_probe, | 80 | .probe = smp_iSeries_probe, |
81 | .kick_cpu = smp_iSeries_kick_cpu, | 81 | .kick_cpu = smp_iSeries_kick_cpu, |
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index fe34c3d9bb74..5b3388b9f911 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -338,35 +338,16 @@ define_machine(maple) { | |||
338 | #ifdef CONFIG_EDAC | 338 | #ifdef CONFIG_EDAC |
339 | /* | 339 | /* |
340 | * Register a platform device for CPC925 memory controller on | 340 | * Register a platform device for CPC925 memory controller on |
341 | * Motorola ATCA-6101 blade. | 341 | * all boards with U3H (CPC925) bridge. |
342 | */ | 342 | */ |
343 | #define MAPLE_CPC925_MODEL "Motorola,ATCA-6101" | ||
344 | static int __init maple_cpc925_edac_setup(void) | 343 | static int __init maple_cpc925_edac_setup(void) |
345 | { | 344 | { |
346 | struct platform_device *pdev; | 345 | struct platform_device *pdev; |
347 | struct device_node *np = NULL; | 346 | struct device_node *np = NULL; |
348 | struct resource r; | 347 | struct resource r; |
349 | const unsigned char *model; | ||
350 | int ret; | 348 | int ret; |
351 | 349 | volatile void __iomem *mem; | |
352 | np = of_find_node_by_path("/"); | 350 | u32 rev; |
353 | if (!np) { | ||
354 | printk(KERN_ERR "%s: Unable to get root node\n", __func__); | ||
355 | return -ENODEV; | ||
356 | } | ||
357 | |||
358 | model = (const unsigned char *)of_get_property(np, "model", NULL); | ||
359 | if (!model) { | ||
360 | printk(KERN_ERR "%s: Unabel to get model info\n", __func__); | ||
361 | of_node_put(np); | ||
362 | return -ENODEV; | ||
363 | } | ||
364 | |||
365 | ret = strcmp(model, MAPLE_CPC925_MODEL); | ||
366 | of_node_put(np); | ||
367 | |||
368 | if (ret != 0) | ||
369 | return 0; | ||
370 | 351 | ||
371 | np = of_find_node_by_type(NULL, "memory-controller"); | 352 | np = of_find_node_by_type(NULL, "memory-controller"); |
372 | if (!np) { | 353 | if (!np) { |
@@ -384,6 +365,22 @@ static int __init maple_cpc925_edac_setup(void) | |||
384 | return -ENODEV; | 365 | return -ENODEV; |
385 | } | 366 | } |
386 | 367 | ||
368 | mem = ioremap(r.start, resource_size(&r)); | ||
369 | if (!mem) { | ||
370 | printk(KERN_ERR "%s: Unable to map memory-controller memory\n", | ||
371 | __func__); | ||
372 | return -ENOMEM; | ||
373 | } | ||
374 | |||
375 | rev = __raw_readl(mem); | ||
376 | iounmap(mem); | ||
377 | |||
378 | if (rev < 0x34 || rev > 0x3f) { /* U3H */ | ||
379 | printk(KERN_ERR "%s: Non-CPC925(U3H) bridge revision: %02x\n", | ||
380 | __func__, rev); | ||
381 | return 0; | ||
382 | } | ||
383 | |||
387 | pdev = platform_device_register_simple("cpc925_edac", 0, &r, 1); | 384 | pdev = platform_device_register_simple("cpc925_edac", 0, &r, 1); |
388 | if (IS_ERR(pdev)) | 385 | if (IS_ERR(pdev)) |
389 | return PTR_ERR(pdev); | 386 | return PTR_ERR(pdev); |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index aa45281bd296..a028f08309d6 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -355,9 +355,6 @@ static int initializing = 1; | |||
355 | static int pmac_late_init(void) | 355 | static int pmac_late_init(void) |
356 | { | 356 | { |
357 | initializing = 0; | 357 | initializing = 0; |
358 | /* this is udbg (which is __init) and we can later use it during | ||
359 | * cpu hotplug (in smp_core99_kick_cpu) */ | ||
360 | ppc_md.progress = NULL; | ||
361 | return 0; | 358 | return 0; |
362 | } | 359 | } |
363 | machine_late_initcall(powermac, pmac_late_init); | 360 | machine_late_initcall(powermac, pmac_late_init); |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index db092d7c4c5b..d15fca322978 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -447,7 +447,7 @@ void __init smp_psurge_give_timebase(void) | |||
447 | 447 | ||
448 | /* PowerSurge-style Macs */ | 448 | /* PowerSurge-style Macs */ |
449 | struct smp_ops_t psurge_smp_ops = { | 449 | struct smp_ops_t psurge_smp_ops = { |
450 | .message_pass = smp_muxed_ipi_message_pass, | 450 | .message_pass = NULL, /* Use smp_muxed_ipi_message_pass */ |
451 | .cause_ipi = smp_psurge_cause_ipi, | 451 | .cause_ipi = smp_psurge_cause_ipi, |
452 | .probe = smp_psurge_probe, | 452 | .probe = smp_psurge_probe, |
453 | .kick_cpu = smp_psurge_kick_cpu, | 453 | .kick_cpu = smp_psurge_kick_cpu, |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 57ceb92b2288..e9be25bc571b 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -262,12 +262,11 @@ int dlpar_attach_node(struct device_node *dn) | |||
262 | if (!dn->parent) | 262 | if (!dn->parent) |
263 | return -ENOMEM; | 263 | return -ENOMEM; |
264 | 264 | ||
265 | rc = blocking_notifier_call_chain(&pSeries_reconfig_chain, | 265 | rc = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, dn); |
266 | PSERIES_RECONFIG_ADD, dn); | 266 | if (rc) { |
267 | if (rc == NOTIFY_BAD) { | ||
268 | printk(KERN_ERR "Failed to add device node %s\n", | 267 | printk(KERN_ERR "Failed to add device node %s\n", |
269 | dn->full_name); | 268 | dn->full_name); |
270 | return -ENOMEM; /* For now, safe to assume kmalloc failure */ | 269 | return rc; |
271 | } | 270 | } |
272 | 271 | ||
273 | of_attach_node(dn); | 272 | of_attach_node(dn); |
@@ -297,8 +296,7 @@ int dlpar_detach_node(struct device_node *dn) | |||
297 | remove_proc_entry(dn->pde->name, parent->pde); | 296 | remove_proc_entry(dn->pde->name, parent->pde); |
298 | #endif | 297 | #endif |
299 | 298 | ||
300 | blocking_notifier_call_chain(&pSeries_reconfig_chain, | 299 | pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); |
301 | PSERIES_RECONFIG_REMOVE, dn); | ||
302 | of_detach_node(dn); | 300 | of_detach_node(dn); |
303 | of_node_put(dn); /* Must decrement the refcount */ | 301 | of_node_put(dn); /* Must decrement the refcount */ |
304 | 302 | ||
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 46f13a3c5d09..bc0288501f17 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -330,21 +330,17 @@ static void pseries_remove_processor(struct device_node *np) | |||
330 | static int pseries_smp_notifier(struct notifier_block *nb, | 330 | static int pseries_smp_notifier(struct notifier_block *nb, |
331 | unsigned long action, void *node) | 331 | unsigned long action, void *node) |
332 | { | 332 | { |
333 | int err = NOTIFY_OK; | 333 | int err = 0; |
334 | 334 | ||
335 | switch (action) { | 335 | switch (action) { |
336 | case PSERIES_RECONFIG_ADD: | 336 | case PSERIES_RECONFIG_ADD: |
337 | if (pseries_add_processor(node)) | 337 | err = pseries_add_processor(node); |
338 | err = NOTIFY_BAD; | ||
339 | break; | 338 | break; |
340 | case PSERIES_RECONFIG_REMOVE: | 339 | case PSERIES_RECONFIG_REMOVE: |
341 | pseries_remove_processor(node); | 340 | pseries_remove_processor(node); |
342 | break; | 341 | break; |
343 | default: | ||
344 | err = NOTIFY_DONE; | ||
345 | break; | ||
346 | } | 342 | } |
347 | return err; | 343 | return notifier_from_errno(err); |
348 | } | 344 | } |
349 | 345 | ||
350 | static struct notifier_block pseries_smp_nb = { | 346 | static struct notifier_block pseries_smp_nb = { |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 9d6a8effeda2..11d8e0544ac0 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -205,27 +205,21 @@ static int pseries_drconf_memory(unsigned long *base, unsigned int action) | |||
205 | static int pseries_memory_notifier(struct notifier_block *nb, | 205 | static int pseries_memory_notifier(struct notifier_block *nb, |
206 | unsigned long action, void *node) | 206 | unsigned long action, void *node) |
207 | { | 207 | { |
208 | int err = NOTIFY_OK; | 208 | int err = 0; |
209 | 209 | ||
210 | switch (action) { | 210 | switch (action) { |
211 | case PSERIES_RECONFIG_ADD: | 211 | case PSERIES_RECONFIG_ADD: |
212 | if (pseries_add_memory(node)) | 212 | err = pseries_add_memory(node); |
213 | err = NOTIFY_BAD; | ||
214 | break; | 213 | break; |
215 | case PSERIES_RECONFIG_REMOVE: | 214 | case PSERIES_RECONFIG_REMOVE: |
216 | if (pseries_remove_memory(node)) | 215 | err = pseries_remove_memory(node); |
217 | err = NOTIFY_BAD; | ||
218 | break; | 216 | break; |
219 | case PSERIES_DRCONF_MEM_ADD: | 217 | case PSERIES_DRCONF_MEM_ADD: |
220 | case PSERIES_DRCONF_MEM_REMOVE: | 218 | case PSERIES_DRCONF_MEM_REMOVE: |
221 | if (pseries_drconf_memory(node, action)) | 219 | err = pseries_drconf_memory(node, action); |
222 | err = NOTIFY_BAD; | ||
223 | break; | ||
224 | default: | ||
225 | err = NOTIFY_DONE; | ||
226 | break; | 220 | break; |
227 | } | 221 | } |
228 | return err; | 222 | return notifier_from_errno(err); |
229 | } | 223 | } |
230 | 224 | ||
231 | static struct notifier_block pseries_mem_nb = { | 225 | static struct notifier_block pseries_mem_nb = { |
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c index 3f6a89b09816..041e87ca1893 100644 --- a/arch/powerpc/platforms/pseries/hvconsole.c +++ b/arch/powerpc/platforms/pseries/hvconsole.c | |||
@@ -73,7 +73,7 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count) | |||
73 | if (ret == H_SUCCESS) | 73 | if (ret == H_SUCCESS) |
74 | return count; | 74 | return count; |
75 | if (ret == H_BUSY) | 75 | if (ret == H_BUSY) |
76 | return 0; | 76 | return -EAGAIN; |
77 | return -EIO; | 77 | return -EIO; |
78 | } | 78 | } |
79 | 79 | ||
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 39e6e0a7b2fa..f7205d344efd 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -52,197 +52,6 @@ EXPORT_SYMBOL(plpar_hcall_norets); | |||
52 | 52 | ||
53 | extern void pSeries_find_serial_port(void); | 53 | extern void pSeries_find_serial_port(void); |
54 | 54 | ||
55 | |||
56 | static int vtermno; /* virtual terminal# for udbg */ | ||
57 | |||
58 | #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) | ||
59 | static void udbg_hvsi_putc(char c) | ||
60 | { | ||
61 | /* packet's seqno isn't used anyways */ | ||
62 | uint8_t packet[] __ALIGNED__ = { 0xff, 5, 0, 0, c }; | ||
63 | int rc; | ||
64 | |||
65 | if (c == '\n') | ||
66 | udbg_hvsi_putc('\r'); | ||
67 | |||
68 | do { | ||
69 | rc = plpar_put_term_char(vtermno, sizeof(packet), packet); | ||
70 | } while (rc == H_BUSY); | ||
71 | } | ||
72 | |||
73 | static long hvsi_udbg_buf_len; | ||
74 | static uint8_t hvsi_udbg_buf[256]; | ||
75 | |||
76 | static int udbg_hvsi_getc_poll(void) | ||
77 | { | ||
78 | unsigned char ch; | ||
79 | int rc, i; | ||
80 | |||
81 | if (hvsi_udbg_buf_len == 0) { | ||
82 | rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf); | ||
83 | if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) { | ||
84 | /* bad read or non-data packet */ | ||
85 | hvsi_udbg_buf_len = 0; | ||
86 | } else { | ||
87 | /* remove the packet header */ | ||
88 | for (i = 4; i < hvsi_udbg_buf_len; i++) | ||
89 | hvsi_udbg_buf[i-4] = hvsi_udbg_buf[i]; | ||
90 | hvsi_udbg_buf_len -= 4; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | if (hvsi_udbg_buf_len <= 0 || hvsi_udbg_buf_len > 256) { | ||
95 | /* no data ready */ | ||
96 | hvsi_udbg_buf_len = 0; | ||
97 | return -1; | ||
98 | } | ||
99 | |||
100 | ch = hvsi_udbg_buf[0]; | ||
101 | /* shift remaining data down */ | ||
102 | for (i = 1; i < hvsi_udbg_buf_len; i++) { | ||
103 | hvsi_udbg_buf[i-1] = hvsi_udbg_buf[i]; | ||
104 | } | ||
105 | hvsi_udbg_buf_len--; | ||
106 | |||
107 | return ch; | ||
108 | } | ||
109 | |||
110 | static int udbg_hvsi_getc(void) | ||
111 | { | ||
112 | int ch; | ||
113 | for (;;) { | ||
114 | ch = udbg_hvsi_getc_poll(); | ||
115 | if (ch == -1) { | ||
116 | /* This shouldn't be needed...but... */ | ||
117 | volatile unsigned long delay; | ||
118 | for (delay=0; delay < 2000000; delay++) | ||
119 | ; | ||
120 | } else { | ||
121 | return ch; | ||
122 | } | ||
123 | } | ||
124 | } | ||
125 | |||
126 | static void udbg_putcLP(char c) | ||
127 | { | ||
128 | char buf[16]; | ||
129 | unsigned long rc; | ||
130 | |||
131 | if (c == '\n') | ||
132 | udbg_putcLP('\r'); | ||
133 | |||
134 | buf[0] = c; | ||
135 | do { | ||
136 | rc = plpar_put_term_char(vtermno, 1, buf); | ||
137 | } while(rc == H_BUSY); | ||
138 | } | ||
139 | |||
140 | /* Buffered chars getc */ | ||
141 | static long inbuflen; | ||
142 | static long inbuf[2]; /* must be 2 longs */ | ||
143 | |||
144 | static int udbg_getc_pollLP(void) | ||
145 | { | ||
146 | /* The interface is tricky because it may return up to 16 chars. | ||
147 | * We save them statically for future calls to udbg_getc(). | ||
148 | */ | ||
149 | char ch, *buf = (char *)inbuf; | ||
150 | int i; | ||
151 | long rc; | ||
152 | if (inbuflen == 0) { | ||
153 | /* get some more chars. */ | ||
154 | inbuflen = 0; | ||
155 | rc = plpar_get_term_char(vtermno, &inbuflen, buf); | ||
156 | if (rc != H_SUCCESS) | ||
157 | inbuflen = 0; /* otherwise inbuflen is garbage */ | ||
158 | } | ||
159 | if (inbuflen <= 0 || inbuflen > 16) { | ||
160 | /* Catch error case as well as other oddities (corruption) */ | ||
161 | inbuflen = 0; | ||
162 | return -1; | ||
163 | } | ||
164 | ch = buf[0]; | ||
165 | for (i = 1; i < inbuflen; i++) /* shuffle them down. */ | ||
166 | buf[i-1] = buf[i]; | ||
167 | inbuflen--; | ||
168 | return ch; | ||
169 | } | ||
170 | |||
171 | static int udbg_getcLP(void) | ||
172 | { | ||
173 | int ch; | ||
174 | for (;;) { | ||
175 | ch = udbg_getc_pollLP(); | ||
176 | if (ch == -1) { | ||
177 | /* This shouldn't be needed...but... */ | ||
178 | volatile unsigned long delay; | ||
179 | for (delay=0; delay < 2000000; delay++) | ||
180 | ; | ||
181 | } else { | ||
182 | return ch; | ||
183 | } | ||
184 | } | ||
185 | } | ||
186 | |||
187 | /* call this from early_init() for a working debug console on | ||
188 | * vterm capable LPAR machines | ||
189 | */ | ||
190 | void __init udbg_init_debug_lpar(void) | ||
191 | { | ||
192 | vtermno = 0; | ||
193 | udbg_putc = udbg_putcLP; | ||
194 | udbg_getc = udbg_getcLP; | ||
195 | udbg_getc_poll = udbg_getc_pollLP; | ||
196 | |||
197 | register_early_udbg_console(); | ||
198 | } | ||
199 | |||
200 | /* returns 0 if couldn't find or use /chosen/stdout as console */ | ||
201 | void __init find_udbg_vterm(void) | ||
202 | { | ||
203 | struct device_node *stdout_node; | ||
204 | const u32 *termno; | ||
205 | const char *name; | ||
206 | |||
207 | /* find the boot console from /chosen/stdout */ | ||
208 | if (!of_chosen) | ||
209 | return; | ||
210 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); | ||
211 | if (name == NULL) | ||
212 | return; | ||
213 | stdout_node = of_find_node_by_path(name); | ||
214 | if (!stdout_node) | ||
215 | return; | ||
216 | name = of_get_property(stdout_node, "name", NULL); | ||
217 | if (!name) { | ||
218 | printk(KERN_WARNING "stdout node missing 'name' property!\n"); | ||
219 | goto out; | ||
220 | } | ||
221 | |||
222 | /* Check if it's a virtual terminal */ | ||
223 | if (strncmp(name, "vty", 3) != 0) | ||
224 | goto out; | ||
225 | termno = of_get_property(stdout_node, "reg", NULL); | ||
226 | if (termno == NULL) | ||
227 | goto out; | ||
228 | vtermno = termno[0]; | ||
229 | |||
230 | if (of_device_is_compatible(stdout_node, "hvterm1")) { | ||
231 | udbg_putc = udbg_putcLP; | ||
232 | udbg_getc = udbg_getcLP; | ||
233 | udbg_getc_poll = udbg_getc_pollLP; | ||
234 | add_preferred_console("hvc", termno[0] & 0xff, NULL); | ||
235 | } else if (of_device_is_compatible(stdout_node, "hvterm-protocol")) { | ||
236 | vtermno = termno[0]; | ||
237 | udbg_putc = udbg_hvsi_putc; | ||
238 | udbg_getc = udbg_hvsi_getc; | ||
239 | udbg_getc_poll = udbg_hvsi_getc_poll; | ||
240 | add_preferred_console("hvsi", termno[0] & 0xff, NULL); | ||
241 | } | ||
242 | out: | ||
243 | of_node_put(stdout_node); | ||
244 | } | ||
245 | |||
246 | void vpa_init(int cpu) | 55 | void vpa_init(int cpu) |
247 | { | 56 | { |
248 | int hwcpu = get_hard_smp_processor_id(cpu); | 57 | int hwcpu = get_hard_smp_processor_id(cpu); |
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index e9f6d2859c3c..24c7162f11d9 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h | |||
@@ -47,7 +47,8 @@ extern void pSeries_final_fixup(void); | |||
47 | /* Poweron flag used for enabling auto ups restart */ | 47 | /* Poweron flag used for enabling auto ups restart */ |
48 | extern unsigned long rtas_poweron_auto; | 48 | extern unsigned long rtas_poweron_auto; |
49 | 49 | ||
50 | extern void find_udbg_vterm(void); | 50 | /* Provided by HVC VIO */ |
51 | extern void hvc_vio_init_early(void); | ||
51 | 52 | ||
52 | /* Dynamic logical Partitioning/Mobility */ | 53 | /* Dynamic logical Partitioning/Mobility */ |
53 | extern void dlpar_free_cc_nodes(struct device_node *); | 54 | extern void dlpar_free_cc_nodes(struct device_node *); |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 1de2cbb92303..168651acdd83 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -97,7 +97,7 @@ static struct device_node *derive_parent(const char *path) | |||
97 | return parent; | 97 | return parent; |
98 | } | 98 | } |
99 | 99 | ||
100 | BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); | 100 | static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); |
101 | 101 | ||
102 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) | 102 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) |
103 | { | 103 | { |
@@ -109,6 +109,14 @@ void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) | |||
109 | blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); | 109 | blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); |
110 | } | 110 | } |
111 | 111 | ||
112 | int pSeries_reconfig_notify(unsigned long action, void *p) | ||
113 | { | ||
114 | int err = blocking_notifier_call_chain(&pSeries_reconfig_chain, | ||
115 | action, p); | ||
116 | |||
117 | return notifier_to_errno(err); | ||
118 | } | ||
119 | |||
112 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) | 120 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) |
113 | { | 121 | { |
114 | struct device_node *np; | 122 | struct device_node *np; |
@@ -132,11 +140,9 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist | |||
132 | goto out_err; | 140 | goto out_err; |
133 | } | 141 | } |
134 | 142 | ||
135 | err = blocking_notifier_call_chain(&pSeries_reconfig_chain, | 143 | err = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, np); |
136 | PSERIES_RECONFIG_ADD, np); | 144 | if (err) { |
137 | if (err == NOTIFY_BAD) { | ||
138 | printk(KERN_ERR "Failed to add device node %s\n", path); | 145 | printk(KERN_ERR "Failed to add device node %s\n", path); |
139 | err = -ENOMEM; /* For now, safe to assume kmalloc failure */ | ||
140 | goto out_err; | 146 | goto out_err; |
141 | } | 147 | } |
142 | 148 | ||
@@ -173,8 +179,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np) | |||
173 | 179 | ||
174 | remove_node_proc_entries(np); | 180 | remove_node_proc_entries(np); |
175 | 181 | ||
176 | blocking_notifier_call_chain(&pSeries_reconfig_chain, | 182 | pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np); |
177 | PSERIES_RECONFIG_REMOVE, np); | ||
178 | of_detach_node(np); | 183 | of_detach_node(np); |
179 | 184 | ||
180 | of_node_put(parent); | 185 | of_node_put(parent); |
@@ -472,11 +477,10 @@ static int do_update_property(char *buf, size_t bufsize) | |||
472 | else | 477 | else |
473 | action = PSERIES_DRCONF_MEM_REMOVE; | 478 | action = PSERIES_DRCONF_MEM_REMOVE; |
474 | 479 | ||
475 | rc = blocking_notifier_call_chain(&pSeries_reconfig_chain, | 480 | rc = pSeries_reconfig_notify(action, value); |
476 | action, value); | 481 | if (rc) { |
477 | if (rc == NOTIFY_BAD) { | 482 | prom_update_property(np, oldprop, newprop); |
478 | rc = prom_update_property(np, oldprop, newprop); | 483 | return rc; |
479 | return -ENOMEM; | ||
480 | } | 484 | } |
481 | } | 485 | } |
482 | 486 | ||
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 593acceeff96..d00e52926b71 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -512,9 +512,10 @@ static void __init pSeries_init_early(void) | |||
512 | { | 512 | { |
513 | pr_debug(" -> pSeries_init_early()\n"); | 513 | pr_debug(" -> pSeries_init_early()\n"); |
514 | 514 | ||
515 | #ifdef CONFIG_HVC_CONSOLE | ||
515 | if (firmware_has_feature(FW_FEATURE_LPAR)) | 516 | if (firmware_has_feature(FW_FEATURE_LPAR)) |
516 | find_udbg_vterm(); | 517 | hvc_vio_init_early(); |
517 | 518 | #endif | |
518 | if (firmware_has_feature(FW_FEATURE_DABR)) | 519 | if (firmware_has_feature(FW_FEATURE_DABR)) |
519 | ppc_md.set_dabr = pseries_set_dabr; | 520 | ppc_md.set_dabr = pseries_set_dabr; |
520 | else if (firmware_has_feature(FW_FEATURE_XDABR)) | 521 | else if (firmware_has_feature(FW_FEATURE_XDABR)) |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index cd70be5ff27e..1672db2d1b0e 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -206,7 +206,7 @@ static struct smp_ops_t pSeries_mpic_smp_ops = { | |||
206 | }; | 206 | }; |
207 | 207 | ||
208 | static struct smp_ops_t pSeries_xics_smp_ops = { | 208 | static struct smp_ops_t pSeries_xics_smp_ops = { |
209 | .message_pass = smp_muxed_ipi_message_pass, | 209 | .message_pass = NULL, /* Use smp_muxed_ipi_message_pass */ |
210 | .cause_ipi = NULL, /* Filled at runtime by xics_smp_probe() */ | 210 | .cause_ipi = NULL, /* Filled at runtime by xics_smp_probe() */ |
211 | .probe = xics_smp_probe, | 211 | .probe = xics_smp_probe, |
212 | .kick_cpu = smp_pSeries_kick_cpu, | 212 | .kick_cpu = smp_pSeries_kick_cpu, |
diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c index 9d20fa9d3710..71bd105f3863 100644 --- a/arch/powerpc/platforms/wsp/smp.c +++ b/arch/powerpc/platforms/wsp/smp.c | |||
@@ -75,7 +75,7 @@ static int __init smp_a2_probe(void) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static struct smp_ops_t a2_smp_ops = { | 77 | static struct smp_ops_t a2_smp_ops = { |
78 | .message_pass = smp_muxed_ipi_message_pass, | 78 | .message_pass = NULL, /* Use smp_muxed_ipi_message_pass */ |
79 | .cause_ipi = doorbell_cause_ipi, | 79 | .cause_ipi = doorbell_cause_ipi, |
80 | .probe = smp_a2_probe, | 80 | .probe = smp_a2_probe, |
81 | .kick_cpu = smp_a2_kick_cpu, | 81 | .kick_cpu = smp_a2_kick_cpu, |