* [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access
@ 2010-03-17 13:50 Achim Ehrlich
2010-03-23 15:58 ` Tom
0 siblings, 1 reply; 4+ messages in thread
From: Achim Ehrlich @ 2010-03-17 13:50 UTC (permalink / raw)
To: u-boot
This converts the at91 watchdog driver to new c structure
type to access registers of the SoC
Signed-off-by: Achim Ehrlich <aehrlich@taskit.de>
---
drivers/watchdog/at91sam9_wdt.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 5bb8b77..25afae7 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -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)
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access
2010-03-17 13:50 [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access Achim Ehrlich
@ 2010-03-23 15:58 ` Tom
2010-03-26 9:34 ` Alexander Holler
0 siblings, 1 reply; 4+ messages in thread
From: Tom @ 2010-03-23 15:58 UTC (permalink / raw)
To: u-boot
Achim Ehrlich wrote:
> This converts the at91 watchdog driver to new c structure
> type to access registers of the SoC
>
> Signed-off-by: Achim Ehrlich <aehrlich@taskit.de>
Applied to arm/next
Thanks
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access
2010-03-23 15:58 ` Tom
@ 2010-03-26 9:34 ` Alexander Holler
2010-03-28 23:07 ` Tom
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Holler @ 2010-03-26 9:34 UTC (permalink / raw)
To: u-boot
Hello,
Am 23.03.2010 16:58, schrieb Tom:
> Achim Ehrlich wrote:
>> This converts the at91 watchdog driver to new c structure
>> type to access registers of the SoC
>>
>> Signed-off-by: Achim Ehrlich<aehrlich@taskit.de>
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access
2010-03-26 9:34 ` Alexander Holler
@ 2010-03-28 23:07 ` Tom
0 siblings, 0 replies; 4+ messages in thread
From: Tom @ 2010-03-28 23:07 UTC (permalink / raw)
To: u-boot
Alexander Holler wrote:
> Hello,
>
> Am 23.03.2010 16:58, schrieb Tom:
>> Achim Ehrlich wrote:
>>> This converts the at91 watchdog driver to new c structure
>>> type to access registers of the SoC
>>>
>>> Signed-off-by: Achim Ehrlich<aehrlich@taskit.de>
>> 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
>
> Alexander
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-28 23:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 13:50 [U-Boot] [PATCH] [ARM] Convert at91 watchdog driver to new SoC access Achim Ehrlich
2010-03-23 15:58 ` Tom
2010-03-26 9:34 ` Alexander Holler
2010-03-28 23:07 ` Tom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox