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>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
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,
#else
env_relocate();
#endif
+#endif
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
i2c_init_all();