]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART
authorMarek Behún <marek.behun@nic.cz>
Mon, 16 Aug 2021 13:19:39 +0000 (15:19 +0200)
committerStefan Roese <sr@denx.de>
Wed, 1 Sep 2021 06:09:24 +0000 (08:09 +0200)
When booting over UART, sending U-Boot proper may take too much time and
MCU watchdog will reset the board before U-Boot proper is loaded.

Better disable MCU watchdog in SPL when booting over UART.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
board/CZ.NIC/turris_omnia/turris_omnia.c
configs/turris_omnia_defconfig

index a84a409f43f83e95b761322fd7b6b1351a549c75..b0391c973d9229af6a0893febf60d749b3e05235 100644 (file)
@@ -419,12 +419,27 @@ int board_early_init_f(void)
        return 0;
 }
 
+void spl_board_init(void)
+{
+       /*
+        * If booting from UART, disable MCU watchdog in SPL, since uploading
+        * U-Boot proper can take too much time and trigger it.
+        */
+       if (get_boot_device() == BOOT_DEVICE_UART)
+               disable_mcu_watchdog();
+}
+
 int board_init(void)
 {
        /* address of boot parameters */
        gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
-       disable_mcu_watchdog();
+       /*
+        * If not booting from UART, MCU watchdog was not disabled in SPL,
+        * disable it now.
+        */
+       if (get_boot_device() != BOOT_DEVICE_UART)
+               disable_mcu_watchdog();
 
        return 0;
 }
index 2acc4ada41230f930b80bc56b669da6aa2abf0a0..b2bbbd146943356c6214971c8d11667a81376de6 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
+CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_I2C=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y