ARM: ux500: add restart support via prcmu
authorFabio Baltieri <fabio.baltieri@linaro.org>
Fri, 14 Jun 2013 13:22:40 +0000 (15:22 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 19 Aug 2013 20:49:24 +0000 (22:49 +0200)
Add necessary code to restart ux500 based machines using
prcmu_system_reset().

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/setup.h

index df5d27a532e9d8a048e7ed701d34549b38db2ea5..4e7ab3a0dd6041f250d1f37c44d5b7e774d5664f 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/platform_data/dma-ste-dma40.h>
 
 #include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 
 #include "setup.h"
 #include "devices.h"
@@ -686,6 +685,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
        .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
@@ -695,6 +695,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
        .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -705,6 +706,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
        .init_time      = ux500_timer_init,
        .init_machine   = hrefv60_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -716,4 +718,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
        .init_time      = ux500_timer_init,
        .init_machine   = snowball_init_machine,
        .init_late      = NULL,
+       .restart        = ux500_restart,
 MACHINE_END
index 12eee8167525dfd3f6e8cf6bec401408516b9dd1..03ec8a265b9055b2bddd82d2c07b53f7c382fe72 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <asm/pmu.h>
 #include <asm/mach/map.h>
-#include <asm/mach/arch.h>
 
 #include "setup.h"
 #include "devices.h"
@@ -325,6 +324,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
        .init_machine   = u8500_init_machine,
        .init_late      = NULL,
        .dt_compat      = stericsson_dt_platform_compat,
+       .restart        = ux500_restart,
 MACHINE_END
 
 #endif
index e6fb0239151bdcf5953ac74cc37a0c3b80287c42..5d7eebcabc63a12e6a699ecbe047099d95482496 100644 (file)
 #include "db8500-regs.h"
 #include "id.h"
 
+void ux500_restart(enum reboot_mode mode, const char *cmd)
+{
+       local_irq_disable();
+       local_fiq_disable();
+
+       prcmu_system_reset(0);
+}
+
 /*
  * FIXME: Should we set up the GPIO domain here?
  *
index cad3ca86c540f7eb67c454ce44f0317b80312ad3..656324aad18e229d67a3abaf36af2c04d6c85c3c 100644 (file)
 #ifndef __ASM_ARCH_SETUP_H
 #define __ASM_ARCH_SETUP_H
 
+#include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <linux/init.h>
 #include <linux/mfd/abx500/ab8500.h>
 
+void ux500_restart(enum reboot_mode mode, const char *cmd);
+
 void __init ux500_map_io(void);
 extern void __init u8500_map_io(void);