All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 11:58 ` Kukjin Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 11:58 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc
  Cc: 'Ben Dooks', rmk+kernel, kgene.kim

Hook these platforms restart code into the new restart hook rather
than using arch_reset().

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
 arch/arm/mach-s3c64xx/common.h                     |    2 ++
 arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
 arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
 arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
 arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
 arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
 arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
 .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
 14 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 8ae5b16..35182ba 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -44,6 +44,7 @@
 #include <plat/irq-vic-timer.h>
 #include <plat/regs-irqtype.h>
 #include <plat/regs-serial.h>
+#include <plat/watchdog-reset.h>
 
 #include "common.h"
 
@@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
 	return 0;
 }
 arch_initcall(s3c64xx_init_irq_eint);
+
+void s3c64xx_restart(char mode, const char *cmd)
+{
+	if (mode != 's')
+		arch_wdt_reset();
+
+	/* if all else fails, or mode was for soft, jump to 0 */
+	soft_restart(0);
+}
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 9f523a2..8dc8ab6 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int size);
 void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
 void s3c64xx_setup_clocks(void);
 
+void s3c64xx_restart(char mode, const char *cmd);
+
 extern struct syscore_ops s3c64xx_irq_syscore_ops;
 extern struct sysdev_class s3c64xx_sysclass;
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
index e19c584..353ed43 100644
--- a/arch/arm/mach-s3c64xx/include/mach/system.h
+++ b/arch/arm/mach-s3c64xx/include/mach/system.h
@@ -11,21 +11,9 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H __FILE__
 
-#include <plat/watchdog-reset.h>
-
 static void arch_idle(void)
 {
 	/* nothing here yet */
 }
 
-#error Fix me up
-static void arch_reset(char mode, const char *cmd)
-{
-	if (mode != 's')
-		arch_wdt_reset();
-
-	/* if all else fails, or mode was for soft, jump to 0 */
-	soft_restart(0);
-}
-
 #endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 4949bcd..a2ea6e5 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
 	.map_io		= anw6410_map_io,
 	.init_machine	= anw6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 954a44e..3615d83 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
 	.map_io		= crag6410_map_io,
 	.init_machine	= crag6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index b6231d5..8707bee 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
 	.map_io		= hmt_map_io,
 	.init_machine	= hmt_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index ed02e7e..4fba232 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
 	.map_io		= mini6410_map_io,
 	.init_machine	= mini6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 3e2391a..9ec4d57 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
 	.map_io		= ncp_map_io,
 	.init_machine	= ncp_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 0456143..0cb7116 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
 	.map_io		= real6410_map_io,
 	.init_machine	= real6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 2044a9f..f1f57bd 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq5_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index eaf24a3..63117d8 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq7_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index bda5e0b..64375d7 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
 	.map_io		= smdk6400_map_io,
 	.init_machine	= smdk6400_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 91087da..f239b0a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
 	.map_io		= smdk6410_map_io,
 	.init_machine	= smdk6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index 40dbb2b..f19aff1 100644
--- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
@@ -17,6 +17,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 static inline void arch_wdt_reset(void)
 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 11:58 ` Kukjin Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 11:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hook these platforms restart code into the new restart hook rather
than using arch_reset().

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
 arch/arm/mach-s3c64xx/common.h                     |    2 ++
 arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
 arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
 arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
 arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
 arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
 arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
 arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
 .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
 14 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 8ae5b16..35182ba 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -44,6 +44,7 @@
 #include <plat/irq-vic-timer.h>
 #include <plat/regs-irqtype.h>
 #include <plat/regs-serial.h>
+#include <plat/watchdog-reset.h>
 
 #include "common.h"
 
@@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
 	return 0;
 }
 arch_initcall(s3c64xx_init_irq_eint);
+
+void s3c64xx_restart(char mode, const char *cmd)
+{
+	if (mode != 's')
+		arch_wdt_reset();
+
+	/* if all else fails, or mode was for soft, jump to 0 */
+	soft_restart(0);
+}
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 9f523a2..8dc8ab6 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int size);
 void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
 void s3c64xx_setup_clocks(void);
 
+void s3c64xx_restart(char mode, const char *cmd);
+
 extern struct syscore_ops s3c64xx_irq_syscore_ops;
 extern struct sysdev_class s3c64xx_sysclass;
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
index e19c584..353ed43 100644
--- a/arch/arm/mach-s3c64xx/include/mach/system.h
+++ b/arch/arm/mach-s3c64xx/include/mach/system.h
@@ -11,21 +11,9 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H __FILE__
 
-#include <plat/watchdog-reset.h>
-
 static void arch_idle(void)
 {
 	/* nothing here yet */
 }
 
-#error Fix me up
-static void arch_reset(char mode, const char *cmd)
-{
-	if (mode != 's')
-		arch_wdt_reset();
-
-	/* if all else fails, or mode was for soft, jump to 0 */
-	soft_restart(0);
-}
-
 #endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 4949bcd..a2ea6e5 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
 	.map_io		= anw6410_map_io,
 	.init_machine	= anw6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 954a44e..3615d83 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
 	.map_io		= crag6410_map_io,
 	.init_machine	= crag6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index b6231d5..8707bee 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
 	.map_io		= hmt_map_io,
 	.init_machine	= hmt_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index ed02e7e..4fba232 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
 	.map_io		= mini6410_map_io,
 	.init_machine	= mini6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 3e2391a..9ec4d57 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
 	.map_io		= ncp_map_io,
 	.init_machine	= ncp_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 0456143..0cb7116 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
 	.map_io		= real6410_map_io,
 	.init_machine	= real6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 2044a9f..f1f57bd 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq5_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index eaf24a3..63117d8 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq7_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index bda5e0b..64375d7 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
 	.map_io		= smdk6400_map_io,
 	.init_machine	= smdk6400_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 91087da..f239b0a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
 	.map_io		= smdk6410_map_io,
 	.init_machine	= smdk6410_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index 40dbb2b..f19aff1 100644
--- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
@@ -17,6 +17,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 static inline void arch_wdt_reset(void)
 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM: restart: S3C64XX: use new restart hook
  2011-12-19 11:58 ` Kukjin Kim
@ 2011-12-19 12:12   ` Heiko Stübner
  -1 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:12 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks', rmk+kernel

Hi Kgene,

will you also do s3c24xx?

I'm asking, as I'm currently also looking at this for the 24xx arches and 
would like to prevent double work on both our sides.

Thanks
Heiko

