aboutsummaryrefslogtreecommitdiff
path: root/include/fpga.h
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2023-08-31 16:52:47 +0900
committerMichal Simek <michal.simek@amd.com>2023-09-21 13:20:11 +0200
commit55e281049c49ac779b1c533abde5c3c2ffa0cc8e (patch)
treea099d2cff2e01975dd028901c2ab4a1c2cd6d3f8 /include/fpga.h
parent12d2da980ec4c775c115f1e141167525364e854b (diff)
downloadu-boot-55e281049c49ac779b1c533abde5c3c2ffa0cc8e.zip
u-boot-55e281049c49ac779b1c533abde5c3c2ffa0cc8e.tar.gz
u-boot-55e281049c49ac779b1c533abde5c3c2ffa0cc8e.tar.bz2
fpga: define dummy fpga_load function for debug build
This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and CONFIG_FPGA or CONFIG_SPL_FPGA are not enabled. When CC_OPTIMIZE_FOR_DEBUG is enabled, unused code will not be optimized out. Hence, fpga_load function must have a dummy implementation to avoid the build error. ../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@samsung.com> Link: https://lore.kernel.org/r/20230831075247.137501-1-chanho61.park@samsung.com Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include/fpga.h')
-rw-r--r--include/fpga.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/fpga.h b/include/fpga.h
index ed688cc..44f2755 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,