From: "Pali Rohár" <pali@kernel.org>
To: Priyanka Jain <priyanka.jain@nxp.com>, Wolfgang Denk <wd@denx.de>
Cc: u-boot@lists.denx.de
Subject: [PATCH 3/3] board: freescale: p1_p2_rdb_pc: Allow to compile it without env support
Date: Sun, 3 Apr 2022 00:24:27 +0200 [thread overview]
Message-ID: <20220402222427.19212-4-pali@kernel.org> (raw)
In-Reply-To: <20220402222427.19212-1-pali@kernel.org>
When env support is disabled then usage of env_init() or env_relocate()
generates linker errors. So do not compile env_init() or env_relocate()
in SPL code when env support is disabled in SPL.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
board/freescale/p1_p2_rdb_pc/spl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c
index f855f3a81c3d..22156f2824ec 100644
--- a/board/freescale/p1_p2_rdb_pc/spl.c
+++ b/board/freescale/p1_p2_rdb_pc/spl.c
@@ -83,12 +83,15 @@ void board_init_r(gd_t *gd, ulong dest_addr)
CONFIG_SPL_RELOC_MALLOC_SIZE);
gd->flags |= GD_FLG_FULL_MALLOC_INIT;
+#ifdef CONFIG_SPL_ENV_SUPPORT
#ifndef CONFIG_SPL_NAND_BOOT
env_init();
#endif
+#endif
#ifdef CONFIG_SPL_MMC_BOOT
mmc_initialize(bd);
#endif
+#ifdef CONFIG_SPL_ENV_SUPPORT
/* relocate environment function pointers etc. */
#ifdef CONFIG_SPL_NAND_BOOT
nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
@@ -98,6 +101,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
#else
env_relocate();
#endif
+#endif
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
i2c_init_all();
--
2.20.1
prev parent reply other threads:[~2022-04-02 22:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 22:24 [PATCH 0/3] powerpc: p2020: Allow to compile it without env support Pali Rohár
2022-04-02 22:24 ` [PATCH 1/3] hwconfig: " Pali Rohár
2022-04-02 22:24 ` [PATCH 2/3] ddr: fsl: " Pali Rohár
2022-04-02 22:24 ` Pali Rohár [this message]
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=20220402222427.19212-4-pali@kernel.org \
--to=pali@kernel.org \
--cc=priyanka.jain@nxp.com \
--cc=u-boot@lists.denx.de \
--cc=wd@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