spl: spl_fit: add weak prototype for fpga_load
PATCH 1/1 spl: spl_fit: add weak prototype for fpga_load
In case OPTIMIZE_DEBUG is set, unused code will not be optimized out, hence the reference to fpga_load will be compiled.
if DM_FPGA and SPL_FPGA are not set, the build will fail with :
aarch64-none-linux-gnu-ld.bfd: common/spl/spl_fit.o: in function `spl_fit_upload_fpga':u-boot/common/spl/spl_fit.c:595: undefined reference to `fpga_load'
By adding a weak prototype, build is successful.
--- common/spl/spl_fit.c | 6 ++++++ 1 file changed, 6 insertions(+)
common/spl/spl_fit.c +6 -0
@@ -570,6 +570,12 @@ static void warn_deprecated(const char *msg)printf ("\tSee doc/uImage.FIT/source_file_format.txt\n" ); } +__weak int fpga_load (int devnum,const void *buf,size_t bsize, +bitstream_type bstype,int flags) +{ +return 0 ; +} +static int spl_fit_upload_fpga (struct spl_fit_info *ctx,int node,struct spl_image_info *fpga_image) {
Signature · 1 line
2.34.1
Quoted 21 lines · Eugen Hristev
In case
OPTIMIZE_DEBUGis set, unused code will not be optimized out, hence the reference tofpga_loadwill be compiled.
ifDM_FPGAandSPL_FPGAare not set, the build will fail with :aarch64-none-linux-gnu-ld.bfd:
common/spl/spl_fit.o: in function `spl_fit_upload_fpga':u-boot/common/spl/spl_fit.c:595: undefined reference to `fpga_load'By adding a weak prototype, build is successful.
Signed-off-by Eugen Hristev <[email protected]>--- common/spl/spl_fit.c | 6 ++++++ 1 file changed, 6 insertions(+)common/spl/spl_fit.c +0
-0@@ -570,6 +570,12 @@ static void warn_deprecated(const char *msg)printf ("\tSee doc/uImage.FIT/source_file_format.txt\n" ); }
common/spl/spl_fit.c static void warn_deprecated(const char *msg) · line 581
Quoted 10 lines
common/spl/spl_fit.c +6
-0+__weak int fpga_load (int devnum,const void *buf,size_t bsize, +bitstream_type bstype,int flags) +{ +return 0 ; +} +static int spl_fit_upload_fpga (struct spl_fit_info *ctx,int node,struct spl_image_info *fpga_image) {
Gentle ping