powerpc: p2020: Allow to compile it without env support
cover powerpc: p2020: Allow to compile it without env support
This patch series allows to compile SPL for P2020 without env support when proper U-Boot has env support enabled.
Pali Rohár (3):
hwconfig: Allow to compile it without env support
ddr: fsl: Allow to compile it without env support
board: freescale: p1_p2_rdb_pc: Allow to compile it without env
support
board/freescale/p1_p2_rdb_pc/spl.c | 4 ++++ common/hwconfig.c | 2 ++ drivers/ddr/fsl/options.c | 4 ++++ 3 files changed, 10 insertions(+)
Signature · 1 line
2.20.1
PATCH 2/3 ddr: fsl: Allow to compile it without env support
When env support is disabled then usage of env_get_f() generates linker errors. So do not compile env_get_f() when env support is disabled (for example when disabled only in SPL).
--- drivers/ddr/fsl/options.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/ddr/fsl/options.c +4 -0
@@ -761,7 +761,9 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,* Extract hwconfig from environment since we have not properly setup * the environment but need it for ddr config params */ +#if CONFIG_IS_ENABLED (ENV_SUPPORT )if (env_get_f ("hwconfig" , buf,sizeof (buf)) <0 ) +#endif buf[0 ] ='\0' ; #if defined(CONFIG_SYS_FSL_DDR3) || \
@@ -1408,7 +1410,9 @@ int fsl_use_spd(void)* Extract hwconfig from environment since we have not properly setup * the environment but need it for ddr config params */ +#if CONFIG_IS_ENABLED (ENV_SUPPORT ) if (env_get_f("hwconfig", buf, sizeof(buf)) < 0) +#endif buf[0 ] ='\0' ;/* if hwconfig is not enabled, or "sdram" is not defined, use spd */
Signature · 1 line
2.20.1
PATCH 1/3 hwconfig: Allow to compile it without env support
In reply to Pali RohárWhen env support is disabled then usage of env_get() generates linker errors. So do not compile env_get() when env support is disabled (for example when disabled only in SPL).
--- common/hwconfig.c | 2 ++ 1 file changed, 2 insertions(+)
common/hwconfig.c +2 -0
@@ -83,7 +83,9 @@ static const char *__hwconfig(const char *opt, size_t *arglen, "and before environment is ready\n");return NULL ; } +#if CONFIG_IS_ENABLED (ENV_SUPPORT ) env_hwconfig =env_get ("hwconfig" ); +#endif }if (env_hwconfig) {
Signature · 1 line
2.20.1
PATCH 3/3 board: freescale: p1_p2_rdb_pc: Allow to compile it without env support
In reply to Pali RohárWhen 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.
--- board/freescale/p1_p2_rdb_pc/spl.c | 4 ++++ 1 file changed, 4 insertions(+)
board/freescale/p1_p2_rdb_pc/spl.c +4 -0
@@ -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 ();
Signature · 1 line
2.20.1