ARM: restart: spear: use new restart hook
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 5 Nov 2011 21:10:37 +0000 (21:10 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:57:20 +0000 (12:57 +0000)
Hook these platforms restart code into the new restart hook rather
than using arch_reset().

Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-spear3xx/include/mach/generic.h
arch/arm/mach-spear3xx/spear300_evb.c
arch/arm/mach-spear3xx/spear310_evb.c
arch/arm/mach-spear3xx/spear320_evb.c
arch/arm/mach-spear6xx/include/mach/generic.h
arch/arm/mach-spear6xx/spear600_evb.c
arch/arm/plat-spear/Makefile
arch/arm/plat-spear/include/plat/system.h
arch/arm/plat-spear/restart.c [new file with mode: 0644]

index b8f31c3935f7c23eae979532ea337d5c9fddac50..14276e5a98d2e2081d5ba227ceac6d5f11b6d985 100644 (file)
@@ -42,6 +42,8 @@ void __init spear3xx_map_io(void);
 void __init spear3xx_init_irq(void);
 void __init spear3xx_init(void);
 
+void spear_restart(char, const char *);
+
 /* pad mux declarations */
 #define PMX_FIRDA_MASK         (1 << 14)
 #define PMX_I2C_MASK           (1 << 13)
index a5ff98eed1db2711103b463acf5412e7b5375ee1..8b429f05b6133612e7ce43467392810674587a6a 100644 (file)
@@ -69,4 +69,5 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
        .init_irq       =       spear3xx_init_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear300_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 45d180d593620609767e98075ff59a2856487af3..a11d6ead0aed75d7fa06b45d9f581632ffa9e680 100644 (file)
@@ -75,4 +75,5 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
        .init_irq       =       spear3xx_init_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear310_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 22879848d73a35ce083ed866466c72a56e7ab6ba..4239a70686c5a049841e04165fde71b3520477f8 100644 (file)
@@ -73,4 +73,5 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
        .init_irq       =       spear3xx_init_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear320_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 183f0238c5e26c611a066ebc781fa29116590f58..116b99301cf59d059bd99f5a46fca045ab362c11 100644 (file)
@@ -41,6 +41,8 @@ void __init spear6xx_init(void);
 void __init spear600_init(void);
 void __init spear6xx_clk_init(void);
 
+void spear_restart(char, const char *);
+
 /* Add spear600 machine device structure declarations here */
 
 #endif /* __MACH_GENERIC_H */
index 8238fe38e713cf742191074dd13008b8d7755e27..0a16559ba26421510f871509c58dd2f30f1707d7 100644 (file)
@@ -48,4 +48,5 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
        .init_irq       =       spear6xx_init_irq,
        .timer          =       &spear6xx_timer,
        .init_machine   =       spear600_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index b4f340b8f1f1eeedfd630c13dba27dfe7710d51d..e0f2e5b9530c8390c264f5eba165aa6571e7120f 100644 (file)
@@ -3,6 +3,6 @@
 #
 
 # Common support
-obj-y  := clock.o time.o
+obj-y  := clock.o restart.o time.o
 
 obj-$(CONFIG_ARCH_SPEAR3XX)    += shirq.o padmux.o
index 1171f228d7188782b7be28db8b9baf21903192b0..4a0d125260a850c2a4a2a89edf70e11ccfc34952 100644 (file)
 #ifndef __PLAT_SYSTEM_H
 #define __PLAT_SYSTEM_H
 
-#include <linux/io.h>
-#include <asm/hardware/sp810.h>
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        /*
@@ -29,13 +25,6 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-       if (mode == 's') {
-               /* software reset, Jump into ROM at address 0 */
-               soft_restart(0);
-       } else {
-               /* hardware reset, Use on-chip reset capability */
-               sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
-       }
 }
 
 #endif /* __PLAT_SYSTEM_H */
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
new file mode 100644 (file)
index 0000000..2b4e3d8
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/plat-spear/restart.c
+ *
+ * SPEAr platform specific restart functions
+ *
+ * Copyright (C) 2009 ST Microelectronics
+ * Viresh Kumar<viresh.kumar@st.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+#include <linux/io.h>
+#include <asm/hardware/sp810.h>
+#include <mach/hardware.h>
+#include <mach/generic.h>
+
+void spear_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* software reset, Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               /* hardware reset, Use on-chip reset capability */
+               sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
+       }
+}