The CTRL_MMR registers are firewalled at boot time, and TIFS unlock
them as part of the system firmware initialization sequence.

Current code assumes the CTRL_MMR space can be accessible at early
stage of board_init_f execution by unlocking them.

But on HS-SE devices, TIFS takes more time to complete initialization,
and CTRL_MMR registers remains firewalled and not getting unlocked.
Which results in any write to these registers are ignored.

So, move the CTRL_MMR unlock to a point after the TIFS version message is
received, ensuring that the firmware initialization has progressed and
CTRL_MMR can be unlocked successfully.

Fixes: 5e291ee34fd4 ("arch: mach-k3: Introduce basic files to support J722S SoC 
family")
Reported-by: Diwakar Dhyani <[email protected]>
Signed-off-by: Udit Kumar <[email protected]>
---
Changelog:
Changes in v2:
- Moved control mmr after tifs version
- updated commit msg
link
v1: https://lore.kernel.org/all/[email protected]/

Test logs of v2:
HS-FS: 
https://gist.github.com/uditkumarti/c66ecbe800b4b3549fec3e505fe26dbf#file-hs_fs
HS-SE: 
https://gist.github.com/uditkumarti/c66ecbe800b4b3549fec3e505fe26dbf#file-hs_se

 arch/arm/mach-k3/j722s/j722s_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/j722s/j722s_init.c 
b/arch/arm/mach-k3/j722s/j722s_init.c
index 1180c75f551..32a3eed40d4 100644
--- a/arch/arm/mach-k3/j722s/j722s_init.c
+++ b/arch/arm/mach-k3/j722s/j722s_init.c
@@ -84,8 +84,6 @@ static void k3_spl_init(void)
         */
        store_boot_info_from_rom();
 
-       ctrl_mmr_unlock();
-
        /* Init DM early */
        ret = spl_early_init();
        if (ret)
@@ -151,6 +149,8 @@ static void k3_spl_init(void)
        /* Output System Firmware version info */
        k3_sysfw_print_ver();
 
+       ctrl_mmr_unlock();
+
        /* Output DM Firmware version info */
        if (IS_ENABLED(CONFIG_ARM64))
                k3_dm_print_ver();
-- 
2.34.1

Reply via email to