]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: turris_omnia: disable MCU watchdog in board_late_init()
authorMarek Behún <marek.behun@nic.cz>
Mon, 16 Aug 2021 13:19:40 +0000 (15:19 +0200)
committerStefan Roese <sr@denx.de>
Wed, 1 Sep 2021 06:09:24 +0000 (08:09 +0200)
Disable MCU watchdog in board_late_init() instead of board_init(), so
that it is disabled after U-Boot enables SOC watchdog instead of before.
This way there is no window when the board is vulnerable.

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

index b0391c973d9229af6a0893febf60d749b3e05235..bac78af04e068879d5919292e4ce3bf68b0bc565 100644 (file)
@@ -434,6 +434,11 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
+       return 0;
+}
+
+int board_late_init(void)
+{
        /*
         * If not booting from UART, MCU watchdog was not disabled in SPL,
         * disable it now.
@@ -441,11 +446,6 @@ int board_init(void)
        if (get_boot_device() != BOOT_DEVICE_UART)
                disable_mcu_watchdog();
 
-       return 0;
-}
-
-int board_late_init(void)
-{
        set_regdomain();
        handle_reset_button();
        pci_init();