Skip to contentSkip to conversation

Convert at91 watchdog driver to new SoC access

PATCH New Achim Ehrlich 3 participants 4 messages Mar 17, 2010 – Mar 28, 2010

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

PATCH 1/1 Convert at91 watchdog driver to new SoC access

This converts the at91 watchdog driver to new c structure type to access registers of the SoC

---
 drivers/watchdog/at91sam9_wdt.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
drivers/watchdog/at91sam9_wdt.c +11 -10
index 5bb8b77..25afae7 100644
@@ -42,11 +42,10 @@
 static int at91_wdt_settimeout(unsigned int timeout)
 {
 	unsigned int reg;
-	unsigned int mr;
+	at91_wdt_t *wd 	= (at91_wdt_t *) AT91_WDT_BASE;
 
 	/* Check if disabled */
-	mr = at91_sys_read(AT91_WDT_MR);
-	if (mr & AT91_WDT_WDDIS) {
+	if (readl(&wd->mr) & AT91_WDT_MR_WDDIS) {
 		printf("sorry, watchdog is disabled\n");
 		return -1;
 	}
@@ -57,19 +56,21 @@ static int at91_wdt_settimeout(unsigned int timeout)
 	 * Since WDV is a 12-bit counter, the maximum period is
 	 * 4096 / 256 = 16 seconds.
 	 */
-	reg = AT91_WDT_WDRSTEN	/* causes watchdog reset */
-		/* | AT91_WDT_WDRPROC	causes processor reset only */
-		| AT91_WDT_WDDBGHLT		/* disabled in debug mode */
-		| AT91_WDT_WDD			/* restart at any time */
-		| (timeout & AT91_WDT_WDV);	/* timer value */
-	at91_sys_write(AT91_WDT_MR, reg);
+
+	reg = AT91_WDT_MR_WDRSTEN		/* causes watchdog reset */
+		| AT91_WDT_MR_WDDBGHLT		/* disabled in debug mode */
+		| AT91_WDT_MR_WDD(0xfff)	/* restart at any time */
+		| AT91_WDT_MR_WDV(timeout);	/* timer value */
+
+	writel(reg, &wd->mr);
 
 	return 0;
 }
 
 void hw_watchdog_reset(void)
 {
-	at91_sys_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
+	at91_wdt_t *wd 	= (at91_wdt_t *) AT91_WDT_BASE;
+	writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, &wd->cr);
 }
 
 void hw_watchdog_init(void)
Signature · 1 line
1.6.4.4
Applied
#1 lore raw

PATCH 1/1 Convert at91 watchdog driver to new SoC access

Quoted 4 lines · Achim Ehrlich

This converts the at91 watchdog driver to new c structure type to access registers of the SoC

Applied to arm/next
Thanks
Tom

#2 lore raw

PATCH 1/1 Convert at91 watchdog driver to new SoC access

Hello,

Am 23.03.2010 16:58, schrieb Tom:

Quoted 7 lines
Quoted 4 lines · Achim Ehrlich

This converts the at91 watchdog driver to new c structure type to access registers of the SoC

Applied to arm/next

Maybe this should go to the current branch because the watchdog-driver currently doesn't compile for an at91sam9263-ek board. CONFIG_AT91_LEGACY is already off for this board.

Regards,

Alexander

#3 lore raw

PATCH 1/1 Convert at91 watchdog driver to new SoC access

Quoted 7 lines · Alexander Holler

Hello,

Am 23.03.2010 16:58, schrieb Tom:

Quoted 4 lines
Quoted 3 lines · Achim Ehrlich

This converts the at91 watchdog driver to new c structure type to access registers of the SoC

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

Applied to arm/next

Maybe this should go to the current branch because the watchdog-driver currently doesn't compile for an at91sam9263-ek board. CONFIG_AT91_LEGACY is already off for this board.

Regards,

Wolfgang,
Can this go into 2010.03?
Tom

Quoted 6 lines

Alexander
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot