aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/512x/mpc512x_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/512x/mpc512x_shared.c')
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index 434d683df5a..b7f518a60f0 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -21,9 +21,38 @@
21#include <asm/ipic.h> 21#include <asm/ipic.h>
22#include <asm/prom.h> 22#include <asm/prom.h>
23#include <asm/time.h> 23#include <asm/time.h>
24#include <asm/mpc5121.h>
24 25
25#include "mpc512x.h" 26#include "mpc512x.h"
26 27
28static struct mpc512x_reset_module __iomem *reset_module_base;
29
30static void __init mpc512x_restart_init(void)
31{
32 struct device_node *np;
33
34 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
35 if (!np)
36 return;
37
38 reset_module_base = of_iomap(np, 0);
39 of_node_put(np);
40}
41
42void mpc512x_restart(char *cmd)
43{
44 if (reset_module_base) {
45 /* Enable software reset "RSTE" */
46 out_be32(&reset_module_base->rpr, 0x52535445);
47 /* Set software hard reset */
48 out_be32(&reset_module_base->rcr, 0x2);
49 } else {
50 pr_err("Restart module not mapped.\n");
51 }
52 for (;;)
53 ;
54}
55
27void __init mpc512x_init_IRQ(void) 56void __init mpc512x_init_IRQ(void)
28{ 57{
29 struct device_node *np; 58 struct device_node *np;
@@ -53,8 +82,22 @@ static struct of_device_id __initdata of_bus_ids[] = {
53 82
54void __init mpc512x_declare_of_platform_devices(void) 83void __init mpc512x_declare_of_platform_devices(void)
55{ 84{
85 struct device_node *np;
86
56 if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) 87 if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
57 printk(KERN_ERR __FILE__ ": " 88 printk(KERN_ERR __FILE__ ": "
58 "Error while probing of_platform bus\n"); 89 "Error while probing of_platform bus\n");
90
91 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc");
92 if (np) {
93 of_platform_device_create(np, NULL, NULL);
94 of_node_put(np);
95 }
59} 96}
60 97
98void __init mpc512x_init(void)
99{
100 mpc512x_declare_of_platform_devices();
101 mpc5121_clk_init();
102 mpc512x_restart_init();
103}