aboutsummaryrefslogtreecommitdiff
path: root/board/kontron
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2021-11-15 23:45:49 +0100
committerPriyanka Jain <priyanka.jain@nxp.com>2022-02-28 11:59:35 +0530
commit453d1711d22c4bccd48848a8450aa95cbc5008cc (patch)
treec8ccdc9f46d091dea6f7bd7b35178ca70fb51b42 /board/kontron
parent2ba8a446ceece208c5926b623ddfd66bd163ff27 (diff)
downloadu-boot-453d1711d22c4bccd48848a8450aa95cbc5008cc.zip
u-boot-453d1711d22c4bccd48848a8450aa95cbc5008cc.tar.gz
u-boot-453d1711d22c4bccd48848a8450aa95cbc5008cc.tar.bz2
board: sl28: disable recovery watchdog
This board has an internal watchdog which supervises the board startup. Although, the initial state of the watchdog is configurable, it is enabled by default. In board_late_init(), which means almost everything worked as expected, disable the watchdog. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'board/kontron')
-rw-r--r--board/kontron/sl28/sl28.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c
index 9cde48e..3c48a91 100644
--- a/board/kontron/sl28/sl28.c
+++ b/board/kontron/sl28/sl28.c
@@ -15,6 +15,7 @@
#include <asm/arch/soc.h>
#include <fsl_immap.h>
#include <netdev.h>
+#include <wdt.h>
#include <sl28cpld.h>
#include <fdtdec.h>
@@ -73,6 +74,34 @@ int checkboard(void)
return 0;
}
+static void stop_recovery_watchdog(void)
+{
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get_device_by_driver(UCLASS_WDT,
+ DM_DRIVER_GET(sl28cpld_wdt), &dev);
+ if (!ret)
+ wdt_stop(dev);
+}
+
+int fsl_board_late_init(void)
+{
+ /*
+ * Usually, the after a board reset, the watchdog is enabled by
+ * default. This is to supervise the bootloader boot-up. Therefore,
+ * to prevent a watchdog reset if we don't actively kick it, we have
+ * to disable it.
+ *
+ * If the watchdog isn't enabled at reset (which is a configuration
+ * option) disabling it doesn't hurt either.
+ */
+ if (!CONFIG_IS_ENABLED(WATCHDOG_AUTOSTART))
+ stop_recovery_watchdog();
+
+ return 0;
+}
+
void detail_board_ddr_info(void)
{
print_ddr_info(0);