aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/boot/dts/p2020rdb-pc_32b.dts4
-rw-r--r--arch/powerpc/boot/dts/p2020rdb-pc_36b.dts4
-rw-r--r--arch/powerpc/boot/dts/p3041ds.dts2
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c122
-rw-r--r--arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h4
-rw-r--r--arch/powerpc/sysdev/fsl_85xx_l2ctlr.c39
6 files changed, 121 insertions, 54 deletions
diff --git a/arch/powerpc/boot/dts/p2020rdb-pc_32b.dts b/arch/powerpc/boot/dts/p2020rdb-pc_32b.dts
index 852e5b27485d..57573bd52caa 100644
--- a/arch/powerpc/boot/dts/p2020rdb-pc_32b.dts
+++ b/arch/powerpc/boot/dts/p2020rdb-pc_32b.dts
@@ -56,7 +56,7 @@
56 ranges = <0x0 0x0 0xffe00000 0x100000>; 56 ranges = <0x0 0x0 0xffe00000 0x100000>;
57 }; 57 };
58 58
59 pci0: pcie@ffe08000 { 59 pci2: pcie@ffe08000 {
60 reg = <0 0xffe08000 0 0x1000>; 60 reg = <0 0xffe08000 0 0x1000>;
61 status = "disabled"; 61 status = "disabled";
62 }; 62 };
@@ -76,7 +76,7 @@
76 }; 76 };
77 }; 77 };
78 78
79 pci2: pcie@ffe0a000 { 79 pci0: pcie@ffe0a000 {
80 reg = <0 0xffe0a000 0 0x1000>; 80 reg = <0 0xffe0a000 0 0x1000>;
81 ranges = <0x2000000 0x0 0xe0000000 0 0x80000000 0x0 0x20000000 81 ranges = <0x2000000 0x0 0xe0000000 0 0x80000000 0x0 0x20000000
82 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 82 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
diff --git a/arch/powerpc/boot/dts/p2020rdb-pc_36b.dts b/arch/powerpc/boot/dts/p2020rdb-pc_36b.dts
index b5a56ca51cf7..470247ea68b4 100644
--- a/arch/powerpc/boot/dts/p2020rdb-pc_36b.dts
+++ b/arch/powerpc/boot/dts/p2020rdb-pc_36b.dts
@@ -56,7 +56,7 @@
56 ranges = <0x0 0xf 0xffe00000 0x100000>; 56 ranges = <0x0 0xf 0xffe00000 0x100000>;
57 }; 57 };
58 58
59 pci0: pcie@fffe08000 { 59 pci2: pcie@fffe08000 {
60 reg = <0xf 0xffe08000 0 0x1000>; 60 reg = <0xf 0xffe08000 0 0x1000>;
61 status = "disabled"; 61 status = "disabled";
62 }; 62 };
@@ -76,7 +76,7 @@
76 }; 76 };
77 }; 77 };
78 78
79 pci2: pcie@fffe0a000 { 79 pci0: pcie@fffe0a000 {
80 reg = <0xf 0xffe0a000 0 0x1000>; 80 reg = <0xf 0xffe0a000 0 0x1000>;
81 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000 81 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000
82 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; 82 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>;
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts
index 22a215e94162..6cdcadc80c30 100644
--- a/arch/powerpc/boot/dts/p3041ds.dts
+++ b/arch/powerpc/boot/dts/p3041ds.dts
@@ -58,7 +58,7 @@
58 #size-cells = <1>; 58 #size-cells = <1>;
59 compatible = "spansion,s25sl12801"; 59 compatible = "spansion,s25sl12801";
60 reg = <0>; 60 reg = <0>;
61 spi-max-frequency = <40000000>; /* input clock */ 61 spi-max-frequency = <35000000>; /* input clock */
62 partition@u-boot { 62 partition@u-boot {
63 label = "u-boot"; 63 label = "u-boot";
64 reg = <0x00000000 0x00100000>; 64 reg = <0x00000000 0x00100000>;
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 89ee02c54561..3c732acf331d 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -208,6 +208,7 @@ static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port)
208 u8 __iomem *lbc_lcs0_ba = NULL; 208 u8 __iomem *lbc_lcs0_ba = NULL;
209 u8 __iomem *lbc_lcs1_ba = NULL; 209 u8 __iomem *lbc_lcs1_ba = NULL;
210 phys_addr_t cs0_addr, cs1_addr; 210 phys_addr_t cs0_addr, cs1_addr;
211 u32 br0, or0, br1, or1;
211 const __be32 *iprop; 212 const __be32 *iprop;
212 unsigned int num_laws; 213 unsigned int num_laws;
213 u8 b; 214 u8 b;
@@ -256,11 +257,70 @@ static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port)
256 } 257 }
257 num_laws = be32_to_cpup(iprop); 258 num_laws = be32_to_cpup(iprop);
258 259
259 cs0_addr = lbc_br_to_phys(ecm, num_laws, in_be32(&lbc->bank[0].br)); 260 /*
260 cs1_addr = lbc_br_to_phys(ecm, num_laws, in_be32(&lbc->bank[1].br)); 261 * Indirect mode requires both BR0 and BR1 to be set to "GPCM",
262 * otherwise writes to these addresses won't actually appear on the
263 * local bus, and so the PIXIS won't see them.
264 *
265 * In FCM mode, writes go to the NAND controller, which does not pass
266 * them to the localbus directly. So we force BR0 and BR1 into GPCM
267 * mode, since we don't care about what's behind the localbus any
268 * more.
269 */
270 br0 = in_be32(&lbc->bank[0].br);
271 br1 = in_be32(&lbc->bank[1].br);
272 or0 = in_be32(&lbc->bank[0].or);
273 or1 = in_be32(&lbc->bank[1].or);
274
275 /* Make sure CS0 and CS1 are programmed */
276 if (!(br0 & BR_V) || !(br1 & BR_V)) {
277 pr_err("p1022ds: CS0 and/or CS1 is not programmed\n");
278 goto exit;
279 }
280
281 /*
282 * Use the existing BRx/ORx values if it's already GPCM. Otherwise,
283 * force the values to simple 32KB GPCM windows with the most
284 * conservative timing.
285 */
286 if ((br0 & BR_MSEL) != BR_MS_GPCM) {
287 br0 = (br0 & BR_BA) | BR_V;
288 or0 = 0xFFFF8000 | 0xFF7;
289 out_be32(&lbc->bank[0].br, br0);
290 out_be32(&lbc->bank[0].or, or0);
291 }
292 if ((br1 & BR_MSEL) != BR_MS_GPCM) {
293 br1 = (br1 & BR_BA) | BR_V;
294 or1 = 0xFFFF8000 | 0xFF7;
295 out_be32(&lbc->bank[1].br, br1);
296 out_be32(&lbc->bank[1].or, or1);
297 }
298
299 cs0_addr = lbc_br_to_phys(ecm, num_laws, br0);
300 if (!cs0_addr) {
301 pr_err("p1022ds: could not determine physical address for CS0"
302 " (BR0=%08x)\n", br0);
303 goto exit;
304 }
305 cs1_addr = lbc_br_to_phys(ecm, num_laws, br1);
306 if (!cs0_addr) {
307 pr_err("p1022ds: could not determine physical address for CS1"
308 " (BR1=%08x)\n", br1);
309 goto exit;
310 }
261 311
262 lbc_lcs0_ba = ioremap(cs0_addr, 1); 312 lbc_lcs0_ba = ioremap(cs0_addr, 1);
313 if (!lbc_lcs0_ba) {
314 pr_err("p1022ds: could not ioremap CS0 address %llx\n",
315 (unsigned long long)cs0_addr);
316 goto exit;
317 }
263 lbc_lcs1_ba = ioremap(cs1_addr, 1); 318 lbc_lcs1_ba = ioremap(cs1_addr, 1);
319 if (!lbc_lcs1_ba) {
320 pr_err("p1022ds: could not ioremap CS1 address %llx\n",
321 (unsigned long long)cs1_addr);
322 goto exit;
323 }
264 324
265 /* Make sure we're in indirect mode first. */ 325 /* Make sure we're in indirect mode first. */
266 if ((in_be32(&guts->pmuxcr) & PMUXCR_ELBCDIU_MASK) != 326 if ((in_be32(&guts->pmuxcr) & PMUXCR_ELBCDIU_MASK) !=
@@ -419,18 +479,6 @@ void __init p1022_ds_pic_init(void)
419 479
420#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 480#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
421 481
422/*
423 * Disables a node in the device tree.
424 *
425 * This function is called before kmalloc() is available, so the 'new' object
426 * should be allocated in the global area. The easiest way is to do that is
427 * to allocate one static local variable for each call to this function.
428 */
429static void __init disable_one_node(struct device_node *np, struct property *new)
430{
431 prom_update_property(np, new);
432}
433
434/* TRUE if there is a "video=fslfb" command-line parameter. */ 482/* TRUE if there is a "video=fslfb" command-line parameter. */
435static bool fslfb; 483static bool fslfb;
436 484
@@ -493,28 +541,58 @@ static void __init p1022_ds_setup_arch(void)
493 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; 541 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
494 542
495 /* 543 /*
496 * Disable the NOR flash node if there is video=fslfb... command-line 544 * Disable the NOR and NAND flash nodes if there is video=fslfb...
497 * parameter. When the DIU is active, NOR flash is unavailable, so we 545 * command-line parameter. When the DIU is active, the localbus is
498 * have to disable the node before the MTD driver loads. 546 * unavailable, so we have to disable these nodes before the MTD
547 * driver loads.
499 */ 548 */
500 if (fslfb) { 549 if (fslfb) {
501 struct device_node *np = 550 struct device_node *np =
502 of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc"); 551 of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc");
503 552
504 if (np) { 553 if (np) {
505 np = of_find_compatible_node(np, NULL, "cfi-flash"); 554 struct device_node *np2;
506 if (np) { 555
556 of_node_get(np);
557 np2 = of_find_compatible_node(np, NULL, "cfi-flash");
558 if (np2) {
507 static struct property nor_status = { 559 static struct property nor_status = {
508 .name = "status", 560 .name = "status",
509 .value = "disabled", 561 .value = "disabled",
510 .length = sizeof("disabled"), 562 .length = sizeof("disabled"),
511 }; 563 };
512 564
565 /*
566 * prom_update_property() is called before
567 * kmalloc() is available, so the 'new' object
568 * should be allocated in the global area.
569 * The easiest way is to do that is to
570 * allocate one static local variable for each
571 * call to this function.
572 */
513 pr_info("p1022ds: disabling %s node", 573 pr_info("p1022ds: disabling %s node",
514 np->full_name); 574 np2->full_name);
515 disable_one_node(np, &nor_status); 575 prom_update_property(np2, &nor_status);
516 of_node_put(np); 576 of_node_put(np2);
517 } 577 }
578
579 of_node_get(np);
580 np2 = of_find_compatible_node(np, NULL,
581 "fsl,elbc-fcm-nand");
582 if (np2) {
583 static struct property nand_status = {
584 .name = "status",
585 .value = "disabled",
586 .length = sizeof("disabled"),
587 };
588
589 pr_info("p1022ds: disabling %s node",
590 np2->full_name);
591 prom_update_property(np2, &nand_status);
592 of_node_put(np2);
593 }
594
595 of_node_put(np);
518 } 596 }
519 597
520 } 598 }
diff --git a/arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h b/arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h
index 60c9c0bd5ba2..2aa97ddb7b78 100644
--- a/arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h
+++ b/arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2009-2010 Freescale Semiconductor, Inc 2 * Copyright 2009-2010, 2012 Freescale Semiconductor, Inc
3 * 3 *
4 * QorIQ based Cache Controller Memory Mapped Registers 4 * QorIQ based Cache Controller Memory Mapped Registers
5 * 5 *
@@ -91,7 +91,7 @@ struct mpc85xx_l2ctlr {
91 91
92struct sram_parameters { 92struct sram_parameters {
93 unsigned int sram_size; 93 unsigned int sram_size;
94 uint64_t sram_offset; 94 phys_addr_t sram_offset;
95}; 95};
96 96
97extern int instantiate_cache_sram(struct platform_device *dev, 97extern int instantiate_cache_sram(struct platform_device *dev,
diff --git a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
index cedabd0f4bfe..68ac3aacb191 100644
--- a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
+++ b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2009-2010 Freescale Semiconductor, Inc. 2 * Copyright 2009-2010, 2012 Freescale Semiconductor, Inc.
3 * 3 *
4 * QorIQ (P1/P2) L2 controller init for Cache-SRAM instantiation 4 * QorIQ (P1/P2) L2 controller init for Cache-SRAM instantiation
5 * 5 *
@@ -31,24 +31,21 @@ static char *sram_size;
31static char *sram_offset; 31static char *sram_offset;
32struct mpc85xx_l2ctlr __iomem *l2ctlr; 32struct mpc85xx_l2ctlr __iomem *l2ctlr;
33 33
34static long get_cache_sram_size(void) 34static int get_cache_sram_params(struct sram_parameters *sram_params)
35{ 35{
36 unsigned long val; 36 unsigned long long addr;
37 unsigned int size;
37 38
38 if (!sram_size || (strict_strtoul(sram_size, 0, &val) < 0)) 39 if (!sram_size || (kstrtouint(sram_size, 0, &size) < 0))
39 return -EINVAL; 40 return -EINVAL;
40 41
41 return val; 42 if (!sram_offset || (kstrtoull(sram_offset, 0, &addr) < 0))
42}
43
44static long get_cache_sram_offset(void)
45{
46 unsigned long val;
47
48 if (!sram_offset || (strict_strtoul(sram_offset, 0, &val) < 0))
49 return -EINVAL; 43 return -EINVAL;
50 44
51 return val; 45 sram_params->sram_offset = addr;
46 sram_params->sram_size = size;
47
48 return 0;
52} 49}
53 50
54static int __init get_size_from_cmdline(char *str) 51static int __init get_size_from_cmdline(char *str)
@@ -93,17 +90,9 @@ static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
93 } 90 }
94 l2cache_size = *prop; 91 l2cache_size = *prop;
95 92
96 sram_params.sram_size = get_cache_sram_size(); 93 if (get_cache_sram_params(&sram_params)) {
97 if ((int)sram_params.sram_size <= 0) {
98 dev_err(&dev->dev,
99 "Entire L2 as cache, Aborting Cache-SRAM stuff\n");
100 return -EINVAL;
101 }
102
103 sram_params.sram_offset = get_cache_sram_offset();
104 if ((int64_t)sram_params.sram_offset <= 0) {
105 dev_err(&dev->dev, 94 dev_err(&dev->dev,
106 "Entire L2 as cache, provide a valid sram offset\n"); 95 "Entire L2 as cache, provide valid sram offset and size\n");
107 return -EINVAL; 96 return -EINVAL;
108 } 97 }
109 98
@@ -125,14 +114,14 @@ static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
125 * Write bits[0-17] to srbar0 114 * Write bits[0-17] to srbar0
126 */ 115 */
127 out_be32(&l2ctlr->srbar0, 116 out_be32(&l2ctlr->srbar0,
128 sram_params.sram_offset & L2SRAM_BAR_MSK_LO18); 117 lower_32_bits(sram_params.sram_offset) & L2SRAM_BAR_MSK_LO18);
129 118
130 /* 119 /*
131 * Write bits[18-21] to srbare0 120 * Write bits[18-21] to srbare0
132 */ 121 */
133#ifdef CONFIG_PHYS_64BIT 122#ifdef CONFIG_PHYS_64BIT
134 out_be32(&l2ctlr->srbarea0, 123 out_be32(&l2ctlr->srbarea0,
135 (sram_params.sram_offset >> 32) & L2SRAM_BARE_MSK_HI4); 124 upper_32_bits(sram_params.sram_offset) & L2SRAM_BARE_MSK_HI4);
136#endif 125#endif
137 126
138 clrsetbits_be32(&l2ctlr->ctl, L2CR_L2E, L2CR_L2FI); 127 clrsetbits_be32(&l2ctlr->ctl, L2CR_L2E, L2CR_L2FI);