On HS-SE platforms TIFS takes longer to initialize. TIFS only removes
the firewall on the registers at the end of initialization. On HS-SE the
U-Boot ctrl_mmr_unlock() can happen before TIFS removed the firewall
leading to a race condition. This leads to a broken watchdog since the
signal configuration doesn't succeed because the write doesn't take
effect.

Wait for TIFS to be initialized using k3_sysfw_wait_ready() before doing
ctrl_mmr_unlock(). Note that spl_early_init() needs to be done first to
setup DM.

Link: 
https://lore.kernel.org/u-boot/[email protected]/
Link: https://lore.kernel.org/u-boot/[email protected]/
Signed-off-by: Markus Schneider-Pargmann <[email protected]>
---
 arch/arm/mach-k3/am62x/am625_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/am62x/am625_init.c 
b/arch/arm/mach-k3/am62x/am625_init.c
index decb50bf853d..9358f406ee21 100644
--- a/arch/arm/mach-k3/am62x/am625_init.c
+++ b/arch/arm/mach-k3/am62x/am625_init.c
@@ -158,11 +158,12 @@ void board_init_f(ulong dummy)
         */
        store_boot_info_from_rom();
 
-       ctrl_mmr_unlock();
-
        /* Init DM early */
        spl_early_init();
 
+       k3_sysfw_wait_ready();
+       ctrl_mmr_unlock();
+
        /*
         * Process pinctrl for the serial0 and serial3, aka WKUP_UART0 and
         * MAIN_UART1 modules and continue regardless of the result of pinctrl.

-- 
2.55.0

Reply via email to