[U-Boot] [PATCH v4] at91: Don't initialize watchdog if CONFIG_SKIP_WATCHDOG_INIT is defined

Reinhard Meyer u-boot at emk-elektronik.de
Fri Aug 20 14:31:22 CEST 2010


Dear Alexander Stein,

just to bring in my thoughts to this watchdog issue,
and to explain what I think the issue is here:

1. on (all?) AT91SAM9 devices the watchdog is initially enabled
(after Reset) with a 16 second timeout (provides a 32kHz Xtal
is used).

2. the watchdog mode register can only be written once, then it
becomes read-only.

3. on (all?) systems without NOR flash u-boot is a secondary
boot loader. That primary bootloader in that case _could_ have
written the mode register.

4. usually systems would leave the watchdog untouched until the
final operating systems takes over.

That means that we should have two, positively acting defines that

1. make u-boot retrigger the watchdog within the 16 second interval
(if NOT defined, u-boot will NOT retrigger the watchdog)

2. make u-boot write the mode register with any user defined value
(watchdog disabled (forever), or enabled with different timeout or
action)

The define for 1. could essentially be on for every system, because
it would not hurt to retrigger a disabled watchdog; the define for 2.
would require the define 1., if the watchdog stays enabled.

So... that being said, can we go forward as follows:

CONFIG_AT91SAM9_WATCHDOG and CONFIG_HW_WATCHDOG
need both be defined so u-boot will periodically retrigger the watchdog
independant of its mode.

CONFIG_SYS_WDTC_WDMR_VAL, _IF_ defined will make u-boot write that
value into the watchdog mode register.

I know that is exactly Alexander's original proposal, and with proper
README it should be understandable that this is the right way to do it.

Best Regards,
Reinhard




More information about the U-Boot mailing list