Am Montag, 19. Dezember 2011, 12:58:20 schrieb Kukjin Kim:
> Hook these platforms restart code into the new restart hook rather
> than using arch_reset().
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>  arch/arm/mach-s3c64xx/common.h                     |    2 ++
>  arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>  arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>  .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>  14 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/common.c
> b/arch/arm/mach-s3c64xx/common.c index 8ae5b16..35182ba 100644
> --- a/arch/arm/mach-s3c64xx/common.c
> +++ b/arch/arm/mach-s3c64xx/common.c
> @@ -44,6 +44,7 @@
>  #include <plat/irq-vic-timer.h>
>  #include <plat/regs-irqtype.h>
>  #include <plat/regs-serial.h>
> +#include <plat/watchdog-reset.h>
> 
>  #include "common.h"
> 
> @@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
>  	return 0;
>  }
>  arch_initcall(s3c64xx_init_irq_eint);
> +
> +void s3c64xx_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	/* if all else fails, or mode was for soft, jump to 0 */
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/mach-s3c64xx/common.h
> b/arch/arm/mach-s3c64xx/common.h index 9f523a2..8dc8ab6 100644
> --- a/arch/arm/mach-s3c64xx/common.h
> +++ b/arch/arm/mach-s3c64xx/common.h
> @@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int
> size); void s3c64xx_register_clocks(unsigned long xtal, unsigned
> armclk_limit); void s3c64xx_setup_clocks(void);
> 
> +void s3c64xx_restart(char mode, const char *cmd);
> +
>  extern struct syscore_ops s3c64xx_irq_syscore_ops;
>  extern struct sysdev_class s3c64xx_sysclass;
> 
> diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h
> b/arch/arm/mach-s3c64xx/include/mach/system.h index e19c584..353ed43
> 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> @@ -11,21 +11,9 @@
>  #ifndef __ASM_ARCH_SYSTEM_H
>  #define __ASM_ARCH_SYSTEM_H __FILE__
> 
> -#include <plat/watchdog-reset.h>
> -
>  static void arch_idle(void)
>  {
>  	/* nothing here yet */
>  }
> 
> -#error Fix me up
> -static void arch_reset(char mode, const char *cmd)
> -{
> -	if (mode != 's')
> -		arch_wdt_reset();
> -
> -	/* if all else fails, or mode was for soft, jump to 0 */
> -	soft_restart(0);
> -}
> -
>  #endif /* __ASM_ARCH_IRQ_H */
> diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c
> b/arch/arm/mach-s3c64xx/mach-anw6410.c index 4949bcd..a2ea6e5 100644
> --- a/arch/arm/mach-s3c64xx/mach-anw6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
> @@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
>  	.map_io		= anw6410_map_io,
>  	.init_machine	= anw6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c
> b/arch/arm/mach-s3c64xx/mach-crag6410.c index 954a44e..3615d83 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore
> 6410") .map_io		= crag6410_map_io,
>  	.init_machine	= crag6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c
> b/arch/arm/mach-s3c64xx/mach-hmt.c index b6231d5..8707bee 100644
> --- a/arch/arm/mach-s3c64xx/mach-hmt.c
> +++ b/arch/arm/mach-s3c64xx/mach-hmt.c
> @@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
>  	.map_io		= hmt_map_io,
>  	.init_machine	= hmt_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c
> b/arch/arm/mach-s3c64xx/mach-mini6410.c index ed02e7e..4fba232 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
>  	.map_io		= mini6410_map_io,
>  	.init_machine	= mini6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c
> b/arch/arm/mach-s3c64xx/mach-ncp.c index 3e2391a..9ec4d57 100644
> --- a/arch/arm/mach-s3c64xx/mach-ncp.c
> +++ b/arch/arm/mach-s3c64xx/mach-ncp.c
> @@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
>  	.map_io		= ncp_map_io,
>  	.init_machine	= ncp_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c
> b/arch/arm/mach-s3c64xx/mach-real6410.c index 0456143..0cb7116 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
>  	.map_io		= real6410_map_io,
>  	.init_machine	= real6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c
> b/arch/arm/mach-s3c64xx/mach-smartq5.c index 2044a9f..f1f57bd 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq5.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
> @@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq5_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c
> b/arch/arm/mach-s3c64xx/mach-smartq7.c index eaf24a3..63117d8 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq7.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
> @@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq7_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> b/arch/arm/mach-s3c64xx/mach-smdk6400.c index bda5e0b..64375d7 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> @@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
>  	.map_io		= smdk6400_map_io,
>  	.init_machine	= smdk6400_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> b/arch/arm/mach-s3c64xx/mach-smdk6410.c index 91087da..f239b0a 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
>  	.map_io		= smdk6410_map_io,
>  	.init_machine	= smdk6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> b/arch/arm/plat-samsung/include/plat/watchdog-reset.h index
> 40dbb2b..f19aff1 100644
> --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> @@ -17,6 +17,7 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/delay.h>
> 
>  static inline void arch_wdt_reset(void)
>  {

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 12:12   ` Heiko Stübner
  0 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kgene,

will you also do s3c24xx?

I'm asking, as I'm currently also looking at this for the 24xx arches and 
would like to prevent double work on both our sides.

Thanks
Heiko

Am Montag, 19. Dezember 2011, 12:58:20 schrieb Kukjin Kim:
> Hook these platforms restart code into the new restart hook rather
> than using arch_reset().
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>  arch/arm/mach-s3c64xx/common.h                     |    2 ++
>  arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>  arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>  .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>  14 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/common.c
> b/arch/arm/mach-s3c64xx/common.c index 8ae5b16..35182ba 100644
> --- a/arch/arm/mach-s3c64xx/common.c
> +++ b/arch/arm/mach-s3c64xx/common.c
> @@ -44,6 +44,7 @@
>  #include <plat/irq-vic-timer.h>
>  #include <plat/regs-irqtype.h>
>  #include <plat/regs-serial.h>
> +#include <plat/watchdog-reset.h>
> 
>  #include "common.h"
> 
> @@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
>  	return 0;
>  }
>  arch_initcall(s3c64xx_init_irq_eint);
> +
> +void s3c64xx_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	/* if all else fails, or mode was for soft, jump to 0 */
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/mach-s3c64xx/common.h
> b/arch/arm/mach-s3c64xx/common.h index 9f523a2..8dc8ab6 100644
> --- a/arch/arm/mach-s3c64xx/common.h
> +++ b/arch/arm/mach-s3c64xx/common.h
> @@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int
> size); void s3c64xx_register_clocks(unsigned long xtal, unsigned
> armclk_limit); void s3c64xx_setup_clocks(void);
> 
> +void s3c64xx_restart(char mode, const char *cmd);
> +
>  extern struct syscore_ops s3c64xx_irq_syscore_ops;
>  extern struct sysdev_class s3c64xx_sysclass;
> 
> diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h
> b/arch/arm/mach-s3c64xx/include/mach/system.h index e19c584..353ed43
> 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> @@ -11,21 +11,9 @@
>  #ifndef __ASM_ARCH_SYSTEM_H
>  #define __ASM_ARCH_SYSTEM_H __FILE__
> 
> -#include <plat/watchdog-reset.h>
> -
>  static void arch_idle(void)
>  {
>  	/* nothing here yet */
>  }
> 
> -#error Fix me up
> -static void arch_reset(char mode, const char *cmd)
> -{
> -	if (mode != 's')
> -		arch_wdt_reset();
> -
> -	/* if all else fails, or mode was for soft, jump to 0 */
> -	soft_restart(0);
> -}
> -
>  #endif /* __ASM_ARCH_IRQ_H */
> diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c
> b/arch/arm/mach-s3c64xx/mach-anw6410.c index 4949bcd..a2ea6e5 100644
> --- a/arch/arm/mach-s3c64xx/mach-anw6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
> @@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
>  	.map_io		= anw6410_map_io,
>  	.init_machine	= anw6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c
> b/arch/arm/mach-s3c64xx/mach-crag6410.c index 954a44e..3615d83 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore
> 6410") .map_io		= crag6410_map_io,
>  	.init_machine	= crag6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c
> b/arch/arm/mach-s3c64xx/mach-hmt.c index b6231d5..8707bee 100644
> --- a/arch/arm/mach-s3c64xx/mach-hmt.c
> +++ b/arch/arm/mach-s3c64xx/mach-hmt.c
> @@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
>  	.map_io		= hmt_map_io,
>  	.init_machine	= hmt_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c
> b/arch/arm/mach-s3c64xx/mach-mini6410.c index ed02e7e..4fba232 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
>  	.map_io		= mini6410_map_io,
>  	.init_machine	= mini6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c
> b/arch/arm/mach-s3c64xx/mach-ncp.c index 3e2391a..9ec4d57 100644
> --- a/arch/arm/mach-s3c64xx/mach-ncp.c
> +++ b/arch/arm/mach-s3c64xx/mach-ncp.c
> @@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
>  	.map_io		= ncp_map_io,
>  	.init_machine	= ncp_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c
> b/arch/arm/mach-s3c64xx/mach-real6410.c index 0456143..0cb7116 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
>  	.map_io		= real6410_map_io,
>  	.init_machine	= real6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c
> b/arch/arm/mach-s3c64xx/mach-smartq5.c index 2044a9f..f1f57bd 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq5.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
> @@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq5_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c
> b/arch/arm/mach-s3c64xx/mach-smartq7.c index eaf24a3..63117d8 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq7.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
> @@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq7_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> b/arch/arm/mach-s3c64xx/mach-smdk6400.c index bda5e0b..64375d7 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> @@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
>  	.map_io		= smdk6400_map_io,
>  	.init_machine	= smdk6400_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> b/arch/arm/mach-s3c64xx/mach-smdk6410.c index 91087da..f239b0a 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
>  	.map_io		= smdk6410_map_io,
>  	.init_machine	= smdk6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> b/arch/arm/plat-samsung/include/plat/watchdog-reset.h index
> 40dbb2b..f19aff1 100644
> --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> @@ -17,6 +17,7 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/delay.h>
> 
>  static inline void arch_wdt_reset(void)
>  {

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH] ARM: restart: S3C64XX: use new restart hook
  2011-12-19 12:12   ` Heiko Stübner
@ 2011-12-19 12:20     ` Kukjin Kim
  -1 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 12:20 UTC (permalink / raw)
  To: 'Heiko Stübner'
  Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks', rmk+kernel

Heiko Stübner wrote:
> 
> Hi Kgene,
> 
> will you also do s3c24xx?
> 
> I'm asking, as I'm currently also looking at this for the 24xx arches and
> would like to prevent double work on both our sides.
> 
Sure, I'm sorting out all of Samsung stuff and it will be done tomorrow :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 12:20     ` Kukjin Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Heiko St?bner wrote:
> 
> Hi Kgene,
> 
> will you also do s3c24xx?
> 
> I'm asking, as I'm currently also looking at this for the 24xx arches and
> would like to prevent double work on both our sides.
> 
Sure, I'm sorting out all of Samsung stuff and it will be done tomorrow :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc  hook
  2011-12-19 12:20     ` Kukjin Kim
@ 2011-12-19 12:25       ` Heiko Stübner
  -1 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:25 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks', rmk+kernel

S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
the processor and used therefore the s3c24xx_reset_hook mechanism in the
s3c24xx-specific arch reset.

This patch introduces restart functions for these architectures,
moves the board files to them and removes the s3c24xx_reset_hook
infrastructure, as all users are gone.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
@Kgene: This is my first cleanup step, done before your s3c64xx mail arrived,
which transforms the 2412,2416 and 2443 arches which use the special SWRST
register to do the reset. Just if it helps :-)

 arch/arm/mach-s3c2410/include/mach/reset.h        |   22 ---------------------
 arch/arm/mach-s3c2410/include/mach/system-reset.h |    5 ----
 arch/arm/mach-s3c2410/include/mach/system.h       |    2 -
 arch/arm/mach-s3c2412/mach-jive.c                 |    2 +
 arch/arm/mach-s3c2412/mach-smdk2413.c             |    3 ++
 arch/arm/mach-s3c2412/mach-vstms.c                |    1 +
 arch/arm/mach-s3c2412/s3c2412.c                   |   10 +++-----
 arch/arm/mach-s3c2416/mach-smdk2416.c             |    1 +
 arch/arm/mach-s3c2416/s3c2416.c                   |    7 +++--
 arch/arm/mach-s3c2443/mach-smdk2443.c             |    1 +
 arch/arm/mach-s3c2443/s3c2443.c                   |    8 +++---
 arch/arm/plat-samsung/include/plat/s3c2412.h      |    3 ++
 arch/arm/plat-samsung/include/plat/s3c2416.h      |    2 +
 arch/arm/plat-samsung/include/plat/s3c2443.h      |    2 +
 14 files changed, 27 insertions(+), 42 deletions(-)
 delete mode 100644 arch/arm/mach-s3c2410/include/mach/reset.h

