[PATCH 1/6] Driver for the watchdog timer on Freescale IMX2 (and later) processors.

Wim Van Sebroeck wim at iguana.be
Tue May 25 07:06:44 EDT 2010


Hi Wolfram,

> > > > #define WDOG_SEC_TO_COUNT(s)	((s * 2) << 8)
> > > 
> > > Any reason you dropped the '- 1' from my version here?
> > 
> > If you want a timeout of 1 second, and you subtract the -1 then you only get
> > 0.5 seconds according to the reference manual.
> 
> Which one? MX27 and MX31 refman say the range is 0.5 to 128 seconds.
> So, 0x00 = 0.5s, 0x01 = 1.0s... The MX35 refman even has a table confirming this.

My fault. I interpreted it incorrectly. if you have 128 seconds then you indeed have value 0xFF << 8...
so -1 should indeed be there. This make the macro:
#define WDOG_SEC_TO_COUNT(s)	(((s * 2) - 1) << 8)

Thanks,
Wim.




More information about the linux-arm-kernel mailing list