[PATCH] fpga: define dummy fpga_load function for debug build
Michal Simek
michal.simek at amd.com
Tue Aug 29 13:10:05 CEST 2023
On 8/16/23 08:54, Chanho Park wrote:
> This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and
> CONFIG_SPL_FPGA is not enabled.
I would rewrite this because the connection to SPL_FPGA is just one part of it.
It is also taken when CONFIG_FPGA is not enabled.
>
> ../common/spl/spl_fit.c:591: undefined reference to `fpga_load'
> collect2: error: ld returned 1 exit status
>
> Signed-off-by: Chanho Park <chanho61.park at samsung.com>
> ---
> include/fpga.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/fpga.h b/include/fpga.h
> index ed688cc0fa3b..44f2755a3f10 100644
> --- a/include/fpga.h
> +++ b/include/fpga.h
> @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc);
> int fpga_count(void);
> const fpga_desc *const fpga_get_desc(int devnum);
> int fpga_is_partial_data(int devnum, size_t img_len);
> +#if CONFIG_IS_ENABLED(FPGA)
> int fpga_load(int devnum, const void *buf, size_t bsize,
> bitstream_type bstype, int flags);
> +#else
> +static inline int fpga_load(int devnum, const void *buf, size_t bsize,
> + bitstream_type bstype, int flags)
> +{
> + return FPGA_FAIL;
> +}
> +#endif
> int fpga_fsload(int devnum, const void *buf, size_t size,
> fpga_fs_info *fpga_fsinfo);
> int fpga_loads(int devnum, const void *buf, size_t size,
Thanks,
Michal
More information about the U-Boot
mailing list