diff --git a/arch/arm/mach-s3c2410/include/mach/reset.h b/arch/arm/mach-s3c2410/include/mach/reset.h
deleted file mode 100644
index f8c9387..0000000
--- a/arch/arm/mach-s3c2410/include/mach/reset.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/reset.h
- *
- * Copyright (c) 2007 Simtec Electronics
- *	Ben Dooks <ben@simtec.co.uk>
- *	http://armlinux.simtec.co.uk/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * S3C2410 CPU reset controls
-*/
-
-#ifndef __ASM_ARCH_RESET_H
-#define __ASM_ARCH_RESET_H __FILE__
-
-/* This allows the over-ride of the default reset code
-*/
-
-extern void (*s3c24xx_reset_hook)(void);
-
-#endif /* __ASM_ARCH_RESET_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
index ec0cee7..d226abd 100644
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h
@@ -13,8 +13,6 @@
 #include <mach/hardware.h>
 #include <plat/watchdog-reset.h>
 
-extern void (*s3c24xx_reset_hook)(void);
-
 #error Fix me up
 static void
 arch_reset(char mode, const char *cmd)
@@ -23,9 +21,6 @@ arch_reset(char mode, const char *cmd)
 		soft_restart(0);
 	}
 
-	if (s3c24xx_reset_hook)
-		s3c24xx_reset_hook();
-
 	arch_wdt_reset();
 
 	/* we'll take a jump through zero as a poor second */
diff --git a/arch/arm/mach-s3c2410/include/mach/system.h b/arch/arm/mach-s3c2410/include/mach/system.h
index a8cbca6..eef8f24 100644
--- a/arch/arm/mach-s3c2410/include/mach/system.h
+++ b/arch/arm/mach-s3c2410/include/mach/system.h
@@ -15,12 +15,10 @@
 
 #include <mach/map.h>
 #include <mach/idle.h>
-#include <mach/reset.h>
 
 #include <mach/regs-clock.h>
 
 void (*s3c24xx_idle)(void);
-void (*s3c24xx_reset_hook)(void);
 
 void s3c24xx_default_idle(void)
 {
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 286ef17..ae73ba3 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -48,6 +48,7 @@
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 
+#include <plat/s3c2412.h>
 #include <plat/gpio-cfg.h>
 #include <plat/clock.h>
 #include <plat/devs.h>
@@ -661,4 +662,5 @@ MACHINE_START(JIVE, "JIVE")
 	.map_io		= jive_map_io,
 	.init_machine	= jive_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index f1eec1b..b11451b 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -134,6 +134,7 @@ MACHINE_START(S3C2413, "S3C2413")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
 
 MACHINE_START(SMDK2412, "SMDK2412")
@@ -145,6 +146,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
 
 MACHINE_START(SMDK2413, "SMDK2413")
@@ -156,4 +158,5 @@ MACHINE_START(SMDK2413, "SMDK2413")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 1bbb1ef..94bfaa1 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -162,4 +162,5 @@ MACHINE_START(VSTMS, "VSTMS")
 	.init_machine	= vstms_init,
 	.map_io		= vstms_map_io,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 57a1e01..867ce2e 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -32,7 +32,6 @@
 #include <asm/proc-fns.h>
 #include <asm/irq.h>
 
-#include <mach/reset.h>
 #include <mach/idle.h>
 
 #include <plat/cpu-freq.h>
@@ -131,8 +130,11 @@ static void s3c2412_idle(void)
 	cpu_do_idle();
 }
 
-static void s3c2412_hard_reset(void)
+void s3c2412_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	/* errata "Watch-dog/Software Reset Problem" specifies that
 	 * this reset must be done with the SYSCLK sourced from
 	 * EXTCLK instead of FOUT to avoid a glitch in the reset
@@ -164,10 +166,6 @@ void __init s3c2412_map_io(void)
 
 	s3c24xx_idle = s3c2412_idle;
 
-	/* set custom reset hook */
-
-	s3c24xx_reset_hook = s3c2412_hard_reset;
-
 	/* register our io-tables */
 
 	iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index a9eee53..66b7173 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -251,4 +251,5 @@ MACHINE_START(SMDK2416, "SMDK2416")
 	.map_io		= smdk2416_map_io,
 	.init_machine	= smdk2416_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2416_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index ee214bc..4606223 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -44,7 +44,6 @@
 #include <asm/proc-fns.h>
 #include <asm/irq.h>
 
-#include <mach/reset.h>
 #include <mach/idle.h>
 #include <mach/regs-s3c2443-clock.h>
 
@@ -76,8 +75,11 @@ static struct sys_device s3c2416_sysdev = {
 	.cls		= &s3c2416_sysclass,
 };
 
-static void s3c2416_hard_reset(void)
+void s3c2416_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	__raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
 }
 
@@ -85,7 +87,6 @@ int __init s3c2416_init(void)
 {
 	printk(KERN_INFO "S3C2416: Initializing architecture\n");
 
-	s3c24xx_reset_hook = s3c2416_hard_reset;
 	/* s3c24xx_idle = s3c2416_idle;	*/
 
 	/* change WDT IRQ number */
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index bec107e..2092369 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -145,4 +145,5 @@ MACHINE_START(SMDK2443, "SMDK2443")
 	.map_io		= smdk2443_map_io,
 	.init_machine	= smdk2443_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2443_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index a22b771..4568ded 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -31,7 +31,6 @@
 #include <asm/irq.h>
 
 #include <mach/regs-s3c2443-clock.h>
-#include <mach/reset.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
@@ -57,8 +56,11 @@ static struct sys_device s3c2443_sysdev = {
 	.cls		= &s3c2443_sysclass,
 };
 
-static void s3c2443_hard_reset(void)
+void s3c2443_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	__raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
 }
 
@@ -66,8 +68,6 @@ int __init s3c2443_init(void)
 {
 	printk("S3C2443: Initialising architecture\n");
 
-	s3c24xx_reset_hook = s3c2443_hard_reset;
-
 	s3c_nand_setname("s3c2412-nand");
 	s3c_fb_setname("s3c2443-fb");
 
diff --git a/arch/arm/plat-samsung/include/plat/s3c2412.h b/arch/arm/plat-samsung/include/plat/s3c2412.h
index 5bcfd14..cbae50d 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2412.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2412.h
@@ -21,9 +21,12 @@ extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 extern void s3c2412_init_clocks(int xtal);
 
 extern  int s3c2412_baseclk_add(void);
+
+extern void s3c2412_restart(char mode, const char *cmd);
 #else
 #define s3c2412_init_clocks NULL
 #define s3c2412_init_uarts NULL
 #define s3c2412_map_io NULL
 #define s3c2412_init NULL
+#define s3c2412_restart NULL
 #endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h
index a764f85..de2b5bd 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -23,9 +23,11 @@ extern void s3c2416_init_clocks(int xtal);
 
 extern  int s3c2416_baseclk_add(void);
 
+extern void s3c2416_restart(char mode, const char *cmd);
 #else
 #define s3c2416_init_clocks NULL
 #define s3c2416_init_uarts NULL
 #define s3c2416_map_io NULL
 #define s3c2416_init NULL
+#define s3c2416_restart NULL
 #endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index 7fae1a0..dce05b4 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -24,11 +24,13 @@ extern void s3c2443_init_clocks(int xtal);
 
 extern  int s3c2443_baseclk_add(void);
 
+extern void s3c2443_restart(char mode, const char *cmd);
 #else
 #define s3c2443_init_clocks NULL
 #define s3c2443_init_uarts NULL
 #define s3c2443_map_io NULL
 #define s3c2443_init NULL
+#define s3c2443_restart NULL
 #endif
 
 /* common code used by s3c2443 and others.
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook
@ 2011-12-19 12:25       ` Heiko Stübner
  0 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
the processor and used therefore the s3c24xx_reset_hook mechanism in the
s3c24xx-specific arch reset.

This patch introduces restart functions for these architectures,
moves the board files to them and removes the s3c24xx_reset_hook
infrastructure, as all users are gone.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
@Kgene: This is my first cleanup step, done before your s3c64xx mail arrived,
which transforms the 2412,2416 and 2443 arches which use the special SWRST
register to do the reset. Just if it helps :-)

 arch/arm/mach-s3c2410/include/mach/reset.h        |   22 ---------------------
 arch/arm/mach-s3c2410/include/mach/system-reset.h |    5 ----
 arch/arm/mach-s3c2410/include/mach/system.h       |    2 -
 arch/arm/mach-s3c2412/mach-jive.c                 |    2 +
 arch/arm/mach-s3c2412/mach-smdk2413.c             |    3 ++
 arch/arm/mach-s3c2412/mach-vstms.c                |    1 +
 arch/arm/mach-s3c2412/s3c2412.c                   |   10 +++-----
 arch/arm/mach-s3c2416/mach-smdk2416.c             |    1 +
 arch/arm/mach-s3c2416/s3c2416.c                   |    7 +++--
 arch/arm/mach-s3c2443/mach-smdk2443.c             |    1 +
 arch/arm/mach-s3c2443/s3c2443.c                   |    8 +++---
 arch/arm/plat-samsung/include/plat/s3c2412.h      |    3 ++
 arch/arm/plat-samsung/include/plat/s3c2416.h      |    2 +
 arch/arm/plat-samsung/include/plat/s3c2443.h      |    2 +
 14 files changed, 27 insertions(+), 42 deletions(-)
 delete mode 100644 arch/arm/mach-s3c2410/include/mach/reset.h

diff --git a/arch/arm/mach-s3c2410/include/mach/reset.h b/arch/arm/mach-s3c2410/include/mach/reset.h
deleted file mode 100644
index f8c9387..0000000
--- a/arch/arm/mach-s3c2410/include/mach/reset.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/reset.h
- *
- * Copyright (c) 2007 Simtec Electronics
- *	Ben Dooks <ben@simtec.co.uk>
- *	http://armlinux.simtec.co.uk/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * S3C2410 CPU reset controls
-*/
-
-#ifndef __ASM_ARCH_RESET_H
-#define __ASM_ARCH_RESET_H __FILE__
-
-/* This allows the over-ride of the default reset code
-*/
-
-extern void (*s3c24xx_reset_hook)(void);
-
-#endif /* __ASM_ARCH_RESET_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
index ec0cee7..d226abd 100644
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h
@@ -13,8 +13,6 @@
 #include <mach/hardware.h>
 #include <plat/watchdog-reset.h>
 
-extern void (*s3c24xx_reset_hook)(void);
-
 #error Fix me up
 static void
 arch_reset(char mode, const char *cmd)
@@ -23,9 +21,6 @@ arch_reset(char mode, const char *cmd)
 		soft_restart(0);
 	}
 
-	if (s3c24xx_reset_hook)
-		s3c24xx_reset_hook();
-
 	arch_wdt_reset();
 
 	/* we'll take a jump through zero as a poor second */
diff --git a/arch/arm/mach-s3c2410/include/mach/system.h b/arch/arm/mach-s3c2410/include/mach/system.h
index a8cbca6..eef8f24 100644
--- a/arch/arm/mach-s3c2410/include/mach/system.h
+++ b/arch/arm/mach-s3c2410/include/mach/system.h
@@ -15,12 +15,10 @@
 
 #include <mach/map.h>
 #include <mach/idle.h>
-#include <mach/reset.h>
 
 #include <mach/regs-clock.h>
 
 void (*s3c24xx_idle)(void);
-void (*s3c24xx_reset_hook)(void);
 
 void s3c24xx_default_idle(void)
 {
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 286ef17..ae73ba3 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -48,6 +48,7 @@
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 
+#include <plat/s3c2412.h>
 #include <plat/gpio-cfg.h>
 #include <plat/clock.h>
 #include <plat/devs.h>
@@ -661,4 +662,5 @@ MACHINE_START(JIVE, "JIVE")
 	.map_io		= jive_map_io,
 	.init_machine	= jive_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index f1eec1b..b11451b 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -134,6 +134,7 @@ MACHINE_START(S3C2413, "S3C2413")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
 
 MACHINE_START(SMDK2412, "SMDK2412")
@@ -145,6 +146,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
 
 MACHINE_START(SMDK2413, "SMDK2413")
@@ -156,4 +158,5 @@ MACHINE_START(SMDK2413, "SMDK2413")
 	.map_io		= smdk2413_map_io,
 	.init_machine	= smdk2413_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 1bbb1ef..94bfaa1 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -162,4 +162,5 @@ MACHINE_START(VSTMS, "VSTMS")
 	.init_machine	= vstms_init,
 	.map_io		= vstms_map_io,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2412_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 57a1e01..867ce2e 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -32,7 +32,6 @@
 #include <asm/proc-fns.h>
 #include <asm/irq.h>
 
-#include <mach/reset.h>
 #include <mach/idle.h>
 
 #include <plat/cpu-freq.h>
@@ -131,8 +130,11 @@ static void s3c2412_idle(void)
 	cpu_do_idle();
 }
 
-static void s3c2412_hard_reset(void)
+void s3c2412_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	/* errata "Watch-dog/Software Reset Problem" specifies that
 	 * this reset must be done with the SYSCLK sourced from
 	 * EXTCLK instead of FOUT to avoid a glitch in the reset
@@ -164,10 +166,6 @@ void __init s3c2412_map_io(void)
 
 	s3c24xx_idle = s3c2412_idle;
 
-	/* set custom reset hook */
-
-	s3c24xx_reset_hook = s3c2412_hard_reset;
-
 	/* register our io-tables */
 
 	iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index a9eee53..66b7173 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -251,4 +251,5 @@ MACHINE_START(SMDK2416, "SMDK2416")
 	.map_io		= smdk2416_map_io,
 	.init_machine	= smdk2416_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2416_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index ee214bc..4606223 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -44,7 +44,6 @@
 #include <asm/proc-fns.h>
 #include <asm/irq.h>
 
-#include <mach/reset.h>
 #include <mach/idle.h>
 #include <mach/regs-s3c2443-clock.h>
 
@@ -76,8 +75,11 @@ static struct sys_device s3c2416_sysdev = {
 	.cls		= &s3c2416_sysclass,
 };
 
-static void s3c2416_hard_reset(void)
+void s3c2416_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	__raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
 }
 
