Re: [U-Boot] [PATCH] Hardware watchdog support for AT91SAM9260 CPU
On Wed, Oct 22, 2008 at 11:49:44PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 02:29 Fri 15 Aug , Sergey Lapin wrote: Dear Jean-Christophe, thanks a lot for your review. > > > Are you from ADI? No, but this file structure is a lot based on blackfin watchdog and I have too little code to make it int full intellectual property, IMHO. > > + * > > + * Licensed under the GPL-2 or later. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#ifdef CONFIG_HW_WATCHDOG > no need please remove Ok, > > +#define AT91_WDT_CR(AT91_WDT+0x00) > ^ > please add space arround '+' Ok. > > +#define AT91_WDT_MR(AT91_WDT+0x04) > > +#define AT91_WDT_SR(AT91_WDT+0x08) > > + > > +void hw_watchdog_reset(void) > > +{ > > + at91_sys_write(AT91_WDT_CR, 0xa501); > > please use macro you can import them > from Linux Is this kind of watchdog supported in Linux already? When I submitted this file it was not yet. All the best, S. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Hardware watchdog support for AT91SAM9260 CPU
On 02:29 Fri 15 Aug , Sergey Lapin wrote: > > Signed-off-by: Sergey Lapin <[EMAIL PROTECTED]> > --- > cpu/arm926ejs/at91/Makefile |1 + > cpu/arm926ejs/at91/watchdog.c | 35 +++ > 2 files changed, 36 insertions(+), 0 deletions(-) > create mode 100644 cpu/arm926ejs/at91/watchdog.c > > diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile > index 44cde1a..7befcd7 100644 > --- a/cpu/arm926ejs/at91/Makefile > +++ b/cpu/arm926ejs/at91/Makefile > @@ -29,6 +29,7 @@ COBJS-y += ether.o > COBJS-y += timer.o > COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o > COBJS-y += usb.o > +COBJS-$(CONFIG_HW_WATCHDOG) +=watchdog.o > SOBJS= lowlevel_init.o > > SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c) > diff --git a/cpu/arm926ejs/at91/watchdog.c b/cpu/arm926ejs/at91/watchdog.c > new file mode 100644 > index 000..da15268 > --- /dev/null > +++ b/cpu/arm926ejs/at91/watchdog.c > @@ -0,0 +1,35 @@ > +/* > + * watchdog.c - driver for at91sam9260 watchdog > + * This drivers can be used on all at91sam9 > + * Copyright (c) 2007-2008 Analog Devices Inc. Are you from ADI? > + * > + * Licensed under the GPL-2 or later. > + */ > + > +#include > +#include > +#include > +#include > + > +#ifdef CONFIG_HW_WATCHDOG no need please remove > +#define AT91_WDT_CR (AT91_WDT+0x00) ^ please add space arround '+' > +#define AT91_WDT_MR (AT91_WDT+0x04) > +#define AT91_WDT_SR (AT91_WDT+0x08) > + > +void hw_watchdog_reset(void) > +{ > + at91_sys_write(AT91_WDT_CR, 0xa501); please use macro you can import them from Linux > +} > + > +void hw_watchdog_init(void) > +{ > + /* 16 seconds timer, resets enabled */ > + at91_sys_write(AT91_WDT_MR, 0x3FFF2FFF); Ditto > +} > + > +void hw_watchdog_disable(void) > +{ > + /* Can't reenable per documentation */ > + at91_sys_write(AT91_WDT_MR, 0x8000); Ditto > +} > +#endif Best Regargds, J. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Hardware watchdog support for AT91SAM9260 CPU
On Fri, Aug 15, 2008 at 02:29:26AM +0400, Sergey Lapin wrote: > > Signed-off-by: Sergey Lapin <[EMAIL PROTECTED]> > --- > cpu/arm926ejs/at91/Makefile |1 + > cpu/arm926ejs/at91/watchdog.c | 35 +++ > 2 files changed, 36 insertions(+), 0 deletions(-) > create mode 100644 cpu/arm926ejs/at91/watchdog.c > > SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c) > diff --git a/cpu/arm926ejs/at91/watchdog.c b/cpu/arm926ejs/at91/watchdog.c > new file mode 100644 > index 000..da15268 > --- /dev/null > +++ b/cpu/arm926ejs/at91/watchdog.c > @@ -0,0 +1,35 @@ > +/* > + * watchdog.c - driver for at91sam9260 watchdog > + * > + * Copyright (c) 2007-2008 Analog Devices Inc. Oops, this is wrong (cut-paste error), will resubmit ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Hardware watchdog support for AT91SAM9260 CPU
Signed-off-by: Sergey Lapin <[EMAIL PROTECTED]> --- cpu/arm926ejs/at91/Makefile |1 + cpu/arm926ejs/at91/watchdog.c | 35 +++ 2 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 cpu/arm926ejs/at91/watchdog.c diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile index 44cde1a..7befcd7 100644 --- a/cpu/arm926ejs/at91/Makefile +++ b/cpu/arm926ejs/at91/Makefile @@ -29,6 +29,7 @@ COBJS-y += ether.o COBJS-y+= timer.o COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o COBJS-y+= usb.o +COBJS-$(CONFIG_HW_WATCHDOG) +=watchdog.o SOBJS = lowlevel_init.o SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c) diff --git a/cpu/arm926ejs/at91/watchdog.c b/cpu/arm926ejs/at91/watchdog.c new file mode 100644 index 000..da15268 --- /dev/null +++ b/cpu/arm926ejs/at91/watchdog.c @@ -0,0 +1,35 @@ +/* + * watchdog.c - driver for at91sam9260 watchdog + * + * Copyright (c) 2007-2008 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include +#include +#include +#include + +#ifdef CONFIG_HW_WATCHDOG +#define AT91_WDT_CR(AT91_WDT+0x00) +#define AT91_WDT_MR(AT91_WDT+0x04) +#define AT91_WDT_SR(AT91_WDT+0x08) + +void hw_watchdog_reset(void) +{ + at91_sys_write(AT91_WDT_CR, 0xa501); +} + +void hw_watchdog_init(void) +{ + /* 16 seconds timer, resets enabled */ + at91_sys_write(AT91_WDT_MR, 0x3FFF2FFF); +} + +void hw_watchdog_disable(void) +{ + /* Can't reenable per documentation */ + at91_sys_write(AT91_WDT_MR, 0x8000); +} +#endif -- 1.5.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot