ARM: S3C24XX: unify restart functions
Subsystems (5)
cover ARM: S3C24XX: unify restart functions
This unifies the restart functions of s3c24xx socs into one single function and also removes the need for the SWRST register to be statically mapped in the dt case.
As a result the mach-s3c2416-dt boardfile can also support other s3c24xx boards in the future.
Because of the clock-reparenting in the s3c2412-swrst it depends on the conversion of s3c2412 to the common clock framework.
Heiko Stuebner (5):
dt-bindings: document the s3c24xx software-reset register
ARM: S3C24XX: add generic handler for swrst resets
ARM: S3C24XX: add common reset function
ARM: S3C24XX: convert boards to use common restart function
ARM: S3C24XX: remove obsolete SoC-specific restart functions
.../bindings/arm/samsung/s3c24xx-swrst.txt | 16 ++ arch/arm/boot/dts/s3c2416.dtsi | 5 + arch/arm/mach-s3c24xx/Kconfig | 8 + arch/arm/mach-s3c24xx/Makefile | 1 + arch/arm/mach-s3c24xx/common.c | 31 ++++ arch/arm/mach-s3c24xx/common.h | 23 ++- arch/arm/mach-s3c24xx/mach-amlm5900.c | 2 +- arch/arm/mach-s3c24xx/mach-anubis.c | 2 +- arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 +- arch/arm/mach-s3c24xx/mach-bast.c | 2 +- arch/arm/mach-s3c24xx/mach-gta02.c | 2 +- arch/arm/mach-s3c24xx/mach-h1940.c | 2 +- arch/arm/mach-s3c24xx/mach-jive.c | 2 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 2 +- arch/arm/mach-s3c24xx/mach-n30.c | 4 +- arch/arm/mach-s3c24xx/mach-nexcoder.c | 2 +- arch/arm/mach-s3c24xx/mach-osiris.c | 2 +- arch/arm/mach-s3c24xx/mach-otom.c | 2 +- arch/arm/mach-s3c24xx/mach-qt2410.c | 2 +- arch/arm/mach-s3c24xx/mach-rx1950.c | 2 +- arch/arm/mach-s3c24xx/mach-rx3715.c | 2 +- arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 11 +- arch/arm/mach-s3c24xx/mach-smdk2410.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2413.c | 6 +- arch/arm/mach-s3c24xx/mach-smdk2416.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2440.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2443.c | 2 +- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 2 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 2 +- arch/arm/mach-s3c24xx/mach-vstms.c | 2 +- arch/arm/mach-s3c24xx/s3c2410.c | 12 -- arch/arm/mach-s3c24xx/s3c2412.c | 20 --- arch/arm/mach-s3c24xx/s3c2416.c | 8 - arch/arm/mach-s3c24xx/s3c2443.c | 8 - arch/arm/mach-s3c24xx/s3c244x.c | 11 -- arch/arm/mach-s3c24xx/swrst-reset.c | 160 ++++++++++++++++++++ 36 files changed, 275 insertions(+), 91 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/samsung/s3c24xx-swrst.txt create mode 100644 arch/arm/mach-s3c24xx/swrst-reset.c
Signature · 1 line
1.7.10.4
PATCH 1/5 dt-bindings: document the s3c24xx software-reset register
The S3C2412/S3C2413 as well as the S3C2443 and following contain a special register that restarts the system when written to. This adds a simple binding, so that it gets accessible on dt systems too.
We distinguish between the two types (s3c2412, s3c2443) because the handling of the swrst register on the s3c2412 also needs to take care of a hardware glitch at reset time.
--- .../devicetree/bindings/arm/samsung/s3c24xx-swrst.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/samsung/s3c24xx-swrst.txt
Documentation/devicetree/bindings/arm/samsung/s3c24xx-swrst.txt new file +16 -0
@@ -0,0 +1,16 @@ +SAMSUNG S3C24XX software-reset register + +Some SoCs of the series contain a special software-reset register +to let the system restart. + +Properties: + - compatible : should be one of + "samsung,s3c2412-swrst" - for S3C2412, S3C2413 + "samsung,s3c2443-swrst" - for S3C2416, S3C2443, S3C2450 + - reg : offset and length of the register. + +Example: + swrst at 4c000044 { + compatible = "samsung,s3c2443-swrst"; + reg = <0x4c000044 0x4>; + };
Signature · 1 line
1.7.10.4
PATCH 1/5 dt-bindings: document the s3c24xx software-reset register
Hi Heiko,
Quoted 8 lines · Heiko St?bner
The S3C2412/S3C2413 as well as the S3C2443 and following contain a special register that restarts the system when written to. This adds a simple binding, so that it gets accessible on dt systems too.
We distinguish between the two types (s3c2412, s3c2443) because the handling of the swrst register on the s3c2412 also needs to take care of a hardware glitch at reset time.
Quoted 5 lines
Signed-off-by Heiko Stuebner <[email protected]>--- .../devicetree/bindings/arm/samsung/s3c24xx-swrst.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)create mode 100644
Documentation/devicetree/bindings/arm/samsung/s3c24xx-swrst.txt
Is there really a need to have separate bindings for this?
As far as I can see, the swreset register is a part of the clock controller, so restart function could be provided by clock driver and there would be no need to change anything in DT.
Best regards,
Tomasz
PATCH 2/5 ARM: S3C24XX: add generic handler for swrst resets
In reply to Heiko StübnerPreviously the s3c24xx socs using the swrst machnism simply wrote the needed value to a statically mapped register.
To generalize and make it usable in the dt case create a reset handler similar to the already existing watchdog-reset used by different samsung architectures.
--- arch/arm/mach-s3c24xx/Kconfig | 5 ++ arch/arm/mach-s3c24xx/Makefile | 1 + arch/arm/mach-s3c24xx/common.h | 16 ++++ arch/arm/mach-s3c24xx/swrst-reset.c | 160 +++++++++++++++++++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 arch/arm/mach-s3c24xx/swrst-reset.c
arch/arm/mach-s3c24xx/Kconfig +5 -0
@@ -30,6 +30,11 @@ config S3C2410_COMMON_DCLK Temporary symbol to build the dclk driver based on the common clock framework. +config S3C24XX_SWRST + bool + help + Handle resets using the swrst register available on some s3c24xx SoCs. + menu "SAMSUNG S3C24XX SoCs Support" comment "S3C24XX SoCs"
arch/arm/mach-s3c24xx/Makefile +1 -0
@@ -41,6 +41,7 @@ obj-$(CONFIG_CPU_S3C2443) += s3c2443.o # PM obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o +obj-$(CONFIG_S3C24XX_SWRST) += swrst-reset.o # common code
arch/arm/mach-s3c24xx/common.h +16 -0
@@ -131,4 +131,20 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, void __iomem *reg_base);#endif +#ifdef CONFIG_S3C24XX_SWRST +void s3c24xx_swrst_reset (void ); +bool s3c24xx_swrst_reset_available (void ); +void s3c24xx_swrst_reset_of_init (void ); +void s3c24xx_swrst_reset_init (void __iomem *base,bool is_s3c2412); +#else +static inline void s3c24xx_swrst_reset (void ) {} +static inline bool s3c24xx_swrst_reset_available (void ) +{ +return false; +} +static inline void s3c24xx_swrst_reset_of_init (void ) {} +static inline void s3c24xx_swrst_reset_init (void __iomem *base, +bool is_s3c2412) {} +#endif +#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */
arch/arm/mach-s3c24xx/swrst-reset.c new file +160 -0
160 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 3/5 ARM: S3C24XX: add common reset function
In reply to Heiko StübnerThe function first tries to use a swrst-block if available, then a watchdog-reset and at the end a soft_restart as last measure.
--- arch/arm/mach-s3c24xx/common.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-s3c24xx/common.h | 2 ++ 2 files changed, 28 insertions(+)
arch/arm/mach-s3c24xx/common.c +26 -0
@@ -587,3 +587,29 @@ struct platform_device s3c2410_device_dclk = { .resource = s3c2410_dclk_resource, };#endif + +/* +* Some S3C24XX-SoCs have a special software-reset register and +* all of them seem to support the watchdog reset. +*/ +void s3c24xx_restart (enum reboot_mode mode,const char *cmd) +{ +if (mode ==REBOOT_SOFT ) +soft_restart (0 ); + +if (s3c24xx_swrst_reset_available ()) { +pr_debug ("s3c24xx: trying swrst-reset\n" ); +s3c24xx_swrst_reset (); +/* delay to allow the serial port to show the message */ +mdelay (50 ); + } + +#ifdef CONFIG_SAMSUNG_WDT_RESET +pr_debug ("s3c24xx: trying watchdog-reset\n" ); +samsung_wdt_reset (); +mdelay (50 ); +#endif + +/* we'll take a jump through zero as a poor second */ +soft_restart (0 ); +}
arch/arm/mach-s3c24xx/common.h +2 -0
@@ -147,4 +147,6 @@ static inline void s3c24xx_swrst_reset_init(void __iomem *base, bool is_s3c2412) {}#endif +void s3c24xx_restart (enum reboot_mode mode,const char *cmd); +#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */
Signature · 1 line
1.7.10.4
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
In reply to Heiko StübnerThis converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog- reset so that it will be able to handle more s3c24xx-SoCs later on.
--- arch/arm/boot/dts/s3c2416.dtsi | 5 +++++ arch/arm/mach-s3c24xx/Kconfig | 3 +++ arch/arm/mach-s3c24xx/common.c | 5 +++++ arch/arm/mach-s3c24xx/mach-amlm5900.c | 2 +- arch/arm/mach-s3c24xx/mach-anubis.c | 2 +- arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 +- arch/arm/mach-s3c24xx/mach-bast.c | 2 +- arch/arm/mach-s3c24xx/mach-gta02.c | 2 +- arch/arm/mach-s3c24xx/mach-h1940.c | 2 +- arch/arm/mach-s3c24xx/mach-jive.c | 2 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 2 +- arch/arm/mach-s3c24xx/mach-n30.c | 4 ++-- arch/arm/mach-s3c24xx/mach-nexcoder.c | 2 +- arch/arm/mach-s3c24xx/mach-osiris.c | 2 +- arch/arm/mach-s3c24xx/mach-otom.c | 2 +- arch/arm/mach-s3c24xx/mach-qt2410.c | 2 +- arch/arm/mach-s3c24xx/mach-rx1950.c | 2 +- arch/arm/mach-s3c24xx/mach-rx3715.c | 2 +- arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 11 ++++++++++- arch/arm/mach-s3c24xx/mach-smdk2410.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2413.c | 6 +++--- arch/arm/mach-s3c24xx/mach-smdk2416.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2440.c | 2 +- arch/arm/mach-s3c24xx/mach-smdk2443.c | 2 +- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 2 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 2 +- arch/arm/mach-s3c24xx/mach-vstms.c | 2 +- 27 files changed, 49 insertions(+), 27 deletions(-)
arch/arm/boot/dts/s3c2416.dtsi +5 -0
@@ -35,6 +35,11 @@ #clock-cells = <1>; }; + swrst at 4c000044 { + compatible = "samsung,s3c2443-swrst"; + reg = <0x4c000044 0x4>; + }; + pinctrl at 56000000 { compatible = "samsung,s3c2416-pinctrl"; };
arch/arm/mach-s3c24xx/Kconfig +3 -0
@@ -62,6 +62,7 @@ config CPU_S3C2412 select S3C2412_COMMON_CLK select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select S3C24XX_SWRST help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
@@ -73,6 +74,7 @@ config CPU_S3C2416 select S3C2416_PM if PM select S3C2443_COMMON_CLK select S3C2443_DMA if S3C24XX_DMA + select S3C24XX_SWRST help Support for the S3C2416 SoC from the S3C24XX line
@@ -110,6 +112,7 @@ config CPU_S3C2443 select CPU_LLSERIAL_S3C2440 select S3C2443_COMMON_CLK select S3C2443_DMA if S3C24XX_DMA + select S3C24XX_SWRST help Support for the S3C2443 SoC from the S3C24XX line
arch/arm/mach-s3c24xx/common.c +5 -0
@@ -46,6 +46,7 @@#include <mach/regs-gpio.h> #include <plat/regs-serial.h> #include <mach/dma.h> +#include <mach/regs-s3c2443-clock.h> #include <plat/cpu.h> #include <plat/devs.h>
@@ -538,9 +539,11 @@ void __init s3c2410_init_clocks(int xtal)#endif #ifdef CONFIG_CPU_S3C2412 +#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30)void __init s3c2412_init_clocks (int xtal) {s3c2412_common_clk_init (NULL , xtal,0 ,S3C24XX_VA_CLKPWR ); +s3c24xx_swrst_reset_init (S3C2412_SWRST , true); }#endif
@@ -548,6 +551,7 @@ void __init s3c2412_init_clocks(int xtal)void __init s3c2416_init_clocks (int xtal) {s3c2443_common_clk_init (NULL , xtal,0 ,S3C24XX_VA_CLKPWR ); +s3c24xx_swrst_reset_init (S3C2443_SWRST , false); }#endif
@@ -571,6 +575,7 @@ void __init s3c2442_init_clocks(int xtal)void __init s3c2443_init_clocks (int xtal) {s3c2443_common_clk_init (NULL , xtal,1 ,S3C24XX_VA_CLKPWR ); +s3c24xx_swrst_reset_init (S3C2443_SWRST , false); }#endif
arch/arm/mach-s3c24xx/mach-amlm5900.c +1 -1
@@ -246,5 +246,5 @@ MACHINE_START(AML_M5900, "AML_M5900") .init_irq = s3c2410_init_irq, .init_machine = amlm5900_init, .init_time = amlm5900_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-anubis.c +1 -1
@@ -456,5 +456,5 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") .init_machine = anubis_init, .init_irq = s3c2440_init_irq, .init_time = anubis_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-at2440evb.c +1 -1
@@ -217,5 +217,5 @@ MACHINE_START(AT2440EVB, "AT2440EVB") .init_machine = at2440evb_init, .init_irq = s3c2440_init_irq, .init_time = at2440evb_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-bast.c +1 -1
@@ -617,5 +617,5 @@ MACHINE_START(BAST, "Simtec-BAST") .init_irq = s3c2410_init_irq, .init_machine = bast_init, .init_time = bast_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-gta02.c +1 -1
@@ -596,5 +596,5 @@ MACHINE_START(NEO1973_GTA02, "GTA02") .init_irq = s3c2442_init_irq, .init_machine = gta02_machine_init, .init_time = gta02_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-h1940.c +1 -1
@@ -743,5 +743,5 @@ MACHINE_START(H1940, "IPAQ-H1940") .init_irq = s3c2410_init_irq, .init_machine = h1940_init, .init_time = h1940_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-jive.c +1 -1
@@ -670,5 +670,5 @@ MACHINE_START(JIVE, "JIVE") .map_io = jive_map_io, .init_machine = jive_machine_init, .init_time = jive_init_time, - .restart = s3c2412_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-mini2440.c +1 -1
@@ -694,5 +694,5 @@ MACHINE_START(MINI2440, "MINI2440") .init_machine = mini2440_init, .init_irq = s3c2440_init_irq, .init_time = mini2440_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-n30.c +2 -2
@@ -598,7 +598,7 @@ MACHINE_START(N30, "Acer-N30") .init_machine = n30_init, .init_irq = s3c2410_init_irq, .map_io = n30_map_io, - .restart = s3c2410_restart, + .restart = s3c24xx_restart, MACHINE_ENDMACHINE_START (N35 ,"Acer-N35" )
@@ -609,5 +609,5 @@ MACHINE_START(N35, "Acer-N35") .init_machine = n30_init, .init_irq = s3c2410_init_irq, .map_io = n30_map_io, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-nexcoder.c +1 -1
@@ -158,5 +158,5 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") .init_machine = nexcoder_init, .init_irq = s3c2440_init_irq, .init_time = nexcoder_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-osiris.c +1 -1
@@ -438,5 +438,5 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .init_irq = s3c2440_init_irq, .init_machine = osiris_init, .init_time = osiris_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-otom.c +1 -1
@@ -122,5 +122,5 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") .init_machine = otom11_init, .init_irq = s3c2410_init_irq, .init_time = otom11_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-qt2410.c +1 -1
@@ -351,5 +351,5 @@ MACHINE_START(QT2410, "QT2410") .init_irq = s3c2410_init_irq, .init_machine = qt2410_machine_init, .init_time = qt2410_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx1950.c +1 -1
@@ -824,5 +824,5 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") .init_irq = s3c2442_init_irq, .init_machine = rx1950_init_machine, .init_time = rx1950_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx3715.c +1 -1
@@ -214,5 +214,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715") .init_irq = s3c2440_init_irq, .init_machine = rx3715_init_machine, .init_time = rx3715_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +10 -1
@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h"
@@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) { +s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif +of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );s3c_pm_init (); }
@@ -50,5 +59,5 @@ DT_MACHINE_START(S3C2416_DT, "Samsung S3C2416 (Flattened Device Tree)") .map_io = s3c2416_dt_map_io, .init_irq = irqchip_init, .init_machine = s3c2416_dt_machine_init, - .restart = s3c2416_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2410.c +1 -1
@@ -124,5 +124,5 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc .init_irq = s3c2410_init_irq, .init_machine = smdk2410_init, .init_time = smdk2410_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2413.c +3 -3
@@ -140,7 +140,7 @@ MACHINE_START(S3C2413, "S3C2413") .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, .init_time = samsung_timer_init, - .restart = s3c2412_restart, + .restart = s3c24xx_restart, MACHINE_ENDMACHINE_START (SMDK2412 ,"SMDK2412" )
@@ -152,7 +152,7 @@ MACHINE_START(SMDK2412, "SMDK2412") .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, .init_time = samsung_timer_init, - .restart = s3c2412_restart, + .restart = s3c24xx_restart, MACHINE_ENDMACHINE_START (SMDK2413 ,"SMDK2413" )
@@ -164,5 +164,5 @@ MACHINE_START(SMDK2413, "SMDK2413") .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, .init_time = smdk2413_init_time, - .restart = s3c2412_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2416.c +1 -1
@@ -262,5 +262,5 @@ MACHINE_START(SMDK2416, "SMDK2416") .map_io = smdk2416_map_io, .init_machine = smdk2416_machine_init, .init_time = smdk2416_init_time, - .restart = s3c2416_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2440.c +1 -1
@@ -185,5 +185,5 @@ MACHINE_START(S3C2440, "SMDK2440") .map_io = smdk2440_map_io, .init_machine = smdk2440_machine_init, .init_time = smdk2440_init_time, - .restart = s3c244x_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2443.c +1 -1
@@ -151,5 +151,5 @@ MACHINE_START(SMDK2443, "SMDK2443") .map_io = smdk2443_map_io, .init_machine = smdk2443_machine_init, .init_time = smdk2443_init_time, - .restart = s3c2443_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-tct_hammer.c +1 -1
@@ -157,5 +157,5 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") .init_irq = s3c2410_init_irq, .init_machine = tct_hammer_init, .init_time = tct_hammer_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vr1000.c +1 -1
@@ -366,5 +366,5 @@ MACHINE_START(VR1000, "Thorcom-VR1000") .init_machine = vr1000_init, .init_irq = s3c2410_init_irq, .init_time = vr1000_init_time, - .restart = s3c2410_restart, + .restart = s3c24xx_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vstms.c +1 -1
@@ -168,5 +168,5 @@ MACHINE_START(VSTMS, "VSTMS") .init_machine = vstms_init, .map_io = vstms_map_io, .init_time = vstms_init_time, - .restart = s3c2412_restart, + .restart = s3c24xx_restart,MACHINE_END
Signature · 1 line
1.7.10.4
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Hi Heiko,
Quoted 5 lines · Heiko St?bner
This converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog- reset so that it will be able to handle more s3c24xx-SoCs later on.
[snip]
Quoted 13 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +1
-0@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h"
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c static void __init s3c2416_dt_map_io(void) · line 44
Quoted 10 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +7
-0@@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) { +s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif
Hmm... I think it would be safe to assume availability of soft reset, especially if you could move the restart code to the clock driver.
Best regards,
Tomasz
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Am Donnerstag, 23. Januar 2014, 19:12:04 schrieb Tomasz Figa:
Quoted 29 lines
Hi Heiko,
Quoted 5 lines · Heiko St?bner
This converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog- reset so that it will be able to handle more s3c24xx-SoCs later on.
[snip]
Quoted 18 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.cindex 0a86953..88716fa4 100644arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +1
-0@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h" @@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) {
Quoted 10 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c static void __init s3c2416_dt_map_io(void) · line 44
Quoted 7 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +7
-0+s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif Hmm... I think it would be safe to assume availability of soft reset, especially if you could move the restart code to the clock driver.
ok, so something like the following:
the boards would simply use samsung_watchdog_reset, which should according to the manuals be available on all architectures. And the ccf-driver on appropriate architectures would simple replace the arm_pm_restart callback with its own SoC specific one?
For the s3c2412 this also means that the clock-logic would get simplified.
Like this, or do I overlook something?
Thanks
Heiko
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Quoted 48 lines · Heiko St?bner
Am Donnerstag, 23. Januar 2014, 19:12:04 schrieb Tomasz Figa:
Quoted 29 lines
Hi Heiko,
Quoted 5 lines · Heiko St?bner
This converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog- reset so that it will be able to handle more s3c24xx-SoCs later on.
[snip]
Quoted 18 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.cindex 0a86953..88716fa4 100644arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +1
-0@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h" @@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) {Quoted 10 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c static void __init s3c2416_dt_map_io(void) · line 44
Quoted 7 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +7
-0+s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif Hmm... I think it would be safe to assume availability of soft reset, especially if you could move the restart code to the clock driver.
ok, so something like the following:
the boards would simply use
samsung_watchdog_reset, which should according to the manuals be available on all architectures. And the ccf-driver on appropriate architectures would simple replace thearm_pm_restartcallback with its own SoC specific one?
Quoted 4 lines
For the s3c2412 this also means that the clock-logic would get simplified.
Like this, or do I overlook something?
Hmm, this would mean a dependency on CONFIG_SAMSUNG_WDT_RESET then. Is there a need to fall back to it on platforms which support soft reset (assuming that CCF driver would always install its restart handler on applicable platforms)?
Note that you can make the restart field NULL in mach_desc in board files.
Best regards,
Tomasz
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Am Donnerstag, 23. Januar 2014, 19:51:34 schrieb Tomasz Figa:
Quoted 53 lines · Heiko St?bner
Quoted 52 lines
Am Donnerstag, 23. Januar 2014, 19:12:04 schrieb Tomasz Figa:
Quoted 30 lines
Hi Heiko,
Quoted 6 lines · Heiko St?bner
This converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog-
reset so that it will be able to handle more s3c24xx-SoCs later on.[snip]
Quoted 18 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.cindex 0a86953..88716fa4 100644arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +1
-0@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h" @@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) {Quoted 10 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c static void __init s3c2416_dt_map_io(void) · line 44
Quoted 7 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +7
-0+s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif Hmm... I think it would be safe to assume availability of soft reset, especially if you could move the restart code to the clock driver.
ok, so something like the following:
the boards would simply use
samsung_watchdog_reset, which should according to the manuals be available on all architectures. And the ccf-driver on appropriate architectures would simple replace thearm_pm_restartcallback with its own SoC specific one?For the s3c2412 this also means that the clock-logic would get simplified.
Quoted 6 lines
Quoted 1 line
Like this, or do I overlook something?
Hmm, this would mean a dependency on
CONFIG_SAMSUNG_WDT_RESETthen. Is there a need to fall back to it on platforms which support soft reset (assuming that CCF driver would always install its restart handler on applicable platforms)?
s3c2410, s3c2440 and s3c2442 do not have the swrst facility. They always use samsung_wdt_reset.
In general, I want to try establishing some sort of general restart way, as in the future one dt-board should hopefully be enough to cover all s3c24xx soc variants.
Quoted 1 line
Note that you can make the restart field NULL in
mach_descin board files.
As I said above, this is mainly meant for the dt-case. The legacy-board files are more or less only secondary, and the affected boards can of course then have a NULL restart handle :-) .
So for this the dt-board could simply use the wdt-reset, which then gets replaced by the ccf-based reset if appropriate.
Heiko
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Quoted 61 lines · Heiko St?bner
Am Donnerstag, 23. Januar 2014, 19:51:34 schrieb Tomasz Figa:
Quoted 53 lines · Heiko St?bner
Quoted 52 lines
Am Donnerstag, 23. Januar 2014, 19:12:04 schrieb Tomasz Figa:
Quoted 30 lines
Hi Heiko,
Quoted 6 lines · Heiko St?bner
This converts all boards to use the new common restart function instead of SoC specific ones.
The mach-s3c2416-dt board now tries to setup either a swrst- or watchdog-
reset so that it will be able to handle more s3c24xx-SoCs later on.[snip]
Quoted 18 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.cindex 0a86953..88716fa4 100644arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +1
-0@@ -24,6 +24,7 @@#include <plat/cpu.h> #include <plat/pm.h> +#include <plat/watchdog-reset.h> #include "common.h" @@ -34,6 +35,14 @@ static void __init s3c2416_dt_map_io(void)static void __init s3c2416_dt_machine_init (void ) {Quoted 10 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c static void __init s3c2416_dt_map_io(void) · line 44
Quoted 7 lines
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c +7
-0+s3c24xx_swrst_reset_of_init (); + +#ifdef CONFIG_SAMSUNG_WDT_RESET +/* if no special swrst-device exists try to find a watchdog */ +if (!s3c24xx_swrst_reset_available ()) +samsung_wdt_reset_of_init (); +#endif Hmm... I think it would be safe to assume availability of soft reset, especially if you could move the restart code to the clock driver.
ok, so something like the following:
the boards would simply use
samsung_watchdog_reset, which should according to the manuals be available on all architectures. And the ccf-driver on appropriate architectures would simple replace thearm_pm_restartcallback with its own SoC specific one?For the s3c2412 this also means that the clock-logic would get simplified.
Quoted 6 lines
Quoted 1 line
Like this, or do I overlook something?
Hmm, this would mean a dependency on
CONFIG_SAMSUNG_WDT_RESETthen. Is there a need to fall back to it on platforms which support soft reset (assuming that CCF driver would always install its restart handler on applicable platforms)?
Quoted 6 lines
s3c2410, s3c2440 and s3c2442 do not have the swrst facility. They always use
samsung_wdt_reset.In general, I want to try establishing some sort of general restart way, as in the future one dt-board should hopefully be enough to cover all s3c24xx soc variants.
If you make SAMSUNG_WDT_RESET always selected on S3C24XX then I guess it's fine.
Quoted 10 lines
Quoted 3 lines
Note that you can make the restart field NULL in
mach_descin board files.As I said above, this is mainly meant for the dt-case. The legacy-board files are more or less only secondary, and the affected boards can of course then have a NULL restart handle :-) .
So for this the dt-board could simply use the wdt-reset, which then gets replaced by the ccf-based reset if appropriate.
OK. By the way, are there any benefits of using this software reset over watchdog reset? Maybe all S3C24xx could simply use watchdog reset and no special handling of those with swrst would be needed.
Best regards,
Tomasz
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Quoted 17 lines · On Thursday 23 January 2014 23:35:29 Tomasz Figa wrote:
Quoted 5 lines · Heiko St?bner
Am Donnerstag, 23. Januar 2014, 19:51:34 schrieb Tomasz Figa:
Quoted 1 line · Heiko St?bner
In general, I want to try establishing some sort of general restart way, as in the future one dt-board should hopefully be enough to cover all s3c24xx soc variants.
If you make
SAMSUNG_WDT_RESETalways selected on S3C24XX then I guess it's fine.Quoted 7 lines
Quoted 2 lines
Note that you can make the restart field NULL in
mach_descin board files.As I said above, this is mainly meant for the dt-case. The legacy-board files are more or less only secondary, and the affected boards can of course then have a NULL restart handle :-) .
Quoted 6 lines
Quoted 2 lines
So for this the dt-board could simply use the wdt-reset, which then gets replaced by the ccf-based reset if appropriate.
OK. By the way, are there any benefits of using this software reset over watchdog reset? Maybe all S3C24xx could simply use watchdog reset and no special handling of those with swrst would be needed.
According to the manuals I looked at, all S3C24XX SoCs seem to support the watchdog reset - I'm not sure why the swrst variant was choosen for the newer ones when they were added initially. So yes in theory all of them seem to be able to use the watchdog reset.
But in any case the s3c2412 will need its own handling, due to the apparent clock problem during resets (mentioned in the code and the manuals of s3c2412/s3c2413).
Heiko
PATCH 4/5 ARM: S3C24XX: convert boards to use common restart function
Quoted 25 lines · Heiko St?bner
Quoted 17 lines · On Thursday 23 January 2014 23:35:29 Tomasz Figa wrote:
Quoted 5 lines · Heiko St?bner
Am Donnerstag, 23. Januar 2014, 19:51:34 schrieb Tomasz Figa:
Quoted 1 line · Heiko St?bner
In general, I want to try establishing some sort of general restart way, as in the future one dt-board should hopefully be enough to cover all s3c24xx soc variants.
If you make
SAMSUNG_WDT_RESETalways selected on S3C24XX then I guess it's fine.Quoted 7 lines
Quoted 2 lines
Note that you can make the restart field NULL in
mach_descin board files.As I said above, this is mainly meant for the dt-case. The legacy-board files are more or less only secondary, and the affected boards can of course then have a NULL restart handle :-) .
Quoted 6 lines
Quoted 2 lines
So for this the dt-board could simply use the wdt-reset, which then gets replaced by the ccf-based reset if appropriate.
OK. By the way, are there any benefits of using this software reset over watchdog reset? Maybe all S3C24xx could simply use watchdog reset and no special handling of those with swrst would be needed.
Quoted 8 lines
According to the manuals I looked at, all S3C24XX SoCs seem to support the watchdog reset - I'm not sure why the swrst variant was choosen for the newer ones when they were added initially. So yes in theory all of them seem to be able to use the watchdog reset.
But in any case the s3c2412 will need its own handling, due to the apparent clock problem during resets (mentioned in the code and the manuals of s3c2412/s3c2413).
OK. So WDT by default (always selected in Kconfig) and override to SWRST in clock driver if available should work.
Best regards,
Tomasz
PATCH 5/5 ARM: S3C24XX: remove obsolete SoC-specific restart functions
In reply to Heiko StübnerAll of them got replaced by the common s3c24xx_restart, so these can go away.
--- arch/arm/mach-s3c24xx/common.h | 5 ----- arch/arm/mach-s3c24xx/s3c2410.c | 12 ------------ arch/arm/mach-s3c24xx/s3c2412.c | 20 -------------------- arch/arm/mach-s3c24xx/s3c2416.c | 8 -------- arch/arm/mach-s3c24xx/s3c2443.c | 8 -------- arch/arm/mach-s3c24xx/s3c244x.c | 11 ----------- 6 files changed, 64 deletions(-)
arch/arm/mach-s3c24xx/common.h +0 -5
@@ -22,7 +22,6 @@ extern int s3c2410a_init(void);extern void s3c2410_map_io (void );extern void s3c2410_init_uarts (struct s3c2410_uartcfg *cfg,int no);extern void s3c2410_init_clocks (int xtal); -extern void s3c2410_restart (enum reboot_mode mode,const char *cmd);extern void s3c2410_init_irq (void );#else #define s3c2410_init_clocks NULL
@@ -38,7 +37,6 @@ extern void s3c2412_map_io(void);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 (enum reboot_mode mode,const char *cmd);extern void s3c2412_init_irq (void );#else #define s3c2412_init_clocks NULL
@@ -53,7 +51,6 @@ extern void s3c2416_map_io(void);extern void s3c2416_init_uarts (struct s3c2410_uartcfg *cfg,int no);extern void s3c2416_init_clocks (int xtal);extern int s3c2416_baseclk_add (void ); -extern void s3c2416_restart (enum reboot_mode mode,const char *cmd);extern void s3c2416_init_irq (void );extern struct syscore_ops s3c2416_irq_syscore_ops;
@@ -67,7 +64,6 @@ extern struct syscore_ops s3c2416_irq_syscore_ops;#if defined(CONFIG_CPU_S3C2440 ) || defined(CONFIG_CPU_S3C2442 )extern void s3c244x_map_io (void );extern void s3c244x_init_uarts (struct s3c2410_uartcfg *cfg,int no); -extern void s3c244x_restart (enum reboot_mode mode,const char *cmd);#else #define s3c244x_init_uarts NULL#endif
@@ -98,7 +94,6 @@ extern void s3c2443_map_io(void);extern void s3c2443_init_uarts (struct s3c2410_uartcfg *cfg,int no);extern void s3c2443_init_clocks (int xtal);extern int s3c2443_baseclk_add (void ); -extern void s3c2443_restart (enum reboot_mode mode,const char *cmd);extern void s3c2443_init_irq (void );#else #define s3c2443_init_clocks NULL
arch/arm/mach-s3c24xx/s3c2410.c +0 -12
@@ -140,15 +140,3 @@ int __init s3c2410a_init(void) s3c2410_dev.bus = &s3c2410a_subsys;return s3c2410_init (); } - -void s3c2410_restart (enum reboot_mode mode,const char *cmd) -{ -if (mode ==REBOOT_SOFT ) { -soft_restart (0 ); - } - -samsung_wdt_reset (); - -/* we'll take a jump through zero as a poor second */ -soft_restart (0 ); -}
arch/arm/mach-s3c24xx/s3c2412.c +0 -20
@@ -130,26 +130,6 @@ static void s3c2412_idle(void)cpu_do_idle (); } -void s3c2412_restart (enum reboot_mode mode,const char *cmd) -{ -if (mode ==REBOOT_SOFT ) -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 -* mechanism. -* -* See the watchdog section of the S3C2412 manual for more -* information on this fix. -*/ - -__raw_writel (0x00 ,S3C2412_CLKSRC ); -__raw_writel (S3C2412_SWRST_RESET ,S3C2412_SWRST ); - -mdelay (1 ); -} -/* s3c2412_map_io * * register the standard cpu IO areas, and any passed in from the
arch/arm/mach-s3c24xx/s3c2416.c +0 -8
@@ -80,14 +80,6 @@ static struct device s3c2416_dev = { .bus = &s3c2416_subsys, }; -void s3c2416_restart (enum reboot_mode mode,const char *cmd) -{ -if (mode ==REBOOT_SOFT ) -soft_restart (0 ); - -__raw_writel (S3C2443_SWRST_RESET ,S3C2443_SWRST ); -} -int __init s3c2416_init (void ) {printk (KERN_INFO "S3C2416: Initializing architecture\n" );
arch/arm/mach-s3c24xx/s3c2443.c +0 -8
@@ -60,14 +60,6 @@ static struct device s3c2443_dev = { .bus = &s3c2443_subsys, }; -void s3c2443_restart (enum reboot_mode mode,const char *cmd) -{ -if (mode ==REBOOT_SOFT ) -soft_restart (0 ); - -__raw_writel (S3C2443_SWRST_RESET ,S3C2443_SWRST ); -} -int __init s3c2443_init (void ) {printk ("S3C2443: Initialising architecture\n" );
arch/arm/mach-s3c24xx/s3c244x.c +0 -11
@@ -143,14 +143,3 @@ struct syscore_ops s3c244x_pm_syscore_ops = { .suspend = s3c244x_suspend, .resume = s3c244x_resume, }; - -void s3c244x_restart (enum reboot_mode mode,const char *cmd) -{ -if (mode ==REBOOT_SOFT ) -soft_restart (0 ); - -samsung_wdt_reset (); - -/* we'll take a jump through zero as a poor second */ -soft_restart (0 ); -}
Signature · 1 line
1.7.10.4