ARM: mach-at91: how to stop U-Boot/SPL from disabling the watchdog timer on SAMAD3 Xplained

Michael Opdenacker michael.opdenacker at
Thu Dec 9 17:32:51 CET 2021


Documenting the issue and a workaround here in case other people
encounter it, but if you have tips for fixing the issue in U-Boot, I'm
interested of course!

I noticed that the SAMA5D3 Xplained board didn't have the watchdog timer
enabled in the Linux DTS.
I submitted a patch to fix this:

However, applying this patch isn't sufficient to make the watchdog
available on Linux:
at91_wdt fffffe40.watchdog: watchdog is disabled
at91_wdt: probe of fffffe40.watchdog failed with error -22

As explained on,
this happens because the bootloader or bootstrap code already disables
the watchdog. The trouble is, unlike on SAMA5D2 and SAMAD4 (if I
understood correctly),"The Watchdog Timer Mode Register can be only
written to once".

However, I haven't managed to disable this behavior in U-Boot (including
the SPL). I have no watchdog related option turned on anywhere, and by
adding puts() messages in the code, I believe that the wdt_stop()
function doesn't get called either. Maybe the corresponding watchdog
register is written to by the code initializing the SoC, but I couldn't
find where.

A workaround is to use at91bootstrap instead of U-Boot SPL, which has a
configuration parameter to disable to watchdog:
git clone
export CROSS_COMPILE=arm-linux- (whatever your cross-compiler is)
make sama5d3_xplainedsd_uboot_defconfig
make menuconfig (Disable CONFIG_DISABLE_WATCHDOG)
Copy boot.bin (under build/...) and u-boot.bin (from U-Boot sources) to
the SD card.

At least, this proves that the culprit is U-Boot SPL!

So, any advice for making it possible prevent the SPL from disabling the
watchdog on SAMA5D3 (Xplained at least)?


Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering

More information about the U-Boot mailing list