[U-Boot] [PATCH v1 0/4] arm, at91: update SPL wdt support

update SPL WDT support and use it on the taurus board - if CONFIG_AT91SAM9_WATCHDOG is set: - do not disable WDT in SPL - call hw_watchdog_init() - make the WDT timeout configurable - enable it on the taurus board
Heiko Schocher (4): arm, at91, wdt: do not disable WDT in SPL common/board_f: add at91 wdt arm, at91, wdt: make timeout configurable arm, at91, taurus: enable WDT
README | 3 +++ arch/arm/cpu/at91-common/spl.c | 4 ++++ common/board_f.c | 2 +- drivers/watchdog/at91sam9_wdt.c | 4 ++++ include/configs/taurus.h | 6 ++++++ 5 files changed, 18 insertions(+), 1 deletion(-)

if CONFIG_AT91SAM9_WATCHDOG is set, do not disable WDT in SPL
Signed-off-by: Heiko Schocher hs@denx.de
---
arch/arm/cpu/at91-common/spl.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c index 6473320..aaa5eec 100644 --- a/arch/arm/cpu/at91-common/spl.c +++ b/arch/arm/cpu/at91-common/spl.c @@ -12,12 +12,16 @@ #include <asm/arch/clk.h> #include <spl.h>
+#if defined(CONFIG_AT91SAM9_WATCHDOG) +void at91_disable_wdt(void) { } +#else void at91_disable_wdt(void) { struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
writel(AT91_WDT_MR_WDDIS, &wdt->mr); } +#endif
u32 spl_boot_device(void) {

Dear Heiko Schocher,
Heiko Schocher hs@denx.de writes:
if CONFIG_AT91SAM9_WATCHDOG is set, do not disable WDT in SPL
Signed-off-by: Heiko Schocher hs@denx.de
arch/arm/cpu/at91-common/spl.c | 4 ++++ 1 file changed, 4 insertions(+)
applied to u-boot-atmel/master, thanks!
Best regards, Andreas Bießmann

call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG is used.
Signed-off-by: Heiko Schocher hs@denx.de ---
common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c index 3a4b32c..693a75c 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -111,7 +111,7 @@ static int init_func_watchdog_init(void) { # if defined(CONFIG_HW_WATCHDOG) && (defined(CONFIG_BLACKFIN) || \ defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \ - defined(CONFIG_SH)) + defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG)) hw_watchdog_init(); # endif puts(" Watchdog enabled\n");

On 21 January 2015 at 00:38, Heiko Schocher hs@denx.de wrote:
call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG is used.
Signed-off-by: Heiko Schocher hs@denx.de
common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

Dear Heiko Schocher,
Heiko Schocher hs@denx.de writes:
call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG is used.
Signed-off-by: Heiko Schocher hs@denx.de Reviewed-by: Simon Glass sjg@chromium.org
common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
applied to u-boot-atmel/master, thanks!
Best regards, Andreas Bießmann

make the HW WDT timeout configurable through the define CONFIG_AT91_HW_WDT_TIMEOUT.
Signed-off-by: Heiko Schocher hs@denx.de ---
README | 3 +++ drivers/watchdog/at91sam9_wdt.c | 4 ++++ 2 files changed, 7 insertions(+)
diff --git a/README b/README index fefa71c..5cce4c2 100644 --- a/README +++ b/README @@ -1257,6 +1257,9 @@ The following options need to be configured: SoC, then define this variable and provide board specific code for the "hw_watchdog_reset" function.
+ CONFIG_AT91_HW_WDT_TIMEOUT + specify the timeout in seconds. default 2 seconds. + - U-Boot Version: CONFIG_VERSION_VARIABLE If this variable is defined, an environment variable diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index ffd49a2..03c786c 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c @@ -30,7 +30,11 @@ #define ticks_to_ms(t) (((t + 1) * 1000) >> 8)
/* Hardware timeout in seconds */ +#if !defined(CONFIG_AT91_HW_WDT_TIMEOUT) #define WDT_HW_TIMEOUT 2 +#else +#define WDT_HW_TIMEOUT CONFIG_AT91_HW_WDT_TIMEOUT +#endif
/* * Set the watchdog time interval in 1/256Hz (write-once)

Heiko,
On Wed, Jan 21, 2015 at 08:38:22AM +0100, Heiko Schocher wrote: [...]
diff --git a/README b/README index fefa71c..5cce4c2 100644 --- a/README +++ b/README @@ -1257,6 +1257,9 @@ The following options need to be configured: SoC, then define this variable and provide board specific code for the "hw_watchdog_reset" function.
CONFIG_AT91_HW_WDT_TIMEOUT
specify the timeout in seconds. default 2 seconds.
Capitalize 'specify' since it is the start of a sentence.
You could also make the sentence slightly more concise by not repeating 'seconds'.
+ Specify the timeout in seconds (default 2).
[...]

Hello Jeremiah,
Am 21.01.2015 13:35, schrieb Jeremiah Mahler:
Heiko,
On Wed, Jan 21, 2015 at 08:38:22AM +0100, Heiko Schocher wrote: [...]
diff --git a/README b/README index fefa71c..5cce4c2 100644 --- a/README +++ b/README @@ -1257,6 +1257,9 @@ The following options need to be configured: SoC, then define this variable and provide board specific code for the "hw_watchdog_reset" function.
CONFIG_AT91_HW_WDT_TIMEOUT
specify the timeout in seconds. default 2 seconds.
Capitalize 'specify' since it is the start of a sentence.
You could also make the sentence slightly more concise by not repeating 'seconds'.
Specify the timeout in seconds (default 2).
Thanks! (Sorry for my bad denglish ...)
bye, Heiko

Heiko,
On Wed, Jan 21, 2015 at 01:38:47PM +0100, Heiko Schocher wrote: [...]
Thanks! (Sorry for my bad denglish ...)
No need to apologize.
Ich spreche nicht so gut Deutsch. :-)
bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Dear Heiko Schocher,
Heiko Schocher hs@denx.de writes:
make the HW WDT timeout configurable through the define CONFIG_AT91_HW_WDT_TIMEOUT.
Signed-off-by: Heiko Schocher hs@denx.de
README | 3 +++ drivers/watchdog/at91sam9_wdt.c | 4 ++++ 2 files changed, 7 insertions(+)
applied to u-boot-atmel/master, thanks!
Best regards, Andreas Bießmann

enable WDT for the taurus board.
Signed-off-by: Heiko Schocher hs@denx.de ---
include/configs/taurus.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/taurus.h b/include/configs/taurus.h index 65468ad..b61dc2d 100644 --- a/include/configs/taurus.h +++ b/include/configs/taurus.h @@ -121,6 +121,12 @@ #define CONFIG_RMII #define CONFIG_AT91_WANTS_COMMON_PHY
+#define CONFIG_AT91SAM9_WATCHDOG +#if !defined(CONFIG_SPL_BUILD) +/* Enable the watchdog */ +#define CONFIG_HW_WATCHDOG +#endif + /* USB */ #if defined(CONFIG_BOARD_TAURUS) #define CONFIG_USB_ATMEL

Dear Heiko Schocher,
Heiko Schocher hs@denx.de writes:
enable WDT for the taurus board.
Signed-off-by: Heiko Schocher hs@denx.de
include/configs/taurus.h | 6 ++++++ 1 file changed, 6 insertions(+)
applied to u-boot-atmel/master, thanks!
Best regards, Andreas Bießmann
participants (4)
-
Andreas Bießmann
-
Heiko Schocher
-
Jeremiah Mahler
-
Simon Glass