[PATCH] spl: Add function called after fpga image upload

Michal Simek michal.simek at amd.com
Mon Jul 10 13:41:27 CEST 2023



On 6/27/23 11:04, christian.taedcke-oss at weidmueller.com wrote:
> From: Christian Taedcke <christian.taedcke at weidmueller.com>
> 
> This way custom logic can be implemented per board after the fpga
> image is uploaded.

What do you want to do there?

I expect Simon won't like that it is another weak function.

> 
> Signed-off-by: Christian Taedcke <christian.taedcke at weidmueller.com>
> ---
> 
>   common/spl/spl_fit.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index 730639f756..3a1e3382ba 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -560,6 +560,16 @@ __weak void *spl_load_simple_fit_fix_load(const void *fit)
>   	return (void *)fit;
>   }
>   
> +/*
> + * Weak default function to allow implementing logic after fpga image is
> + * uploaded.
> + */
> +__weak void board_spl_fit_post_upload_fpga(const void *fit, int node,
> +					   struct spl_image_info *fpga_image,
> +					   int ret)

Would be good to have kernel-doc and curious about ret parameter.
Also function like this could fail and you should propagate error.

M


More information about the U-Boot mailing list