Skip to contentSkip to conversation

arm, at91: update SPL wdt support

PATCH New Heiko Schocher 4 participants 13 messages Jan 21, 2015 – Feb 7, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/4 arm, at91, wdt: do not disable WDT in SPL

if CONFIG_AT91SAM9_WATCHDOG is set, do not disable WDT in SPL

---

 arch/arm/cpu/at91-common/spl.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/cpu/at91-common/spl.c +4 -0
index 6473320..aaa5eec 100644
@@ -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)
 {
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/4 arm, at91, wdt: do not disable WDT in SPL

Dear Heiko Schocher,

Quoted 8 lines · Heiko Schocher

if CONFIG_AT91SAM9_WATCHDOG is set, do not disable WDT in SPL

---

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

#3 lore raw

PATCH 2/4 common/board_f: add at91 wdt

In reply to Heiko Schocher

call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG is used.

---

 common/board_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_f.c +1 -1
index 3a4b32c..693a75c 100644
@@ -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");
Signature · 1 line
2.1.0
#6 lore raw

PATCH 3/4 arm, at91, wdt: make timeout configurable

In reply to Heiko Schocher

make the HW WDT timeout configurable through the define CONFIG_AT91_HW_WDT_TIMEOUT.

---

 README                          | 3 +++
 drivers/watchdog/at91sam9_wdt.c | 4 ++++
 2 files changed, 7 insertions(+)
README +3 -0
index fefa71c..5cce4c2 100644
@@ -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
drivers/watchdog/at91sam9_wdt.c +4 -0
index ffd49a2..03c786c 100644
@@ -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)
Signature · 1 line
2.1.0
#7 lore raw

PATCH 3/4 arm, at91, wdt: make timeout configurable

Heiko,

On Wed, Jan 21, 2015 at 08:38:22AM +0100, Heiko Schocher wrote:
[...]

README The following options need to be configured: · line 1262

Quoted 11 lines
README +3 -0
index fefa71c..5cce4c2 100644
@@ -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).

[...]

Signature · 1 line
- Jeremiah Mahler
#8 lore raw

PATCH 3/4 arm, at91, wdt: make timeout configurable

Hello Jeremiah,

Am 21.01.2015 13:35, schrieb Jeremiah Mahler:

Quoted 20 lines

Heiko,

On Wed, Jan 21, 2015 at 08:38:22AM +0100, Heiko Schocher wrote:
[...]

README The following options need to be configured: · line 1262

Quoted 11 lines
README +3 -0
index fefa71c..5cce4c2 100644
@@ -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'.

Review

Quoted 1 line
(quoted diff) +1 -0
+		Specify the timeout in seconds (default 2).

Thanks! (Sorry for my bad denglish ...)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#9 lore raw

PATCH 3/4 arm, at91, wdt: make timeout configurable

Heiko,

On Wed, Jan 21, 2015 at 01:38:47PM +0100, Heiko Schocher wrote:
[...]

Quoted 3 lines

Thanks! (Sorry for my bad denglish ...)

No need to apologize.

Ich spreche nicht so gut Deutsch. :-)

Quoted 5 lines

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Signature · 1 line
- Jeremiah Mahler
#10 lore raw

PATCH 3/4 arm, at91, wdt: make timeout configurable

In reply to Heiko Schocher

Dear Heiko Schocher,

Quoted 9 lines · Heiko Schocher

make the HW WDT timeout configurable through the define CONFIG_AT91_HW_WDT_TIMEOUT.

---

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

#11 lore raw

PATCH 4/4 arm, at91, taurus: enable WDT

In reply to Heiko Schocher

enable WDT for the taurus board.

---

 include/configs/taurus.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/taurus.h +6 -0
index 65468ad..b61dc2d 100644
@@ -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
Signature · 1 line
2.1.0
#12 lore raw

PATCH 4/4 arm, at91, taurus: enable WDT

Dear Heiko Schocher,

Quoted 7 lines · Heiko Schocher

enable WDT for the taurus board.

---

include/configs/taurus.h | 6 ++++++

1 file changed, 6 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann