@@ -70,4 +70,5 @@ define_machine(mpc5121_ads) {
.init_IRQ = mpc5121_ads_init_IRQ,
.get_irq = ipic_get_irq,
.calibrate_decr = generic_calibrate_decr,
+ .restart = mpc512x_restart,
};
@@ -14,5 +14,6 @@
extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
extern void __init mpc512x_init_IRQ(void);
extern void __init mpc512x_init_i2c(void);
+extern void mpc512x_restart(char *cmd);
void __init mpc512x_declare_of_platform_devices(void);
#endif /* __MPC512X_H__ */
@@ -22,6 +22,7 @@
#include <asm/prom.h>
#include <asm/time.h>
+#include <asm/mpc512x.h>
#include "mpc512x.h"
unsigned long
@@ -89,6 +90,33 @@ void __init mpc512x_init_i2c(void)
}
}
+void mpc512x_restart(char *cmd)
+{
+ struct device_node *np;
+ struct mpc512x_reset_module *rm;
+
+ local_irq_disable();
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
+
+ if (np) {
+
+ rm = of_iomap(np, 0);
+ if (rm) {
+
+ /* Enable software reset "RSTE" (in hex) */
+ out_be32( &(rm->rpr) , 0x52535445);
+
+ /* Set the software hard reset */
+ out_be32( &(rm->rcr), 0x2);
+ }
+ }
+
+ printk (KERN_EMERG "Error: Unable to map reset module, spinning forever!\n");
+ for(;;);
+}
+
+
/*
* Nodes to do bus probe on, soc and localbus
*/