diff options
Diffstat (limited to 'arch/powerpc/platforms/512x/mpc512x_shared.c')
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index c7f47cfa9c29..d30235b7e3f7 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c | |||
@@ -426,8 +426,38 @@ void __init mpc512x_psc_fifo_init(void) | |||
426 | 426 | ||
427 | void __init mpc512x_init(void) | 427 | void __init mpc512x_init(void) |
428 | { | 428 | { |
429 | mpc512x_declare_of_platform_devices(); | ||
430 | mpc5121_clk_init(); | 429 | mpc5121_clk_init(); |
430 | mpc512x_declare_of_platform_devices(); | ||
431 | mpc512x_restart_init(); | 431 | mpc512x_restart_init(); |
432 | mpc512x_psc_fifo_init(); | 432 | mpc512x_psc_fifo_init(); |
433 | } | 433 | } |
434 | |||
435 | /** | ||
436 | * mpc512x_cs_config - Setup chip select configuration | ||
437 | * @cs: chip select number | ||
438 | * @val: chip select configuration value | ||
439 | * | ||
440 | * Perform chip select configuration for devices on LocalPlus Bus. | ||
441 | * Intended to dynamically reconfigure the chip select parameters | ||
442 | * for configurable devices on the bus. | ||
443 | */ | ||
444 | int mpc512x_cs_config(unsigned int cs, u32 val) | ||
445 | { | ||
446 | static struct mpc512x_lpc __iomem *lpc; | ||
447 | struct device_node *np; | ||
448 | |||
449 | if (cs > 7) | ||
450 | return -EINVAL; | ||
451 | |||
452 | if (!lpc) { | ||
453 | np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-lpc"); | ||
454 | lpc = of_iomap(np, 0); | ||
455 | of_node_put(np); | ||
456 | if (!lpc) | ||
457 | return -ENOMEM; | ||
458 | } | ||
459 | |||
460 | out_be32(&lpc->cs_cfg[cs], val); | ||
461 | return 0; | ||
462 | } | ||
463 | EXPORT_SYMBOL(mpc512x_cs_config); | ||