* [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization
2026-10-16 9:05 [PATCH v2 0/5] K3: wait for TIFS init before CTRL_MMR unlock Markus Schneider-Pargmann
@ 2026-10-16 9:05 ` Markus Schneider-Pargmann
2026-10-17 2:44 ` Kumar, Udit
2026-10-16 9:05 ` [PATCH v2 2/5] arm: mach-k3: am625: Wait " Markus Schneider-Pargmann
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-16 9:05 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Udit Kumar,
Richard Genoud, Anshul Dalal, Aristo Chen,
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.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/common.c | 10 ++++++++++
arch/arm/mach-k3/common.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 6e382efdb3be..480c90cfa65f 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -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();
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 37ff98d89924..146b986febc6 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -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);
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization
2026-10-16 9:05 ` [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization Markus Schneider-Pargmann
@ 2026-10-17 2:44 ` Kumar, Udit
0 siblings, 0 replies; 15+ messages in thread
From: Kumar, Udit @ 2026-10-17 2:44 UTC (permalink / raw)
To: Markus Schneider-Pargmann, u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Richard Genoud,
Anshul Dalal, Aristo Chen, u-kumar1
On 10/16/2026 2:35 PM, Markus Schneider-Pargmann wrote:
> 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.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> ---
> arch/arm/mach-k3/common.c | 10 ++++++++++
> arch/arm/mach-k3/common.h | 1 +
> 2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
> index 6e382efdb3be..480c90cfa65f 100644
> --- a/arch/arm/mach-k3/common.c
> +++ b/arch/arm/mach-k3/common.c
> @@ -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
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
> +{
> + /*
> + * 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();
> diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
> index 37ff98d89924..146b986febc6 100644
> --- a/arch/arm/mach-k3/common.h
> +++ b/arch/arm/mach-k3/common.h
> @@ -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);
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/5] arm: mach-k3: am625: Wait for TIFS initialization
2026-10-16 9:05 [PATCH v2 0/5] K3: wait for TIFS init before CTRL_MMR unlock Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization Markus Schneider-Pargmann
@ 2026-10-16 9:05 ` Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 3/5] arm: mach-k3: am62a7: " Markus Schneider-Pargmann
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-16 9:05 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Udit Kumar,
Richard Genoud, Anshul Dalal, Aristo Chen,
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.
Link: https://lore.kernel.org/u-boot/20250815160240.3575140-1-d.schultz@phytec.de/
Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
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
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 3/5] arm: mach-k3: am62a7: Wait for TIFS initialization
2026-10-16 9:05 [PATCH v2 0/5] K3: wait for TIFS init before CTRL_MMR unlock Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 1/5] arm: mach-k3: common: add helper to wait for TIFS initialization Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 2/5] arm: mach-k3: am625: Wait " Markus Schneider-Pargmann
@ 2026-10-16 9:05 ` Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 4/5] arm: mach-k3: am62p5: " Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 5/5] arm: mach-k3: j722s: " Markus Schneider-Pargmann
4 siblings, 0 replies; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-16 9:05 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Udit Kumar,
Richard Genoud, Anshul Dalal, Aristo Chen,
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.
Link: https://lore.kernel.org/u-boot/20250815160240.3575140-1-d.schultz@phytec.de/
Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/am62ax/am62a7_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/am62ax/am62a7_init.c b/arch/arm/mach-k3/am62ax/am62a7_init.c
index 0d86d52ef267..da1ae57f2558 100644
--- a/arch/arm/mach-k3/am62ax/am62a7_init.c
+++ b/arch/arm/mach-k3/am62ax/am62a7_init.c
@@ -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.
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 4/5] arm: mach-k3: am62p5: Wait for TIFS initialization
2026-10-16 9:05 [PATCH v2 0/5] K3: wait for TIFS init before CTRL_MMR unlock Markus Schneider-Pargmann
` (2 preceding siblings ...)
2026-10-16 9:05 ` [PATCH v2 3/5] arm: mach-k3: am62a7: " Markus Schneider-Pargmann
@ 2026-10-16 9:05 ` Markus Schneider-Pargmann
2026-10-16 9:05 ` [PATCH v2 5/5] arm: mach-k3: j722s: " Markus Schneider-Pargmann
4 siblings, 0 replies; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-16 9:05 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Udit Kumar,
Richard Genoud, Anshul Dalal, Aristo Chen,
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.
Link: https://lore.kernel.org/u-boot/20250815160240.3575140-1-d.schultz@phytec.de/
Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/am62px/am62p5_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/am62px/am62p5_init.c b/arch/arm/mach-k3/am62px/am62p5_init.c
index 599ea7cf2dd8..5a27e18f2063 100644
--- a/arch/arm/mach-k3/am62px/am62p5_init.c
+++ b/arch/arm/mach-k3/am62px/am62p5_init.c
@@ -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.
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-16 9:05 [PATCH v2 0/5] K3: wait for TIFS init before CTRL_MMR unlock Markus Schneider-Pargmann
` (3 preceding siblings ...)
2026-10-16 9:05 ` [PATCH v2 4/5] arm: mach-k3: am62p5: " Markus Schneider-Pargmann
@ 2026-10-16 9:05 ` Markus Schneider-Pargmann
2026-10-17 2:40 ` Kumar, Udit
4 siblings, 1 reply; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-16 9:05 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Udit Kumar,
Richard Genoud, Anshul Dalal, Aristo Chen,
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.
Link: https://lore.kernel.org/u-boot/20250815160240.3575140-1-d.schultz@phytec.de/
Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c
index 1180c75f551d..c15b3b2682d9 100644
--- a/arch/arm/mach-k3/j722s/j722s_init.c
+++ b/arch/arm/mach-k3/j722s/j722s_init.c
@@ -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
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-16 9:05 ` [PATCH v2 5/5] arm: mach-k3: j722s: " Markus Schneider-Pargmann
@ 2026-10-17 2:40 ` Kumar, Udit
2026-10-19 12:16 ` Richard GENOUD
0 siblings, 1 reply; 15+ messages in thread
From: Kumar, Udit @ 2026-10-17 2:40 UTC (permalink / raw)
To: Markus Schneider-Pargmann, u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Richard Genoud,
Anshul Dalal, Aristo Chen, u-kumar1
On 10/16/2026 2:35 PM, Markus Schneider-Pargmann wrote:
> 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/20250815160240.3575140-1-d.schultz@phytec.de/
> Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> ---
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
Tested-by: Udit Kumar <u-kumar1@ti.com>
> arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c
> index 1180c75f551d..c15b3b2682d9 100644
> --- a/arch/arm/mach-k3/j722s/j722s_init.c
> +++ b/arch/arm/mach-k3/j722s/j722s_init.c
> @@ -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
>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-17 2:40 ` Kumar, Udit
@ 2026-10-19 12:16 ` Richard GENOUD
2026-10-19 13:34 ` Kumar, Udit
0 siblings, 1 reply; 15+ messages in thread
From: Richard GENOUD @ 2026-10-19 12:16 UTC (permalink / raw)
To: Kumar, Udit, Markus Schneider-Pargmann, u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen
Le 17/10/2026 à 04:40, Kumar, Udit a écrit :
>
>
> On 10/16/2026 2:35 PM, Markus Schneider-Pargmann wrote:
>> 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/20250815160240.3575140-1-d.schultz@phytec.de/
>> Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-kumar1@ti.com/
>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>> ---
>
> 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
>
> Tested-by: Udit Kumar <u-kumar1@ti.com>
>
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
>> arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c
>> index 1180c75f551d..c15b3b2682d9 100644
>> --- a/arch/arm/mach-k3/j722s/j722s_init.c
>> +++ b/arch/arm/mach-k3/j722s/j722s_init.c
>> @@ -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
>>
>
--
Richard Genoud, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/5] arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-19 12:16 ` Richard GENOUD
@ 2026-10-19 13:34 ` Kumar, Udit
2026-10-22 10:15 ` [PATCH 1/3] arm: mach-k3: common: add helper to wait " Markus Schneider-Pargmann
0 siblings, 1 reply; 15+ messages in thread
From: Kumar, Udit @ 2026-10-19 13:34 UTC (permalink / raw)
To: Richard GENOUD, Markus Schneider-Pargmann, u-boot
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-kumar1
On 10/19/2026 5:46 PM, Richard GENOUD wrote:
> Le 17/10/2026 à 04:40, Kumar, Udit a écrit :
>>
>>
>> On 10/16/2026 2:35 PM, Markus Schneider-Pargmann wrote:
>>> 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/20250815160240.3575140-1-
>>> d.schultz@phytec.de/
>>> Link: https://lore.kernel.org/u-boot/20260225051559.416445-1-u-
>>> kumar1@ti.com/
>>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>>> ---
>>
>> 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
>>
>> Tested-by: Udit Kumar <u-kumar1@ti.com>
>>
> 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.
> Regards,
> Richard
>
>>> arch/arm/mach-k3/j722s/j722s_init.c | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/
>>> j722s/j722s_init.c
>>> index 1180c75f551d..c15b3b2682d9 100644
>>> --- a/arch/arm/mach-k3/j722s/j722s_init.c
>>> +++ b/arch/arm/mach-k3/j722s/j722s_init.c
>>> @@ -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
>>>
>>
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH 1/3] arm: mach-k3: common: add helper to wait for TIFS initialization
2026-10-19 13:34 ` Kumar, Udit
@ 2026-10-22 10:15 ` Markus Schneider-Pargmann
2026-10-22 10:15 ` [PATCH 2/3] dm: core: Add SPL_DM_EVENT Markus Schneider-Pargmann
2026-10-22 10:15 ` [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization Markus Schneider-Pargmann
0 siblings, 2 replies; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-22 10:15 UTC (permalink / raw)
To: Kumar, Udit, Richard GENOUD, Markus Schneider-Pargmann
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-boot
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.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/common.c | 10 ++++++++++
arch/arm/mach-k3/common.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 6e382efdb3be..480c90cfa65f 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -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();
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 37ff98d89924..146b986febc6 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 2/3] dm: core: Add SPL_DM_EVENT
2026-10-22 10:15 ` [PATCH 1/3] arm: mach-k3: common: add helper to wait " Markus Schneider-Pargmann
@ 2026-10-22 10:15 ` Markus Schneider-Pargmann
2026-10-22 10:15 ` [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization Markus Schneider-Pargmann
1 sibling, 0 replies; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-22 10:15 UTC (permalink / raw)
To: Kumar, Udit, Richard GENOUD, Markus Schneider-Pargmann
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-boot
Add an option to allow DM_EVENT in SPL.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
drivers/core/Kconfig | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index ae0c34667723..22b72d6b766c 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -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
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-22 10:15 ` [PATCH 1/3] arm: mach-k3: common: add helper to wait " Markus Schneider-Pargmann
2026-10-22 10:15 ` [PATCH 2/3] dm: core: Add SPL_DM_EVENT Markus Schneider-Pargmann
@ 2026-10-22 10:15 ` Markus Schneider-Pargmann
2026-10-22 10:18 ` Markus Schneider-Pargmann
1 sibling, 1 reply; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-22 10:15 UTC (permalink / raw)
To: Kumar, Udit, Richard GENOUD, Markus Schneider-Pargmann
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-boot
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
arch/arm/mach-k3/Kconfig | 1 +
arch/arm/mach-k3/j722s/j722s_init.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index a32ed3a9683f..ec3e95c11a39 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -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"
diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c
index 1180c75f551d..685c4d98a8a5 100644
--- a/arch/arm/mach-k3/j722s/j722s_init.c
+++ b/arch/arm/mach-k3/j722s/j722s_init.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-22 10:15 ` [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization Markus Schneider-Pargmann
@ 2026-10-22 10:18 ` Markus Schneider-Pargmann
2026-10-23 7:45 ` Richard GENOUD
0 siblings, 1 reply; 15+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-22 10:18 UTC (permalink / raw)
To: Markus Schneider-Pargmann, Kumar, Udit, Richard GENOUD
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-boot
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
Hi,
On Thu Oct 22, 2026 at 12:15 PM CEST, Markus Schneider-Pargmann wrote:
...
> +/*
> + * 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] WIP: arm: mach-k3: j722s: Wait for TIFS initialization
2026-10-22 10:18 ` Markus Schneider-Pargmann
@ 2026-10-23 7:45 ` Richard GENOUD
0 siblings, 0 replies; 15+ messages in thread
From: Richard GENOUD @ 2026-10-23 7:45 UTC (permalink / raw)
To: Markus Schneider-Pargmann, Kumar, Udit
Cc: Tom Rini, Ilias Apalodimas, Daniel Schultz, Anshul Dalal,
Aristo Chen, u-boot
Hi Markus,
Le 22/10/2026 à 12:18, Markus Schneider-Pargmann a écrit :
> Hi,
>
> On Thu Oct 22, 2026 at 12:15 PM CEST, Markus Schneider-Pargmann wrote:
> ...
>> +/*
>> + * 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!
>
> Best
> Markus
Regards,
Richars
^ permalink raw reply [flat|nested] 15+ messages in thread