Skip to contentSkip to conversation

K3: wait for TIFS init before CTRL_MMR unlock

PATCH Superseded Markus Schneider-Pargmann 4 participants 16 messages Oct 16 – Oct 23

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover K3: wait for TIFS init before CTRL_MMR unlock

Hi,

this series uses a TIFS barrier before doing the ctrl_mmr_unlock(). This specific implementation works for the platforms where TIFS is already running at this point. Note that other K3 platforms may have the same problem, but for these this implementation is not straight forward.

This series is only tested on am625 HS-SE. I don't have any other HS-SE boards.

Best,
Markus

---
Changes in v2:
- Create a common helper k3_sysfw_wait_ready() to make the purpose of
the get_ti_sci_handle() clear.
- Extend the series to the other SoCs with the same boot process: am62a7,
am62p5 and j722s.
- Link to v1: https://patch.msgid.link/20260923-v2026-10-next-topic-am62-hs-se-fix-unlock-race-v1-1-300ddb9f5be8@baylibre.com

To: [email protected]

Cc Tom Rini <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Daniel Schultz <[email protected]>
Cc Udit Kumar <[email protected]>
Cc Richard Genoud <[email protected]>
Cc Anshul Dalal <[email protected]>
Cc Aristo Chen <[email protected]>

---
Markus Schneider-Pargmann (5):
arm: mach-k3: common: add helper to wait for TIFS initialization
arm: mach-k3: am625: Wait for TIFS initialization
arm: mach-k3: am62a7: Wait for TIFS initialization
arm: mach-k3: am62p5: Wait for TIFS initialization
arm: mach-k3: j722s: Wait for TIFS initialization

 arch/arm/mach-k3/am62ax/am62a7_init.c |  5 +++--
 arch/arm/mach-k3/am62px/am62p5_init.c |  5 +++--
 arch/arm/mach-k3/am62x/am625_init.c   |  5 +++--
 arch/arm/mach-k3/common.c             | 10 ++++++++++
 arch/arm/mach-k3/common.h             |  1 +
 arch/arm/mach-k3/j722s/j722s_init.c   |  5 +++--
 6 files changed, 23 insertions(+), 8 deletions(-)

---
base-commit: 75df64103873fac09642860cedadaffb8cf6b2c7
change-id: 20260923-v2026-10-next-topic-am62-hs-se-fix-unlock-race-15fda445257e

Best regards,

Signature · 1 line
Markus Schneider-Pargmann <[email protected]>
#1 lore raw

PATCH v2 1/5 arm: mach-k3: common: add helper to wait for TIFS initialization

Add a helper to wait for TIFS initialization to be finished. Effectively this is just a call to get_ti_sci_handle() but I think a separate function makes the purpose of this call better visible.

get_ti_sci_handle() internally leads to fetching the TIFS version with a message and response. TIFS only responds once initialization finished. If a response is not received get_ti_sci_handle() returns after a timeout.

---
 arch/arm/mach-k3/common.c | 10 ++++++++++
 arch/arm/mach-k3/common.h |  1 +
 2 files changed, 11 insertions(+)
arch/arm/mach-k3/common.c +10 -0
index 6e382efdb3be..480c90cfa65f 100644
@@ -54,6 +54,16 @@ struct ti_sci_handle *get_ti_sci_handle(void)
 	return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
 }
 
