]> Pileus Git - ~andy/linux/blobdiff - arch/arm/kernel/process.c
Merge branch 'restart-cleanup' into restart
[~andy/linux] / arch / arm / kernel / process.c
index 3d0c6fb74ae4efe521cfc563ea11e0fa9738d465..eeb3e16c60465616067d7681a47b35f8752c4d78 100644 (file)
@@ -57,7 +57,7 @@ static const char *isa_modes[] = {
   "ARM" , "Thumb" , "Jazelle", "ThumbEE"
 };
 
-extern void setup_mm_for_reboot(char mode);
+extern void setup_mm_for_reboot(void);
 
 static volatile int hlt_counter;
 
@@ -92,7 +92,7 @@ static int __init hlt_setup(char *__unused)
 __setup("nohlt", nohlt_setup);
 __setup("hlt", hlt_setup);
 
-void arm_machine_restart(char mode, const char *cmd)
+void soft_restart(unsigned long addr)
 {
        /* Disable interrupts first */
        local_irq_disable();
@@ -103,7 +103,7 @@ void arm_machine_restart(char mode, const char *cmd)
         * we may need it to insert some 1:1 mappings so that
         * soft boot works.
         */
-       setup_mm_for_reboot(mode);
+       setup_mm_for_reboot();
 
        /* Clean and invalidate caches */
        flush_cache_all();
@@ -114,18 +114,17 @@ void arm_machine_restart(char mode, const char *cmd)
        /* Push out any further dirty data, and ensure cache is empty */
        flush_cache_all();
 
-       /*
-        * Now call the architecture specific reboot code.
-        */
-       arch_reset(mode, cmd);
+       cpu_reset(addr);
+}
 
-       /*
-        * Whoops - the architecture was unable to reboot.
-        * Tell the user!
-        */
-       mdelay(1000);
-       printk("Reboot failed -- System halted\n");
-       while (1);
+void arm_machine_restart(char mode, const char *cmd)
+{
+       /* Disable interrupts first */
+       local_irq_disable();
+       local_fiq_disable();
+
+       /* Call the architecture specific reboot code. */
+       arch_reset(mode, cmd);
 }
 
 /*
@@ -253,7 +252,15 @@ void machine_power_off(void)
 void machine_restart(char *cmd)
 {
        machine_shutdown();
+
        arm_pm_restart(reboot_mode, cmd);
+
+       /* Give a grace period for failure to restart of 1s */
+       mdelay(1000);
+
+       /* Whoops - the platform was unable to reboot. Tell the user! */
+       printk("Reboot failed -- System halted\n");
+       while (1);
 }
 
 void __show_regs(struct pt_regs *regs)