From: Eugen Hristev <eugen.hristev@collabora.com>
To: u-boot@lists.denx.de, sjg@chromium.org
Cc: Eugen Hristev <eugen.hristev@collabora.com>
Subject: [PATCH] spl: spl_fit: add weak prototype for fpga_load
Date: Mon, 27 Feb 2023 12:27:07 +0200 [thread overview]
Message-ID: <20230227102707.39409-1-eugen.hristev@collabora.com> (raw)
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.
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
---
common/spl/spl_fit.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index c51482b3b659..ca2e337b1ec4 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -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)
{
--
2.34.1
next reply other threads:[~2023-02-27 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 10:27 Eugen Hristev [this message]
2023-06-09 8:06 ` [PATCH] spl: spl_fit: add weak prototype for fpga_load Eugen Hristev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230227102707.39409-1-eugen.hristev@collabora.com \
--to=eugen.hristev@collabora.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox