aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/512x/mpc512x_shared.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2010-02-16 10:36:26 -0700
committerGrant Likely <grant.likely@secretlab.ca>2010-02-16 10:36:26 -0700
commita8dbceb755f82f760b56bac4283f9cfc7774e62b (patch)
treee67da86732c70100ecfa137ac99eba47ec64aa2b /arch/powerpc/platforms/512x/mpc512x_shared.c
parent284ed66fc3beca509a7549aae06af5c74023304c (diff)
powerpc/mpc5121: Add machine restart support
Add reset module registers representation and machine restart callback for mpc5121 platform. Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc/platforms/512x/mpc512x_shared.c')
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index b683165a24e..a45824af03f 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -21,9 +21,38 @@
#include <asm/ipic.h>
#include <asm/prom.h>
#include <asm/time.h>
+#include <asm/mpc5121.h>
#include "mpc512x.h"
+static struct mpc512x_reset_module __iomem *reset_module_base;
+
+static void __init mpc512x_restart_init(void)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
+ if (!np)
+ return;
+
+ reset_module_base = of_iomap(np, 0);
+ of_node_put(np);
+}
+
+void mpc512x_restart(char *cmd)
+{
+ if (reset_module_base) {
+ /* Enable software reset "RSTE" */
+ out_be32(&reset_module_base->rpr, 0x52535445);
+ /* Set software hard reset */
+ out_be32(&reset_module_base->rcr, 0x2);
+ } else {
+ pr_err("Restart module not mapped.\n");
+ }
+ for (;;)
+ ;
+}
+
void __init mpc512x_init_IRQ(void)
{
struct device_node *np;
@@ -62,4 +91,5 @@ void __init mpc512x_init(void)
{
mpc512x_declare_of_platform_devices();
mpc5121_clk_init();
+ mpc512x_restart_init();
}