On Mon, Sep 19, 2011 at 03:23:59PM -0300, Fabio Estevam wrote: > i.MX reference manual states that software can only write "1" into the WDE bit. But it also says "Note: This bit can be set/reset in debug mode (exception)." > Remove the line that sets 0 to this bit and while at it remove an unneeded extra > write to register WCR. The MX31 manual says in 37.5.3.1: "The Watchdog Control Register (WCR) field WT[7:0] must have a time-out value written to it before the Watchdog can be enabled. The WDOG is enabled by setting the Watchdog Enable (WDE) bit in the WCR." I seem to recall that on some imx that two-folded write was indeed necessary. I'd say better safe than sorry and keep things as they are? > > Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> > --- > drivers/watchdog/imx2_wdt.c | 5 +---- > 1 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c > index b8ef2c6..19df82d 100644 > --- a/drivers/watchdog/imx2_wdt.c > +++ b/drivers/watchdog/imx2_wdt.c > @@ -89,13 +89,10 @@ static inline void imx2_wdt_setup(void) > val &= ~IMX2_WDT_WCR_WT; > /* Generate reset if WDOG times out */ > val &= ~IMX2_WDT_WCR_WRE; > - /* Keep Watchdog Disabled */ > - val &= ~IMX2_WDT_WCR_WDE; > + > /* Set the watchdog's Time-Out value */ > val |= WDOG_SEC_TO_COUNT(imx2_wdt.timeout); > > - __raw_writew(val, imx2_wdt.base + IMX2_WDT_WCR); > - > /* enable the watchdog */ > val |= IMX2_WDT_WCR_WDE; > __raw_writew(val, imx2_wdt.base + IMX2_WDT_WCR); > -- > 1.6.0.4 > > -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature