aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig3
-rw-r--r--arch/powerpc/Kconfig.debug1
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts24
-rw-r--r--arch/powerpc/include/asm/highmem.h2
-rw-r--r--arch/powerpc/include/asm/pci.h4
-rw-r--r--arch/powerpc/include/asm/suspend.h3
-rw-r--r--arch/powerpc/kernel/msi.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c123
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c109
-rw-r--r--arch/powerpc/sysdev/fsl_soc.h7
10 files changed, 155 insertions, 126 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ad6b1c084fe..45192dce65c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -228,6 +228,9 @@ config PPC_OF_PLATFORM_PCI
228 depends on PPC64 # not supported on 32 bits yet 228 depends on PPC64 # not supported on 32 bits yet
229 default n 229 default n
230 230
231config ARCH_SUPPORTS_DEBUG_PAGEALLOC
232 def_bool y
233
231source "init/Kconfig" 234source "init/Kconfig"
232 235
233source "kernel/Kconfig.freezer" 236source "kernel/Kconfig.freezer"
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 22091bbfdc9..6aa0b5e087c 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -30,6 +30,7 @@ config DEBUG_STACK_USAGE
30config DEBUG_PAGEALLOC 30config DEBUG_PAGEALLOC
31 bool "Debug page memory allocations" 31 bool "Debug page memory allocations"
32 depends on DEBUG_KERNEL && !HIBERNATION 32 depends on DEBUG_KERNEL && !HIBERNATION
33 depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
33 help 34 help
34 Unmap pages from the kernel linear mapping after free_pages(). 35 Unmap pages from the kernel linear mapping after free_pages().
35 This results in a large slowdown, but helps to find certain types 36 This results in a large slowdown, but helps to find certain types
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index dea30910c13..4319bd70a58 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -152,10 +152,21 @@
152 }; 152 };
153 153
154 par_io@1400 { 154 par_io@1400 {
155 #address-cells = <1>;
156 #size-cells = <1>;
155 reg = <0x1400 0x100>; 157 reg = <0x1400 0x100>;
158 ranges = <3 0x1448 0x18>;
159 compatible = "fsl,mpc8323-qe-pario";
156 device_type = "par_io"; 160 device_type = "par_io";
157 num-ports = <7>; 161 num-ports = <7>;
158 162
163 qe_pio_d: gpio-controller@1448 {
164 #gpio-cells = <2>;
165 compatible = "fsl,mpc8323-qe-pario-bank";
166 reg = <3 0x18>;
167 gpio-controller;
168 };
169
159 ucc2pio:ucc_pin@02 { 170 ucc2pio:ucc_pin@02 {
160 pio-map = < 171 pio-map = <
161 /* port pin dir open_drain assignment has_irq */ 172 /* port pin dir open_drain assignment has_irq */
@@ -225,12 +236,25 @@
225 }; 236 };
226 237
227 spi@4c0 { 238 spi@4c0 {
239 #address-cells = <1>;
240 #size-cells = <0>;
228 cell-index = <0>; 241 cell-index = <0>;
229 compatible = "fsl,spi"; 242 compatible = "fsl,spi";
230 reg = <0x4c0 0x40>; 243 reg = <0x4c0 0x40>;
231 interrupts = <2>; 244 interrupts = <2>;
232 interrupt-parent = <&qeic>; 245 interrupt-parent = <&qeic>;
246 gpios = <&qe_pio_d 13 0>;
233 mode = "cpu-qe"; 247 mode = "cpu-qe";
248
249 mmc-slot@0 {
250 compatible = "fsl,mpc8323rdb-mmc-slot",
251 "mmc-spi-slot";
252 reg = <0>;
253 gpios = <&qe_pio_d 14 1
254 &qe_pio_d 15 0>;
255 voltage-ranges = <3300 3300>;
256 spi-max-frequency = <50000000>;
257 };
234 }; 258 };
235 259
236 spi@500 { 260 spi@500 {
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 545028f8648..684a73f4324 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/highmem.h>
27#include <asm/kmap_types.h> 28#include <asm/kmap_types.h>
28#include <asm/tlbflush.h> 29#include <asm/tlbflush.h>
29#include <asm/page.h> 30#include <asm/page.h>
@@ -94,6 +95,7 @@ static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgpro
94 if (!PageHighMem(page)) 95 if (!PageHighMem(page))
95 return page_address(page); 96 return page_address(page);
96 97
98 debug_kmap_atomic(type);
97 idx = type + KM_TYPE_NR*smp_processor_id(); 99 idx = type + KM_TYPE_NR*smp_processor_id();
98 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 100 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
99#ifdef CONFIG_DEBUG_HIGHMEM 101#ifdef CONFIG_DEBUG_HIGHMEM
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 3548159a1be..ba17d5d90a4 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -114,6 +114,10 @@ extern int pci_domain_nr(struct pci_bus *bus);
114/* Decide whether to display the domain number in /proc */ 114/* Decide whether to display the domain number in /proc */
115extern int pci_proc_domain(struct pci_bus *bus); 115extern int pci_proc_domain(struct pci_bus *bus);
116 116
117/* MSI arch hooks */
118#define arch_setup_msi_irqs arch_setup_msi_irqs
119#define arch_teardown_msi_irqs arch_teardown_msi_irqs
120#define arch_msi_check_device arch_msi_check_device
117 121
118struct vm_area_struct; 122struct vm_area_struct;
119/* Map a range of PCI memory or I/O space for a device into user space */ 123/* Map a range of PCI memory or I/O space for a device into user space */
diff --git a/arch/powerpc/include/asm/suspend.h b/arch/powerpc/include/asm/suspend.h
index cbf2c9404c3..c6efc3466aa 100644
--- a/arch/powerpc/include/asm/suspend.h
+++ b/arch/powerpc/include/asm/suspend.h
@@ -3,7 +3,4 @@
3 3
4static inline int arch_prepare_suspend(void) { return 0; } 4static inline int arch_prepare_suspend(void) { return 0; }
5 5
6void save_processor_state(void);
7void restore_processor_state(void);
8
9#endif /* __ASM_POWERPC_SUSPEND_H */ 6#endif /* __ASM_POWERPC_SUSPEND_H */
diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 3bb7d3dd28b..8bbc12d20f5 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/msi.h> 11#include <linux/msi.h>
12#include <linux/pci.h>
12 13
13#include <asm/machdep.h> 14#include <asm/machdep.h>
14 15
@@ -19,6 +20,10 @@ int arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
19 return -ENOSYS; 20 return -ENOSYS;
20 } 21 }
21 22
23 /* PowerPC doesn't support multiple MSI yet */
24 if (type == PCI_CAP_ID_MSI && nvec > 1)
25 return 1;
26
22 if (ppc_md.msi_check_device) { 27 if (ppc_md.msi_check_device) {
23 pr_debug("msi: Using platform check routine.\n"); 28 pr_debug("msi: Using platform check routine.\n");
24 return ppc_md.msi_check_device(dev, nvec, type); 29 return ppc_md.msi_check_device(dev, nvec, type);
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 2a1295f1983..567ded7c3b9 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -20,6 +20,7 @@
20#include <linux/spi/mmc_spi.h> 20#include <linux/spi/mmc_spi.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/fsl_devices.h>
23 24
24#include <asm/time.h> 25#include <asm/time.h>
25#include <asm/ipic.h> 26#include <asm/ipic.h>
@@ -39,16 +40,116 @@
39#endif 40#endif
40 41
41#ifdef CONFIG_QUICC_ENGINE 42#ifdef CONFIG_QUICC_ENGINE
42static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity) 43static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
44 struct spi_board_info *board_infos,
45 unsigned int num_board_infos,
46 void (*cs_control)(struct spi_device *dev,
47 bool on))
43{ 48{
44 pr_debug("%s %d %d\n", __func__, cs, polarity); 49 struct device_node *np;
45 par_io_data_set(3, 13, polarity); 50 unsigned int i = 0;
51
52 for_each_compatible_node(np, type, compatible) {
53 int ret;
54 unsigned int j;
55 const void *prop;
56 struct resource res[2];
57 struct platform_device *pdev;
58 struct fsl_spi_platform_data pdata = {
59 .cs_control = cs_control,
60 };
61
62 memset(res, 0, sizeof(res));
63
64 pdata.sysclk = sysclk;
65
66 prop = of_get_property(np, "reg", NULL);
67 if (!prop)
68 goto err;
69 pdata.bus_num = *(u32 *)prop;
70
71 prop = of_get_property(np, "cell-index", NULL);
72 if (prop)
73 i = *(u32 *)prop;
74
75 prop = of_get_property(np, "mode", NULL);
76 if (prop && !strcmp(prop, "cpu-qe"))
77 pdata.qe_mode = 1;
78
79 for (j = 0; j < num_board_infos; j++) {
80 if (board_infos[j].bus_num == pdata.bus_num)
81 pdata.max_chipselect++;
82 }
83
84 if (!pdata.max_chipselect)
85 continue;
86
87 ret = of_address_to_resource(np, 0, &res[0]);
88 if (ret)
89 goto err;
90
91 ret = of_irq_to_resource(np, 0, &res[1]);
92 if (ret == NO_IRQ)
93 goto err;
94
95 pdev = platform_device_alloc("mpc83xx_spi", i);
96 if (!pdev)
97 goto err;
98
99 ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
100 if (ret)
101 goto unreg;
102
103 ret = platform_device_add_resources(pdev, res,
104 ARRAY_SIZE(res));
105 if (ret)
106 goto unreg;
107
108 ret = platform_device_add(pdev);
109 if (ret)
110 goto unreg;
111
112 goto next;
113unreg:
114 platform_device_del(pdev);
115err:
116 pr_err("%s: registration failed\n", np->full_name);
117next:
118 i++;
119 }
120
121 return i;
46} 122}
47 123
48static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity) 124static int __init fsl_spi_init(struct spi_board_info *board_infos,
125 unsigned int num_board_infos,
126 void (*cs_control)(struct spi_device *spi,
127 bool on))
49{ 128{
50 pr_debug("%s %d %d\n", __func__, cs, polarity); 129 u32 sysclk = -1;
51 par_io_data_set(3, 13, !polarity); 130 int ret;
131
132 /* SPI controller is either clocked from QE or SoC clock */
133 sysclk = get_brgfreq();
134 if (sysclk == -1) {
135 sysclk = fsl_get_sys_freq();
136 if (sysclk == -1)
137 return -ENODEV;
138 }
139
140 ret = of_fsl_spi_probe(NULL, "fsl,spi", sysclk, board_infos,
141 num_board_infos, cs_control);
142 if (!ret)
143 of_fsl_spi_probe("spi", "fsl_spi", sysclk, board_infos,
144 num_board_infos, cs_control);
145
146 return spi_register_board_info(board_infos, num_board_infos);
147}
148
149static void mpc83xx_spi_cs_control(struct spi_device *spi, bool on)
150{
151 pr_debug("%s %d %d\n", __func__, spi->chip_select, on);
152 par_io_data_set(3, 13, on);
52} 153}
53 154
54static struct mmc_spi_platform_data mpc832x_mmc_pdata = { 155static struct mmc_spi_platform_data mpc832x_mmc_pdata = {
@@ -74,9 +175,13 @@ static int __init mpc832x_spi_init(void)
74 par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */ 175 par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */
75 par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */ 176 par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */
76 177
77 return fsl_spi_init(&mpc832x_spi_boardinfo, 1, 178 /*
78 mpc83xx_spi_activate_cs, 179 * Don't bother with legacy stuff when device tree contains
79 mpc83xx_spi_deactivate_cs); 180 * mmc-spi-slot node.
181 */
182 if (of_find_compatible_node(NULL, NULL, "mmc-spi-slot"))
183 return 0;
184 return fsl_spi_init(&mpc832x_spi_boardinfo, 1, mpc83xx_spi_cs_control);
80} 185}
81machine_device_initcall(mpc832x_rdb, mpc832x_spi_init); 186machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
82#endif /* CONFIG_QUICC_ENGINE */ 187#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index a01c89d3f9b..afe8dbc964a 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -417,115 +417,6 @@ err:
417 417
418arch_initcall(fsl_usb_of_init); 418arch_initcall(fsl_usb_of_init);
419 419
420static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
421 struct spi_board_info *board_infos,
422 unsigned int num_board_infos,
423 void (*activate_cs)(u8 cs, u8 polarity),
424 void (*deactivate_cs)(u8 cs, u8 polarity))
425{
426 struct device_node *np;
427 unsigned int i = 0;
428
429 for_each_compatible_node(np, type, compatible) {
430 int ret;
431 unsigned int j;
432 const void *prop;
433 struct resource res[2];
434 struct platform_device *pdev;
435 struct fsl_spi_platform_data pdata = {
436 .activate_cs = activate_cs,
437 .deactivate_cs = deactivate_cs,
438 };
439
440 memset(res, 0, sizeof(res));
441
442 pdata.sysclk = sysclk;
443
444 prop = of_get_property(np, "reg", NULL);
445 if (!prop)
446 goto err;
447 pdata.bus_num = *(u32 *)prop;
448
449 prop = of_get_property(np, "cell-index", NULL);
450 if (prop)
451 i = *(u32 *)prop;
452
453 prop = of_get_property(np, "mode", NULL);
454 if (prop && !strcmp(prop, "cpu-qe"))
455 pdata.qe_mode = 1;
456
457 for (j = 0; j < num_board_infos; j++) {
458 if (board_infos[j].bus_num == pdata.bus_num)
459 pdata.max_chipselect++;
460 }
461
462 if (!pdata.max_chipselect)
463 continue;
464
465 ret = of_address_to_resource(np, 0, &res[0]);
466 if (ret)
467 goto err;
468
469 ret = of_irq_to_resource(np, 0, &res[1]);
470 if (ret == NO_IRQ)
471 goto err;
472
473 pdev = platform_device_alloc("mpc83xx_spi", i);
474 if (!pdev)
475 goto err;
476
477 ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
478 if (ret)
479 goto unreg;
480
481 ret = platform_device_add_resources(pdev, res,
482 ARRAY_SIZE(res));
483 if (ret)
484 goto unreg;
485
486 ret = platform_device_add(pdev);
487 if (ret)
488 goto unreg;
489
490 goto next;
491unreg:
492 platform_device_del(pdev);
493err:
494 pr_err("%s: registration failed\n", np->full_name);
495next:
496 i++;
497 }
498
499 return i;
500}
501
502int __init fsl_spi_init(struct spi_board_info *board_infos,
503 unsigned int num_board_infos,
504 void (*activate_cs)(u8 cs, u8 polarity),
505 void (*deactivate_cs)(u8 cs, u8 polarity))
506{
507 u32 sysclk = -1;
508 int ret;
509
510#ifdef CONFIG_QUICC_ENGINE
511 /* SPI controller is either clocked from QE or SoC clock */
512 sysclk = get_brgfreq();
513#endif
514 if (sysclk == -1) {
515 sysclk = fsl_get_sys_freq();
516 if (sysclk == -1)
517 return -ENODEV;
518 }
519
520 ret = of_fsl_spi_probe(NULL, "fsl,spi", sysclk, board_infos,
521 num_board_infos, activate_cs, deactivate_cs);
522 if (!ret)
523 of_fsl_spi_probe("spi", "fsl_spi", sysclk, board_infos,
524 num_board_infos, activate_cs, deactivate_cs);
525
526 return spi_register_board_info(board_infos, num_board_infos);
527}
528
529#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) 420#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
530static __be32 __iomem *rstcr; 421static __be32 __iomem *rstcr;
531 422
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 9c744e4285a..42381bb6cd5 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -4,6 +4,8 @@
4 4
5#include <asm/mmu.h> 5#include <asm/mmu.h>
6 6
7struct spi_device;
8
7extern phys_addr_t get_immrbase(void); 9extern phys_addr_t get_immrbase(void);
8#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx) 10#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
9extern u32 get_brgfreq(void); 11extern u32 get_brgfreq(void);
@@ -17,11 +19,6 @@ extern u32 fsl_get_sys_freq(void);
17struct spi_board_info; 19struct spi_board_info;
18struct device_node; 20struct device_node;
19 21
20extern int fsl_spi_init(struct spi_board_info *board_infos,
21 unsigned int num_board_infos,
22 void (*activate_cs)(u8 cs, u8 polarity),
23 void (*deactivate_cs)(u8 cs, u8 polarity));
24
25extern void fsl_rstcr_restart(char *cmd); 22extern void fsl_rstcr_restart(char *cmd);
26 23
27#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 24#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)