Commit fb688d9e authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Anup Patel
Browse files

platform: sifive_fu740: fix reset when watchdog is running



When the watchdog is running the HiFive Unmatched board does not reboot
properly and shuts down itself a few seconds after reboot, in the early
stages of the u-boot loading. On a Linux kernel this happens when the
da9063_wdt module is loaded. This does not happen if the module is
unloaded before reboot or if the watchdog module is loaded with
"stop_on_reboot=1".

Fix that by stopping the watchdog before attempting to reset the board.
This is done by zeroing the TWDSCALE field of CONTROL_D register, unless
it was already set to 0.

Reported-by: default avatarTianon Gravi <tianon@debian.org>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Reviewed-by: default avatarNikita Shubin <n.shubin@yadro.com>
Tested-by: default avatarNikita Shubin <n.shubin@yadro.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
parent 8257262d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment