[PATCH v3 3/6] drivers: firmware: ti_sci: Get SCI revision only if TIFS/SYSFW is up

Nishanth Menon nm at ti.com
Mon Sep 25 16:06:25 CEST 2023


On 16:09-20230922, Neha Malcom Francis wrote:
> When setting up boot media to load the TIFS binary in legacy boot flow
> (followed by J721E), get_timer() is called which calls dm_timer_init()
> which then gets the tick-timer: mcu_timer0. mcu_timer0 uses k3_clks
> (clock controller) and k3_pds (power controller) from the dmsc node that
> forces probe of the ti_sci driver of TIFS that hasn't been loaded yet!
> Running ti_sci_cmd_get_revision from the probe leads to panic since no
> TIFS and board config binaries have been loaded yet. Resolve this by
> moving ti_sci_cmd_get_revision to ti_sci_get_handle_from_sysfw as a
> common point of invocation for both legacy and combined boot flows.
> 
> Before doing this, it is important to go through whether any sync points
> exist where revision is needed before ti_sci_get_handle_from_sysfw is
> invoked. Going through the code along with boot tests on both flows
> ensures that there are none.

Please provide bootlogs for one board of the following SoCs in the
diffstat for us to be sure.

* AM65 (sysfw gen1), J721e(tifs gen1), AM64(sysfw gen2-Sitara), J7200(tifs
  gen2-Jacinto), J721s2(tifs-dm/Jacinto), AM62x(tifs-dm/Sitara)

> 
> Signed-off-by: Neha Malcom Francis <n-francis at ti.com>
> ---
>  drivers/firmware/ti_sci.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index 72f572d824..45406e24d2 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -2690,6 +2690,8 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
>  const
>  struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *sci_dev)
>  {
> +	int ret;
> +
>  	if (!sci_dev)
>  		return ERR_PTR(-EINVAL);
>  
> @@ -2703,6 +2705,11 @@ struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *sci_dev)
>  	if (!handle)
>  		return ERR_PTR(-EINVAL);
>  
> +	ret = ti_sci_cmd_get_revision(handle);
> +
> +	if (ret)
> +		return ret;
> +
>  	return handle;
>  }
>  
> @@ -2825,11 +2832,9 @@ static int ti_sci_probe(struct udevice *dev)
>  	list_add_tail(&info->list, &ti_sci_list);
>  	ti_sci_setup_ops(info);
>  
> -	ret = ti_sci_cmd_get_revision(&info->handle);
> -
>  	INIT_LIST_HEAD(&info->dev_list);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  /**
> -- 
> 2.34.1
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D


More information about the U-Boot mailing list