[PATCH v2 3/7] arm: mach-k3: j721e_init: Move clk_k3 probe before loading TIFS

Neha Malcom Francis n-francis at ti.com
Fri Sep 8 05:14:12 CEST 2023


Hi Nishanth

On 07/09/23 20:33, Nishanth Menon wrote:
> On 19:44-20230907, Neha Malcom Francis wrote:
>> Since we need to configure required clocks before TIFS is loaded, move
>> clk_k3 driver probe before k3_sysfw_loader.
> 
> This needs further elaboration. what kind of clocks are we talking
> about? what is the call sequence that is involved that this is solving?
> 

When setting up our boot media to take in the TIFS binary (sysfw.itb) in legacy 
boot flow  (followed by J721E) what we end up doing is a get_timer() which by 
call stack will eventually call dm_timer_init() and then get our "tick-timer" in 
our case mcu_timer0. Now mcu_timer0 uses k3_clks (clock-controller) and k3_pds 
(power controller) from the dmsc node that forces probe of the ti_sci driver 
(for TIFS that hasn't been loaded yet!).

So we have two issues that need to be solved here, one of not having set the 
required devices and clocks before we even stat to probe their dependent 
devices, and two of handling how ti_sci reacts when TIFS is not even up yet. 
This patch solves the former.

Would this be excessive detailing for a commit message?

>>
>> Signed-off-by: Neha Malcom Francis <n-francis at ti.com>
>> ---
>>   arch/arm/mach-k3/j721e_init.c | 24 ++++++++++++------------
>>   1 file changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
>> index b6164575b7..b1f7e25ed0 100644
>> --- a/arch/arm/mach-k3/j721e_init.c
>> +++ b/arch/arm/mach-k3/j721e_init.c
>> @@ -228,6 +228,18 @@ void board_init_f(ulong dummy)
>>   	if (!ret)
>>   		pinctrl_select_state(dev, "default");
>>   
>> +	/*
>> +	 * Force probe of clk_k3 driver here to ensure basic default clock
>> +	 * configuration is always done.
>> +	 */
>> +	if (IS_ENABLED(CONFIG_SPL_CLK_K3)) {
>> +		ret = uclass_get_device_by_driver(UCLASS_CLK,
>> +						  DM_DRIVER_GET(ti_clk),
>> +						  &dev);
>> +		if (ret)
>> +			panic("Failed to initialize clk-k3!\n");
>> +	}
>> +
>>   	/*
>>   	 * Load, start up, and configure system controller firmware. Provide
>>   	 * the U-Boot console init function to the SYSFW post-PM configuration
>> @@ -241,18 +253,6 @@ void board_init_f(ulong dummy)
>>   	do_dt_magic();
>>   #endif
>>   
>> -	/*
>> -	 * Force probe of clk_k3 driver here to ensure basic default clock
>> -	 * configuration is always done.
>> -	 */
>> -	if (IS_ENABLED(CONFIG_SPL_CLK_K3)) {
>> -		ret = uclass_get_device_by_driver(UCLASS_CLK,
>> -						  DM_DRIVER_GET(ti_clk),
>> -						  &dev);
>> -		if (ret)
>> -			panic("Failed to initialize clk-k3!\n");
>> -	}
>> -
>>   	/* Prepare console output */
>>   	preloader_console_init();
>>   
>> -- 
>> 2.34.1
>>
> 

-- 
Thanking You
Neha Malcom Francis


More information about the U-Boot mailing list