+void k3_sysfw_wait_ready(void)
+{
+	/*
+	 * Wait for TIFS initialization to finish. This helper is used to make
+	 * sure TIFS removed the firewall before U-Boot tries to unlock CTRL_MMR
+	 * registers and continues the boot.
+	 */
+	get_ti_sci_handle();
+}
+
 void k3_sysfw_print_ver(void)
 {
 	struct ti_sci_handle *ti_sci = get_ti_sci_handle();
arch/arm/mach-k3/common.h +1 -0
index 37ff98d89924..146b986febc6 100644
@@ -38,6 +38,7 @@ void disable_linefill_optimization(void);
 int remove_fwl_region(struct fwl_data *fwl);
 void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
+void k3_sysfw_wait_ready(void);
 void k3_sysfw_print_ver(void);
 void k3_dm_print_ver(void);
 void spl_enable_cache(void);
Signature · 1 line
2.55.0
Reviewed-by on v2 1/5
#2 lore raw

Re: [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization

Quoted 20 lines · Markus Schneider-Pargmann

Add a helper to wait for TIFS initialization to be finished. Effectively this is just a call to get_ti_sci_handle() but I think a separate function makes the purpose of this call better visible.

get_ti_sci_handle() internally leads to fetching the TIFS version with a message and response. TIFS only responds once initialization finished. If a response is not received get_ti_sci_handle() returns after a timeout.

---
 arch/arm/mach-k3/common.c | 10 ++++++++++
 arch/arm/mach-k3/common.h |  1 +
 2 files changed, 11 insertions(+)
arch/arm/mach-k3/common.c +0 -0
index 6e382efdb3be..480c90cfa65f 100644

arch/arm/mach-k3/common.c struct ti_sci_handle *get_ti_sci_handle(void) · line 57

Quoted 4 lines
arch/arm/mach-k3/common.c +1 -0
@@ -54,6 +54,16 @@ struct ti_sci_handle *get_ti_sci_handle(void)
 	return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
 }
 
+void k3_sysfw_wait_ready(void)

Please put some warning on use of this function. On few SOCs like J721E, u-boot loads the TIFS firmware. In such case, no point of calling this function.

With added comments, please use

Quoted 25 lines
arch/arm/mach-k3/common.c +9 -0
+{
+	/*
+	 * Wait for TIFS initialization to finish. This helper is used to make
+	 * sure TIFS removed the firewall before U-Boot tries to unlock CTRL_MMR
+	 * registers and continues the boot.
+	 */
+	get_ti_sci_handle();
+}
+
 void k3_sysfw_print_ver(void)
 {
 	struct ti_sci_handle *ti_sci = get_ti_sci_handle();
arch/arm/mach-k3/common.h +1 -0
index 37ff98d89924..146b986febc6 100644
@@ -38,6 +38,7 @@ void disable_linefill_optimization(void);
 int remove_fwl_region(struct fwl_data *fwl);
 void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
+void k3_sysfw_wait_ready(void);
 void k3_sysfw_print_ver(void);
 void k3_dm_print_ver(void);
 void spl_enable_cache(void);
#3 lore raw

PATCH v2 2/5 arm: mach-k3: am625: Wait for TIFS initialization

In reply to Markus Schneider-Pargmann

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.

---
 arch/arm/mach-k3/am62x/am625_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/am62x/am625_init.c +3 -2
index decb50bf853d..9358f406ee21 100644
@@ -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.
Signature · 1 line
2.55.0
#4 lore raw

PATCH v2 3/5 arm: mach-k3: am62a7: Wait for TIFS initialization

In reply to Markus Schneider-Pargmann

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.

---
 arch/arm/mach-k3/am62ax/am62a7_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/am62ax/am62a7_init.c +3 -2
index 0d86d52ef267..da1ae57f2558 100644
@@ -134,11 +134,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.
Signature · 1 line
2.55.0
#5 lore raw

PATCH v2 4/5 arm: mach-k3: am62p5: Wait for TIFS initialization

In reply to Markus Schneider-Pargmann

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.

---
 arch/arm/mach-k3/am62px/am62p5_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/am62px/am62p5_init.c +3 -2
index 599ea7cf2dd8..5a27e18f2063 100644
@@ -116,13 +116,14 @@ void board_init_f(ulong dummy)
 	 */
 	store_boot_info_from_rom();
 
-	ctrl_mmr_unlock();
-
 	/* Init DM early */
 	ret = spl_early_init();
 	if (ret)
 		panic("spl_early_init() failed: %d\n", ret);
 
+	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.
Signature · 1 line
2.55.0
#6 lore raw

PATCH v2 5/5 arm: mach-k3: j722s: Wait for TIFS initialization

In reply to Markus Schneider-Pargmann

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.

---
 arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/j722s/j722s_init.c +3 -2
index 1180c75f551d..c15b3b2682d9 100644
@@ -84,13 +84,14 @@ static void k3_spl_init(void)
 	 */
 	store_boot_info_from_rom();
 
-	ctrl_mmr_unlock();
-
 	/* Init DM early */
 	ret = spl_early_init();
 	if (ret)
 		panic("spl_early_init() failed: %d\n", ret);
 
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
 	/*
 	 * Process pinctrl for the serial0 a.k.a. WKUP_UART0 module and continue
 	 * regardless of the result of pinctrl. Do this without probing the
Signature · 1 line
2.55.0
Tested-by on v2 5/5
#7 lore raw

Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization

Quoted 7 lines · Markus Schneider-Pargmann

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.

Quoted 8 lines

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.

---

I have tested on J722S hs-fs and hs-se devices, Post this patch wdt reset got functional on hs-se device.

So for this patch

Quoted 25 lines
 arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/j722s/j722s_init.c +3 -2
index 1180c75f551d..c15b3b2682d9 100644
@@ -84,13 +84,14 @@ static void k3_spl_init(void)
 	 */
 	store_boot_info_from_rom();
 
-	ctrl_mmr_unlock();
-
 	/* Init DM early */
 	ret = spl_early_init();
 	if (ret)
 		panic("spl_early_init() failed: %d\n", ret);
 
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
 	/*
 	 * Process pinctrl for the serial0 a.k.a. WKUP_UART0 module and continue
 	 * regardless of the result of pinctrl. Do this without probing the
#8 lore raw

Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization

Le 17/10/2026 à 04:40, Kumar, Udit a écrit :

Quoted 19 lines · Markus Schneider-Pargmann
Quoted 7 lines

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.

Quoted 8 lines

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.

---

Quoted 7 lines

I have tested on J722S hs-fs and hs-se devices, Post this patch wdt reset got functional on hs-se device.

So for this patch

I tested it on my LPM series with j722s HS-FS, and I still need a ctrl_mmr_unlock() before spl_early_init() and also another after k3_sysfw_print_ver() otherwise querying pmic fails.

Regards,
Richard

Quoted 26 lines
Quoted 25 lines
  arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/j722s/j722s_init.c +3 -2
index 1180c75f551d..c15b3b2682d9 100644
@@ -84,13 +84,14 @@ static void k3_spl_init(void)
  	 */
  	store_boot_info_from_rom();
 
-	ctrl_mmr_unlock();
-
  	/* Init DM early */
  	ret = spl_early_init();
  	if (ret)
  		panic("spl_early_init() failed: %d\n", ret);
 
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
  	/*
  	 * Process pinctrl for the serial0 a.k.a. WKUP_UART0 module and continue
  	 * regardless of the result of pinctrl. Do this without probing the
Signature · 3 lines
Richard Genoud, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization

Quoted 25 lines · Richard GENOUD

Le 17/10/2026 à 04:40, Kumar, Udit a écrit :

Quoted 24 lines · Markus Schneider-Pargmann
Quoted 11 lines

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.

Quoted 6 lines

[email protected]/

[email protected]/

---

I have tested on J722S hs-fs and hs-se devices, Post this patch wdt reset got functional on hs-se device.

Quoted 8 lines
Quoted 4 lines

So for this patch

I tested it on my LPM series with j722s HS-FS, and I still need a ctrl_mmr_unlock() before spl_early_init() and also another after k3_sysfw_print_ver() otherwise querying pmic fails.

Thanks Richard for testing LPM flow.
I realized now, you need PMIC which is probed in spl_early_init(), so MMR has to be unlocked before this call.

However below patch fixes wdt flow in HS_SE devices.

Quoted 32 lines

Regards,
Richard

Quoted 27 lines
Quoted 26 lines

  arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--

  1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/ renamed from arch/arm/mach-k3/j722s/j722s_init.c +0 -0

j722s/j722s_init.c
index 1180c75f551d..c15b3b2682d9 100644

arch/arm/mach-k3/j722s/j722s_init.c +2 -1
@@ -84,13 +84,14 @@ static void k3_spl_init(void)
        */
       store_boot_info_from_rom();
   -    ctrl_mmr_unlock();
-
       /* Init DM early */
       ret = spl_early_init();
       if (ret)
           panic("spl_early_init() failed: %d\n", ret);
   +    k3_sysfw_wait_ready();
+    ctrl_mmr_unlock();
+
       /*
        * Process pinctrl for the serial0 a.k.a. WKUP_UART0 module and

continue
       * regardless of the result of pinctrl. Do this without probing the

#10 lore raw

PATCH 1/3 arm: mach-k3: common: add helper to wait for TIFS initialization

Add a helper to wait for TIFS initialization to be finished. Effectively this is just a call to get_ti_sci_handle() but I think a separate function makes the purpose of this call better visible.

get_ti_sci_handle() internally leads to fetching the TIFS version with a message and response. TIFS only responds once initialization finished. If a response is not received get_ti_sci_handle() returns after a timeout.

---
 arch/arm/mach-k3/common.c | 10 ++++++++++
 arch/arm/mach-k3/common.h |  1 +
 2 files changed, 11 insertions(+)
arch/arm/mach-k3/common.c +10 -0
index 6e382efdb3be..480c90cfa65f 100644
@@ -54,6 +54,16 @@ struct ti_sci_handle *get_ti_sci_handle(void)
 	return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
 }
 
+void k3_sysfw_wait_ready(void)
+{
+	/*
+	 * Wait for TIFS initialization to finish. This helper is used to make
+	 * sure TIFS removed the firewall before U-Boot tries to unlock CTRL_MMR
+	 * registers and continues the boot.
+	 */
+	get_ti_sci_handle();
+}
+
 void k3_sysfw_print_ver(void)
 {
 	struct ti_sci_handle *ti_sci = get_ti_sci_handle();
arch/arm/mach-k3/common.h +1 -0
index 37ff98d89924..146b986febc6 100644
@@ -38,6 +38,7 @@ void disable_linefill_optimization(void);
 int remove_fwl_region(struct fwl_data *fwl);
 void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
+void k3_sysfw_wait_ready(void);
 void k3_sysfw_print_ver(void);
 void k3_dm_print_ver(void);
 void spl_enable_cache(void);
Signature · 1 line
2.56.0
#11 lore raw

PATCH 2/3 dm: core: Add SPL_DM_EVENT

Add an option to allow DM_EVENT in SPL.

---
 drivers/core/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/core/Kconfig +10 -0
index ae0c34667723..22b72d6b766c 100644
@@ -117,6 +117,16 @@ config DM_EVENT
 	  register a 'spy' function that is called when the event occurs. Such
 	  subsystems must select this option.
 
+config SPL_DM_EVENT
+	bool
+	depends on SPL_DM
+	select SPL_EVENT
+	help
+	  This enables support for generating events related to driver model
+	  operations in SPL, such as probing or removing a device. Subsystems
+	  can register a 'spy' function that is called when the event occurs.
+	  Such subsystems must select this option.
+
 config SPL_DM_DEVICE_REMOVE
 	bool "Support device removal in SPL"
 	depends on SPL_DM
Signature · 1 line
2.56.0
#12 lore raw

Re: [PATCH 2/3] dm: core: Add SPL_DM_EVENT

Hi Markus,

Quoted 3 lines · Markus Schneider-Pargmann

dm: core: Add SPL_DM_EVENT

Add an option to allow DM_EVENT in SPL.

Please can you give the reason here: K3 needs to run code from EVT_DM_POST_INIT_F in SPL, before anything is probed. It would also be worth noting that this makes device_notify() send probe/remove events for every device in SPL, not just the post-init event.

drivers/core/Kconfig config DM_EVENT · line 120

Quoted 6 lines
drivers/core/Kconfig +4 -0
@@ -117,6 +117,16 @@ config DM_EVENT
+config SPL_DM_EVENT
+	bool
+	depends on SPL_DM
+	select SPL_EVENT

SPL_EVENT is inside the 'if EVENT' block in common/Kconfig, so a board selecting SPL_DM_EVENT without EVENT gets an unmet-dependency warning and SPL_EVENT is forced on anyway. This is fine for j722s, which already enables EVENT, but please can you add 'depends on SPL_DM && EVENT' so it works for other boards too?

Regards,
Simon

#13 lore raw

PATCH 3/3 WIP: arm: mach-k3: j722s: Wait for TIFS initialization

In reply to Markus Schneider-Pargmann
---
 arch/arm/mach-k3/Kconfig            |  1 +
 arch/arm/mach-k3/j722s/j722s_init.c | 20 +++++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/mach-k3/Kconfig +1 -0
index a32ed3a9683f..ec3e95c11a39 100644
@@ -30,6 +30,7 @@ config SOC_K3_J721S2
 
 config SOC_K3_J722S
 	bool "TI's K3 based J722S SoC Family Support"
+	select SPL_DM_EVENT if SPL
 
 config SOC_K3_J784S4
 	bool "TI's K3 based J784S4 SoC Family Support"
arch/arm/mach-k3/j722s/j722s_init.c +17 -3
index 1180c75f551d..685c4d98a8a5 100644
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <dm/pinctrl.h>
+#include <event.h>
 
 #include "../sysfw-loader.h"
 #include "../common.h"
@@ -70,6 +71,18 @@ static void ctrl_mmr_unlock(void)
 	mmr_unlock(PADCFG_MMR1_BASE, 1);
 }
 
+/*
+ * Called by spl_early_init() before anything is probed.
+ */
+static int k3_spl_dm_post_init_f(void)
+{
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
+	return 0;
+}
+EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, k3_spl_dm_post_init_f);
+
 static void k3_spl_init(void)
 {
 	struct udevice *dev;
@@ -84,9 +97,10 @@ static void k3_spl_init(void)
 	 */
 	store_boot_info_from_rom();
 
-	ctrl_mmr_unlock();
-
-	/* Init DM early */
+	/*
+	 * Init DM early. Note that this calls k3_spl_dm_post_init_f before
+	 * probing to do ctrl_mmr_unlock.
+	 */
 	ret = spl_early_init();
 	if (ret)
 		panic("spl_early_init() failed: %d\n", ret);
Signature · 1 line
2.56.0
#14 lore raw

Re: [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization

Hi,

On Thu Oct 22, 2026 at 12:15 PM CEST, Markus Schneider-Pargmann wrote:
...

arch/arm/mach-k3/j722s/j722s_init.c static void ctrl_mmr_unlock(void) · line 84

Quoted 11 lines
arch/arm/mach-k3/j722s/j722s_init.c +11 -0
+/*
+ * Called by spl_early_init() before anything is probed.
+ */
+static int k3_spl_dm_post_init_f(void)
+{
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
+	return 0;
+}
+EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, k3_spl_dm_post_init_f);

I am wondering if this would work for your situation where the PMIC is probed immediately?

Best
Markus

#15 lore raw

Re: [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization

Hi Markus,

Le 22/10/2026 à 12:18, Markus Schneider-Pargmann a écrit :

Quoted 4 lines

Hi,

On Thu Oct 22, 2026 at 12:15 PM CEST, Markus Schneider-Pargmann wrote:
...

Quoted 14 lines

arch/arm/mach-k3/j722s/j722s_init.c static void ctrl_mmr_unlock(void) · line 84

Quoted 11 lines
arch/arm/mach-k3/j722s/j722s_init.c +11 -0
+/*
+ * Called by spl_early_init() before anything is probed.
+ */
+static int k3_spl_dm_post_init_f(void)
+{
+	k3_sysfw_wait_ready();
+	ctrl_mmr_unlock();
+
+	return 0;
+}
+EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, k3_spl_dm_post_init_f);

I am wondering if this would work for your situation where the PMIC is probed immediately?

I've just tried those patches, and indeed, it works for j722s HS-FS.
I have to drop the ctrl_mmr_unlock() that was done after k3_sysfw_print_ver(); in my series, and everything is working nicely. That's great!

Quoted 3 lines

Best
Markus

Regards,
Richars