Subject: [PATCH] [5/9] pasemi: Implement restart

From: Olof Johansson <[email-masked]>
Date: Thu, 01 Feb 2007 22:54:53 -0600

Implement reset on platforms/pasemi. Default is just to reset the
cpu using the SDC registers.

Signed-off-by: Olof Johansson <[email-masked]>

Index: merge/arch/powerpc/platforms/pasemi/setup.c
===================================================================
--- merge.orig/arch/powerpc/platforms/pasemi/setup.c
+++ merge/arch/powerpc/platforms/pasemi/setup.c
@@ -42,19 +42,13 @@
 
 static void pas_restart(char *cmd)
 {
-	printk("restart unimplemented, looping...\n");
-	for (;;) ;
-}
-
-static void pas_power_off(void)
-{
-	printk("power off unimplemented, looping...\n");
-	for (;;) ;
-}
-
-static void pas_halt(void)
-{
-	pas_power_off();
+	void __iomem *sdcreg;
+	printk("Restarting...\n");
+	/* XXXOJN This should maybe come out of the device tree */
+	sdcreg = ioremap(0xfc101100, 4);
+	while (1)
+		out_le32(sdcreg, 0x6000000);
+	/* No need to iounmap; never coming back */
 }
 
 #ifdef CONFIG_SMP
@@ -220,8 +214,6 @@ define_machine(pas) {
 	.init_IRQ		= pas_init_IRQ,
 	.get_irq		= mpic_get_irq,
 	.restart		= pas_restart,
-	.power_off		= pas_power_off,
-	.halt			= pas_halt,
 	.get_boot_time		= pas_get_boot_time,
 	.calibrate_decr		= generic_calibrate_decr,
 	.check_legacy_ioport    = pas_check_legacy_ioport,

--