summaryrefslogtreecommitdiff
path: root/board/CZ.NIC
diff options
context:
space:
mode:
authorMarek Behún <marek.behun@nic.cz>2021-08-16 16:19:39 +0300
committerStefan Roese <sr@denx.de>2021-09-01 09:09:24 +0300
commitaeb0ca64dbb5e4b1f58c5b723d92220e7729aa37 (patch)
treeae305e0024c8ae1adfd64e01ec4df9f33ef90f76 /board/CZ.NIC
parent008a069b89c690077ff9fa351557c8fc0778755c (diff)
downloadu-boot-aeb0ca64dbb5e4b1f58c5b723d92220e7729aa37.tar.xz
arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART
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>
Diffstat (limited to 'board/CZ.NIC')
-rw-r--r--board/CZ.NIC/turris_omnia/turris_omnia.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index a84a409f43..b0391c973d 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -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;
}