aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2012-07-13 15:28:42 -0400
committerKumar Gala <galak@kernel.crashing.org>2012-07-26 14:26:04 -0400
commit6269f2584a359766f53005c676daff8aee60cbed (patch)
tree938bc91b1a5019e53cbf9d5b49f31402d84cadcc
parent163f22dc9615e6bc446f50a626af7362cd269876 (diff)
powerpc/85xx: p1022ds: disable the NAND flash node if video is enabled
The Freescale P1022 has a unique pin muxing "feature" where the DIU video controller's video signals are muxed with 24 of the local bus address signals. When the DIU is enabled, the bulk of the local bus is disabled, preventing access to memory-mapped devices like NAND flash and the pixis FPGA. Therefore, if the DIU is going to be enabled, then memory-mapped devices on the localbus, like NAND flash, need to be disabled. This patch is similar to "powerpc/85xx: p1022ds: disable the NOR flash node if video is enabled", except that it disables the NAND flash node instead. This PIXIS node needs to remain enabled because it is used by platform code to switch into indirect mode. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c58
1 files changed, 38 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 89ee02c5456..5ca2823ab7f 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -419,18 +419,6 @@ void __init p1022_ds_pic_init(void)
419 419
420#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 420#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
421 421
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. */ 422/* TRUE if there is a "video=fslfb" command-line parameter. */
435static bool fslfb; 423static bool fslfb;
436 424
@@ -493,28 +481,58 @@ static void __init p1022_ds_setup_arch(void)
493 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; 481 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
494 482
495 /* 483 /*
496 * Disable the NOR flash node if there is video=fslfb... command-line 484 * 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 485 * command-line parameter. When the DIU is active, the localbus is
498 * have to disable the node before the MTD driver loads. 486 * unavailable, so we have to disable these nodes before the MTD
487 * driver loads.
499 */ 488 */
500 if (fslfb) { 489 if (fslfb) {
501 struct device_node *np = 490 struct device_node *np =
502 of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc"); 491 of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc");
503 492
504 if (np) { 493 if (np) {
505 np = of_find_compatible_node(np, NULL, "cfi-flash"); 494 struct device_node *np2;
506 if (np) { 495
496 of_node_get(np);
497 np2 = of_find_compatible_node(np, NULL, "cfi-flash");
498 if (np2) {
507 static struct property nor_status = { 499 static struct property nor_status = {
508 .name = "status", 500 .name = "status",
509 .value = "disabled", 501 .value = "disabled",
510 .length = sizeof("disabled"), 502 .length = sizeof("disabled"),
511 }; 503 };
512 504
505 /*
506 * prom_update_property() is called before
507 * kmalloc() is available, so the 'new' object
508 * should be allocated in the global area.
509 * The easiest way is to do that is to
510 * allocate one static local variable for each
511 * call to this function.
512 */
513 pr_info("p1022ds: disabling %s node",
514 np2->full_name);
515 prom_update_property(np2, &nor_status);
516 of_node_put(np2);
517 }
518
519 of_node_get(np);
520 np2 = of_find_compatible_node(np, NULL,
521 "fsl,elbc-fcm-nand");
522 if (np2) {
523 static struct property nand_status = {
524 .name = "status",
525 .value = "disabled",
526 .length = sizeof("disabled"),
527 };
528
513 pr_info("p1022ds: disabling %s node", 529 pr_info("p1022ds: disabling %s node",
514 np->full_name); 530 np2->full_name);
515 disable_one_node(np, &nor_status); 531 prom_update_property(np2, &nand_status);
516 of_node_put(np); 532 of_node_put(np2);
517 } 533 }
534
535 of_node_put(np);
518 } 536 }
519 537
520 } 538 }