@@ -85,7 +87,6 @@ int __init s3c2416_init(void)
 {
 	printk(KERN_INFO "S3C2416: Initializing architecture\n");
 
-	s3c24xx_reset_hook = s3c2416_hard_reset;
 	/* s3c24xx_idle = s3c2416_idle;	*/
 
 	/* change WDT IRQ number */
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index bec107e..2092369 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -145,4 +145,5 @@ MACHINE_START(SMDK2443, "SMDK2443")
 	.map_io		= smdk2443_map_io,
 	.init_machine	= smdk2443_machine_init,
 	.timer		= &s3c24xx_timer,
+	.restart	= s3c2443_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index a22b771..4568ded 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -31,7 +31,6 @@
 #include <asm/irq.h>
 
 #include <mach/regs-s3c2443-clock.h>
-#include <mach/reset.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
@@ -57,8 +56,11 @@ static struct sys_device s3c2443_sysdev = {
 	.cls		= &s3c2443_sysclass,
 };
 
-static void s3c2443_hard_reset(void)
+void s3c2443_restart(char mode, const char *cmd)
 {
+	if (mode == 's')
+		soft_restart(0);
+
 	__raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
 }
 
@@ -66,8 +68,6 @@ int __init s3c2443_init(void)
 {
 	printk("S3C2443: Initialising architecture\n");
 
-	s3c24xx_reset_hook = s3c2443_hard_reset;
-
 	s3c_nand_setname("s3c2412-nand");
 	s3c_fb_setname("s3c2443-fb");
 
diff --git a/arch/arm/plat-samsung/include/plat/s3c2412.h b/arch/arm/plat-samsung/include/plat/s3c2412.h
index 5bcfd14..cbae50d 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2412.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2412.h
@@ -21,9 +21,12 @@ extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 extern void s3c2412_init_clocks(int xtal);
 
 extern  int s3c2412_baseclk_add(void);
+
+extern void s3c2412_restart(char mode, const char *cmd);
 #else
 #define s3c2412_init_clocks NULL
 #define s3c2412_init_uarts NULL
 #define s3c2412_map_io NULL
 #define s3c2412_init NULL
+#define s3c2412_restart NULL
 #endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h
index a764f85..de2b5bd 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -23,9 +23,11 @@ extern void s3c2416_init_clocks(int xtal);
 
 extern  int s3c2416_baseclk_add(void);
 
+extern void s3c2416_restart(char mode, const char *cmd);
 #else
 #define s3c2416_init_clocks NULL
 #define s3c2416_init_uarts NULL
 #define s3c2416_map_io NULL
 #define s3c2416_init NULL
+#define s3c2416_restart NULL
 #endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index 7fae1a0..dce05b4 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -24,11 +24,13 @@ extern void s3c2443_init_clocks(int xtal);
 
 extern  int s3c2443_baseclk_add(void);
 
+extern void s3c2443_restart(char mode, const char *cmd);
 #else
 #define s3c2443_init_clocks NULL
 #define s3c2443_init_uarts NULL
 #define s3c2443_map_io NULL
 #define s3c2443_init NULL
+#define s3c2443_restart NULL
 #endif
 
 /* common code used by s3c2443 and others.
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* RE: [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook
  2011-12-19 12:25       ` Heiko Stübner
@ 2011-12-19 12:42         ` Kukjin Kim
  -1 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 12:42 UTC (permalink / raw)
  To: 'Heiko Stübner'
  Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks', rmk+kernel

Heiko Stübner wrote:

> 
> S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
> the processor and used therefore the s3c24xx_reset_hook mechanism in the
> s3c24xx-specific arch reset.
> 
> This patch introduces restart functions for these architectures,
> moves the board files to them and removes the s3c24xx_reset_hook
> infrastructure, as all users are gone.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> @Kgene: This is my first cleanup step, done before your s3c64xx mail
> arrived,
> which transforms the 2412,2416 and 2443 arches which use the special SWRST
> register to do the reset. Just if it helps :-)
> 
Heiko, thanks.

I'm looking at S5P SoCs now and of course this helps. And if possible, let
me do it with this.

As a note, we need to implement local header file before using new restart
hook and I'm thinking which one is better to us between all s3c24xx SoCs'
common or each mach-s3c24xx's one.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


>  arch/arm/mach-s3c2410/include/mach/reset.h        |   22
-------------------
> --
>  arch/arm/mach-s3c2410/include/mach/system-reset.h |    5 ----
>  arch/arm/mach-s3c2410/include/mach/system.h       |    2 -
>  arch/arm/mach-s3c2412/mach-jive.c                 |    2 +
>  arch/arm/mach-s3c2412/mach-smdk2413.c             |    3 ++
>  arch/arm/mach-s3c2412/mach-vstms.c                |    1 +
>  arch/arm/mach-s3c2412/s3c2412.c                   |   10 +++-----
>  arch/arm/mach-s3c2416/mach-smdk2416.c             |    1 +
>  arch/arm/mach-s3c2416/s3c2416.c                   |    7 +++--
>  arch/arm/mach-s3c2443/mach-smdk2443.c             |    1 +
>  arch/arm/mach-s3c2443/s3c2443.c                   |    8 +++---
>  arch/arm/plat-samsung/include/plat/s3c2412.h      |    3 ++
>  arch/arm/plat-samsung/include/plat/s3c2416.h      |    2 +
>  arch/arm/plat-samsung/include/plat/s3c2443.h      |    2 +
>  14 files changed, 27 insertions(+), 42 deletions(-)
>  delete mode 100644 arch/arm/mach-s3c2410/include/mach/reset.h

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook
@ 2011-12-19 12:42         ` Kukjin Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 12:42 UTC (permalink / raw)
  To: linux-arm-kernel

Heiko St?bner wrote:

> 
> S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
> the processor and used therefore the s3c24xx_reset_hook mechanism in the
> s3c24xx-specific arch reset.
> 
> This patch introduces restart functions for these architectures,
> moves the board files to them and removes the s3c24xx_reset_hook
> infrastructure, as all users are gone.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> @Kgene: This is my first cleanup step, done before your s3c64xx mail
> arrived,
> which transforms the 2412,2416 and 2443 arches which use the special SWRST
> register to do the reset. Just if it helps :-)
> 
Heiko, thanks.

I'm looking at S5P SoCs now and of course this helps. And if possible, let
me do it with this.

As a note, we need to implement local header file before using new restart
hook and I'm thinking which one is better to us between all s3c24xx SoCs'
common or each mach-s3c24xx's one.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


>  arch/arm/mach-s3c2410/include/mach/reset.h        |   22
-------------------
> --
>  arch/arm/mach-s3c2410/include/mach/system-reset.h |    5 ----
>  arch/arm/mach-s3c2410/include/mach/system.h       |    2 -
>  arch/arm/mach-s3c2412/mach-jive.c                 |    2 +
>  arch/arm/mach-s3c2412/mach-smdk2413.c             |    3 ++
>  arch/arm/mach-s3c2412/mach-vstms.c                |    1 +
>  arch/arm/mach-s3c2412/s3c2412.c                   |   10 +++-----
>  arch/arm/mach-s3c2416/mach-smdk2416.c             |    1 +
>  arch/arm/mach-s3c2416/s3c2416.c                   |    7 +++--
>  arch/arm/mach-s3c2443/mach-smdk2443.c             |    1 +
>  arch/arm/mach-s3c2443/s3c2443.c                   |    8 +++---
>  arch/arm/plat-samsung/include/plat/s3c2412.h      |    3 ++
>  arch/arm/plat-samsung/include/plat/s3c2416.h      |    2 +
>  arch/arm/plat-samsung/include/plat/s3c2443.h      |    2 +
>  14 files changed, 27 insertions(+), 42 deletions(-)
>  delete mode 100644 arch/arm/mach-s3c2410/include/mach/reset.h

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook
  2011-12-19 12:42         ` Kukjin Kim
@ 2011-12-19 12:58           ` Heiko Stübner
  -1 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:58 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks', rmk+kernel

Am Montag, 19. Dezember 2011, 13:42:24 schrieb Kukjin Kim:
> Heiko Stübner wrote:
> > S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
> > the processor and used therefore the s3c24xx_reset_hook mechanism in the
> > s3c24xx-specific arch reset.
> > 
> > This patch introduces restart functions for these architectures,
> > moves the board files to them and removes the s3c24xx_reset_hook
> > infrastructure, as all users are gone.
> > 
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > @Kgene: This is my first cleanup step, done before your s3c64xx mail
> > arrived,
> > which transforms the 2412,2416 and 2443 arches which use the special
> > SWRST register to do the reset. Just if it helps :-)
> 
> Heiko, thanks.
> 
> I'm looking at S5P SoCs now and of course this helps. And if possible, let
> me do it with this.
>
> As a note, we need to implement local header file before using new restart
> hook and I'm thinking which one is better to us between all s3c24xx SoCs'
> common or each mach-s3c24xx's one.
For the three arches in the patch I put the function declaration into
s3c2412.h/s3c2416.h/s3c2443.h . They all use a SWRST register, but its
position and the value needed to be written to it differs for each SoC, so
they need to be separate like in the patch.
So these three arches do not seem to need a new header and seem to be ok
with this patch.


The other two S3C24xx-arches (s3c2410 and s3c2440) all use arch_wdt_reset
to do the reset, so I thought about declaring a 

void s3c24xx_default_restart(char mode, const char *cmd)
{
	if (mode == 's') {
		soft_restart(0);
	}

	arch_wdt_reset();

	/* we'll take a jump through zero as a poor second */
	soft_restart(0);
}

for these.

I thought about putting it into plat-s3c24xx/cpu.c and its extern
declaration into plat-samsung/include/plat/cpu.h, but I'm not really sure
if this would be the correct location.


Heiko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook
@ 2011-12-19 12:58           ` Heiko Stübner
  0 siblings, 0 replies; 16+ messages in thread
From: Heiko Stübner @ 2011-12-19 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Am Montag, 19. Dezember 2011, 13:42:24 schrieb Kukjin Kim:
> Heiko St?bner wrote:
> > S3C2412/S3C2416/S3C2443 use a special register to signal the reset to
> > the processor and used therefore the s3c24xx_reset_hook mechanism in the
> > s3c24xx-specific arch reset.
> > 
> > This patch introduces restart functions for these architectures,
> > moves the board files to them and removes the s3c24xx_reset_hook
> > infrastructure, as all users are gone.
> > 
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > @Kgene: This is my first cleanup step, done before your s3c64xx mail
> > arrived,
> > which transforms the 2412,2416 and 2443 arches which use the special
> > SWRST register to do the reset. Just if it helps :-)
> 
> Heiko, thanks.
> 
> I'm looking at S5P SoCs now and of course this helps. And if possible, let
> me do it with this.
>
> As a note, we need to implement local header file before using new restart
> hook and I'm thinking which one is better to us between all s3c24xx SoCs'
> common or each mach-s3c24xx's one.
For the three arches in the patch I put the function declaration into
s3c2412.h/s3c2416.h/s3c2443.h . They all use a SWRST register, but its
position and the value needed to be written to it differs for each SoC, so
they need to be separate like in the patch.
So these three arches do not seem to need a new header and seem to be ok
with this patch.


The other two S3C24xx-arches (s3c2410 and s3c2440) all use arch_wdt_reset
to do the reset, so I thought about declaring a 

void s3c24xx_default_restart(char mode, const char *cmd)
{
	if (mode == 's') {
		soft_restart(0);
	}

	arch_wdt_reset();

	/* we'll take a jump through zero as a poor second */
	soft_restart(0);
}

for these.

I thought about putting it into plat-s3c24xx/cpu.c and its extern
declaration into plat-samsung/include/plat/cpu.h, but I'm not really sure
if this would be the correct location.


Heiko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM: restart: S3C64XX: use new restart hook
  2011-12-19 11:58 ` Kukjin Kim
@ 2011-12-19 13:55   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 16+ messages in thread
From: Russell King - ARM Linux @ 2011-12-19 13:55 UTC (permalink / raw)
  To: Kukjin Kim; +Cc: linux-arm-kernel, linux-samsung-soc, 'Ben Dooks'

On Mon, Dec 19, 2011 at 08:58:20PM +0900, Kukjin Kim wrote:
> Hook these platforms restart code into the new restart hook rather
> than using arch_reset().
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

It would be _much_ better if you could prepare a set of patches against
my devel-stable which adds this support (as has been done for others.)

I can merge it into my restart branch, and update the commit which removes
arch_reset() itself, and the commit which adds the #error.  We can then
avoid bisect breakage.

> ---
>  arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>  arch/arm/mach-s3c64xx/common.h                     |    2 ++
>  arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>  arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>  .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>  14 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
> index 8ae5b16..35182ba 100644
> --- a/arch/arm/mach-s3c64xx/common.c
> +++ b/arch/arm/mach-s3c64xx/common.c
> @@ -44,6 +44,7 @@
>  #include <plat/irq-vic-timer.h>
>  #include <plat/regs-irqtype.h>
>  #include <plat/regs-serial.h>
> +#include <plat/watchdog-reset.h>
>  
>  #include "common.h"
>  
> @@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
>  	return 0;
>  }
>  arch_initcall(s3c64xx_init_irq_eint);
> +
> +void s3c64xx_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	/* if all else fails, or mode was for soft, jump to 0 */
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
> index 9f523a2..8dc8ab6 100644
> --- a/arch/arm/mach-s3c64xx/common.h
> +++ b/arch/arm/mach-s3c64xx/common.h
> @@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int size);
>  void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
>  void s3c64xx_setup_clocks(void);
>  
> +void s3c64xx_restart(char mode, const char *cmd);
> +
>  extern struct syscore_ops s3c64xx_irq_syscore_ops;
>  extern struct sysdev_class s3c64xx_sysclass;
>  
> diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
> index e19c584..353ed43 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> @@ -11,21 +11,9 @@
>  #ifndef __ASM_ARCH_SYSTEM_H
>  #define __ASM_ARCH_SYSTEM_H __FILE__
>  
> -#include <plat/watchdog-reset.h>
> -
>  static void arch_idle(void)
>  {
>  	/* nothing here yet */
>  }
>  
> -#error Fix me up
> -static void arch_reset(char mode, const char *cmd)
> -{
> -	if (mode != 's')
> -		arch_wdt_reset();
> -
> -	/* if all else fails, or mode was for soft, jump to 0 */
> -	soft_restart(0);
> -}
> -
>  #endif /* __ASM_ARCH_IRQ_H */
> diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
> index 4949bcd..a2ea6e5 100644
> --- a/arch/arm/mach-s3c64xx/mach-anw6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
> @@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
>  	.map_io		= anw6410_map_io,
>  	.init_machine	= anw6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> index 954a44e..3615d83 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
>  	.map_io		= crag6410_map_io,
>  	.init_machine	= crag6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
> index b6231d5..8707bee 100644
> --- a/arch/arm/mach-s3c64xx/mach-hmt.c
> +++ b/arch/arm/mach-s3c64xx/mach-hmt.c
> @@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
>  	.map_io		= hmt_map_io,
>  	.init_machine	= hmt_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> index ed02e7e..4fba232 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
>  	.map_io		= mini6410_map_io,
>  	.init_machine	= mini6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
> index 3e2391a..9ec4d57 100644
> --- a/arch/arm/mach-s3c64xx/mach-ncp.c
> +++ b/arch/arm/mach-s3c64xx/mach-ncp.c
> @@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
>  	.map_io		= ncp_map_io,
>  	.init_machine	= ncp_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> index 0456143..0cb7116 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
>  	.map_io		= real6410_map_io,
>  	.init_machine	= real6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
> index 2044a9f..f1f57bd 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq5.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
> @@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq5_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
> index eaf24a3..63117d8 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq7.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
> @@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq7_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> index bda5e0b..64375d7 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> @@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
>  	.map_io		= smdk6400_map_io,
>  	.init_machine	= smdk6400_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> index 91087da..f239b0a 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
>  	.map_io		= smdk6410_map_io,
>  	.init_machine	= smdk6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> index 40dbb2b..f19aff1 100644
> --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> @@ -17,6 +17,7 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/delay.h>
>  
>  static inline void arch_wdt_reset(void)
>  {
> -- 
> 1.7.1
> 
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 13:55   ` Russell King - ARM Linux
  0 siblings, 0 replies; 16+ messages in thread
From: Russell King - ARM Linux @ 2011-12-19 13:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 19, 2011 at 08:58:20PM +0900, Kukjin Kim wrote:
> Hook these platforms restart code into the new restart hook rather
> than using arch_reset().
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

It would be _much_ better if you could prepare a set of patches against
my devel-stable which adds this support (as has been done for others.)

I can merge it into my restart branch, and update the commit which removes
arch_reset() itself, and the commit which adds the #error.  We can then
avoid bisect breakage.

> ---
>  arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>  arch/arm/mach-s3c64xx/common.h                     |    2 ++
>  arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>  arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>  arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>  arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>  .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>  14 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
> index 8ae5b16..35182ba 100644
> --- a/arch/arm/mach-s3c64xx/common.c
> +++ b/arch/arm/mach-s3c64xx/common.c
> @@ -44,6 +44,7 @@
>  #include <plat/irq-vic-timer.h>
>  #include <plat/regs-irqtype.h>
>  #include <plat/regs-serial.h>
> +#include <plat/watchdog-reset.h>
>  
>  #include "common.h"
>  
> @@ -373,3 +374,12 @@ static int __init s3c64xx_init_irq_eint(void)
>  	return 0;
>  }
>  arch_initcall(s3c64xx_init_irq_eint);
> +
> +void s3c64xx_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	/* if all else fails, or mode was for soft, jump to 0 */
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
> index 9f523a2..8dc8ab6 100644
> --- a/arch/arm/mach-s3c64xx/common.h
> +++ b/arch/arm/mach-s3c64xx/common.h
> @@ -23,6 +23,8 @@ void s3c64xx_init_io(struct map_desc *mach_desc, int size);
>  void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
>  void s3c64xx_setup_clocks(void);
>  
> +void s3c64xx_restart(char mode, const char *cmd);
> +
>  extern struct syscore_ops s3c64xx_irq_syscore_ops;
>  extern struct sysdev_class s3c64xx_sysclass;
>  
> diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
> index e19c584..353ed43 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> @@ -11,21 +11,9 @@
>  #ifndef __ASM_ARCH_SYSTEM_H
>  #define __ASM_ARCH_SYSTEM_H __FILE__
>  
> -#include <plat/watchdog-reset.h>
> -
>  static void arch_idle(void)
>  {
>  	/* nothing here yet */
>  }
>  
> -#error Fix me up
> -static void arch_reset(char mode, const char *cmd)
> -{
> -	if (mode != 's')
> -		arch_wdt_reset();
> -
> -	/* if all else fails, or mode was for soft, jump to 0 */
> -	soft_restart(0);
> -}
> -
>  #endif /* __ASM_ARCH_IRQ_H */
> diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
> index 4949bcd..a2ea6e5 100644
> --- a/arch/arm/mach-s3c64xx/mach-anw6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
> @@ -240,4 +240,5 @@ MACHINE_START(ANW6410, "A&W6410")
>  	.map_io		= anw6410_map_io,
>  	.init_machine	= anw6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> index 954a44e..3615d83 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -715,4 +715,5 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
>  	.map_io		= crag6410_map_io,
>  	.init_machine	= crag6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
> index b6231d5..8707bee 100644
> --- a/arch/arm/mach-s3c64xx/mach-hmt.c
> +++ b/arch/arm/mach-s3c64xx/mach-hmt.c
> @@ -271,4 +271,5 @@ MACHINE_START(HMT, "Airgoo-HMT")
>  	.map_io		= hmt_map_io,
>  	.init_machine	= hmt_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> index ed02e7e..4fba232 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -349,4 +349,5 @@ MACHINE_START(MINI6410, "MINI6410")
>  	.map_io		= mini6410_map_io,
>  	.init_machine	= mini6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
> index 3e2391a..9ec4d57 100644
> --- a/arch/arm/mach-s3c64xx/mach-ncp.c
> +++ b/arch/arm/mach-s3c64xx/mach-ncp.c
> @@ -103,4 +103,5 @@ MACHINE_START(NCP, "NCP")
>  	.map_io		= ncp_map_io,
>  	.init_machine	= ncp_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> index 0456143..0cb7116 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -330,4 +330,5 @@ MACHINE_START(REAL6410, "REAL6410")
>  	.map_io		= real6410_map_io,
>  	.init_machine	= real6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
> index 2044a9f..f1f57bd 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq5.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
> @@ -151,4 +151,5 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq5_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
> index eaf24a3..63117d8 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq7.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
> @@ -167,4 +167,5 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
>  	.map_io		= smartq_map_io,
>  	.init_machine	= smartq7_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> index bda5e0b..64375d7 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
> @@ -92,4 +92,5 @@ MACHINE_START(SMDK6400, "SMDK6400")
>  	.map_io		= smdk6400_map_io,
>  	.init_machine	= smdk6400_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> index 91087da..f239b0a 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -704,4 +704,5 @@ MACHINE_START(SMDK6410, "SMDK6410")
>  	.map_io		= smdk6410_map_io,
>  	.init_machine	= smdk6410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c64xx_restart,
>  MACHINE_END
> diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> index 40dbb2b..f19aff1 100644
> --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
> @@ -17,6 +17,7 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/delay.h>
>  
>  static inline void arch_wdt_reset(void)
>  {
> -- 
> 1.7.1
> 
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM: restart: S3C64XX: use new restart hook
  2011-12-19 13:55   ` Russell King - ARM Linux
@ 2011-12-19 14:37     ` Kukjin Kim
  -1 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 14:37 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Kukjin Kim, linux-arm-kernel, linux-samsung-soc, 'Ben Dooks'

On 12/19/11 22:55, Russell King - ARM Linux wrote:
> On Mon, Dec 19, 2011 at 08:58:20PM +0900, Kukjin Kim wrote:
>> Hook these platforms restart code into the new restart hook rather
>> than using arch_reset().
>>
>> Cc: Ben Dooks<ben-linux@fluff.org>
>> Cc: Russell King<rmk+kernel@arm.linux.org.uk>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>
> It would be _much_ better if you could prepare a set of patches against
> my devel-stable which adds this support (as has been done for others.)
>
OK, I will and other Samsung stuff such as s3c24xx, s5p and exynos will 
be implemented together against your devel-stable.

> I can merge it into my restart branch, and update the commit which removes
> arch_reset() itself, and the commit which adds the #error.  We can then
> avoid bisect breakage.
>
OK.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>> ---
>>   arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>>   arch/arm/mach-s3c64xx/common.h                     |    2 ++
>>   arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>>   arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>>   arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>>   arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>>   .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>>   14 files changed, 23 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM: restart: S3C64XX: use new restart hook
@ 2011-12-19 14:37     ` Kukjin Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Kukjin Kim @ 2011-12-19 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/19/11 22:55, Russell King - ARM Linux wrote:
> On Mon, Dec 19, 2011 at 08:58:20PM +0900, Kukjin Kim wrote:
>> Hook these platforms restart code into the new restart hook rather
>> than using arch_reset().
>>
>> Cc: Ben Dooks<ben-linux@fluff.org>
>> Cc: Russell King<rmk+kernel@arm.linux.org.uk>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>
> It would be _much_ better if you could prepare a set of patches against
> my devel-stable which adds this support (as has been done for others.)
>
OK, I will and other Samsung stuff such as s3c24xx, s5p and exynos will 
be implemented together against your devel-stable.

> I can merge it into my restart branch, and update the commit which removes
> arch_reset() itself, and the commit which adds the #error.  We can then
> avoid bisect breakage.
>
OK.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>> ---
>>   arch/arm/mach-s3c64xx/common.c                     |   10 ++++++++++
>>   arch/arm/mach-s3c64xx/common.h                     |    2 ++
>>   arch/arm/mach-s3c64xx/include/mach/system.h        |   12 ------------
>>   arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 +
>>   arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 +
>>   arch/arm/mach-s3c64xx/mach-real6410.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 +
>>   arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 +
>>   arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 +
>>   .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
>>   14 files changed, 23 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-12-19 14:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19 11:58 [PATCH] ARM: restart: S3C64XX: use new restart hook Kukjin Kim
2011-12-19 11:58 ` Kukjin Kim
2011-12-19 12:12 ` Heiko Stübner
2011-12-19 12:12   ` Heiko Stübner
2011-12-19 12:20   ` Kukjin Kim
2011-12-19 12:20     ` Kukjin Kim
2011-12-19 12:25     ` [PATCH] ARM: restart: move SWRST based S3C platforms to machine_desc hook Heiko Stübner
2011-12-19 12:25       ` Heiko Stübner
2011-12-19 12:42       ` Kukjin Kim
2011-12-19 12:42         ` Kukjin Kim
2011-12-19 12:58         ` Heiko Stübner
2011-12-19 12:58           ` Heiko Stübner
2011-12-19 13:55 ` [PATCH] ARM: restart: S3C64XX: use new restart hook Russell King - ARM Linux
2011-12-19 13:55   ` Russell King - ARM Linux
2011-12-19 14:37   ` Kukjin Kim
2011-12-19 14:37     ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.