[U-Boot] [PATCH 3/5] remoteproc: stm32: load resource table from firmware

Suman Anna s-anna at ti.com
Fri Oct 11 20:09:00 UTC 2019


Hi Fabien,

On 10/9/19 10:36 AM, Fabien Dessenne wrote:
> Load the optional resource table from the firmware, and write its
> address in the dedicated backup register.

What processor is this? Reason I ask is that you are using 0 as a no
resource table address, and if it is a valid address for that processor?

regards
Suman

> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne at st.com>
> ---
>  drivers/remoteproc/stm32_copro.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c
> index 40bba37..eef3416 100644
> --- a/drivers/remoteproc/stm32_copro.c
> +++ b/drivers/remoteproc/stm32_copro.c
> @@ -23,6 +23,7 @@
>   * @hold_boot_offset:	offset of the register controlling the hold boot setting
>   * @hold_boot_mask:	bitmask of the register for the hold boot field
>   * @is_running:		is the remote processor running
> + * @rsc_table_addr:	resource table address
>   */
>  struct stm32_copro_privdata {
>  	struct reset_ctl reset_ctl;
> @@ -30,6 +31,7 @@ struct stm32_copro_privdata {
>  	uint hold_boot_offset;
>  	uint hold_boot_mask;
>  	bool is_running;
> +	ulong rsc_table_addr;
>  };
>  
>  /**
> @@ -141,6 +143,7 @@ static void *stm32_copro_device_to_virt(struct udevice *dev, ulong da,
>  static int stm32_copro_load(struct udevice *dev, ulong addr, ulong size)
>  {
>  	struct stm32_copro_privdata *priv;
> +	ulong rsc_table_size;
>  	int ret;
>  
>  	priv = dev_get_priv(dev);
> @@ -155,6 +158,12 @@ static int stm32_copro_load(struct udevice *dev, ulong addr, ulong size)
>  		return ret;
>  	}
>  
> +	if (rproc_elf32_load_rsc_table(dev, addr, size, &priv->rsc_table_addr,
> +				       &rsc_table_size)) {
> +		priv->rsc_table_addr = 0;
> +		dev_warn(dev, "No valid resource table for this firmware\n");
> +	}
> +
>  	return rproc_elf32_load_image(dev, addr, size);
>  }
>  
> @@ -180,6 +189,10 @@ static int stm32_copro_start(struct udevice *dev)
>  	 * rebooting autonomously
>  	 */
>  	ret = stm32_copro_set_hold_boot(dev, true);
> +	if (!ret)
> +		/* Store rsc_address in bkp register */
> +		writel(priv->rsc_table_addr, TAMP_COPRO_RSC_TBL_ADDRESS);
> +
>  	priv->is_running = !ret;
>  	return ret;
>  }
> 



More information about the U-Boot mailing list