[U-Boot] [PATCH] sdhc_boot: Make mmc_get_env_addr dependant on CONFIG_FSL_ESDHC

Fabio Estevam fabio.estevam at freescale.com
Mon Nov 28 15:23:15 CET 2011


Since commit 97039ab98 (env_mmc: Allow board code to override the environment address)
mmc_get_env_addr is a weak-aliased function in common/env_mmc.c

board/freescale/common/sdhc_boot.c also defines mmc_get_env_addr, but this should be
dependant on CONFIG_FSL_ESDHC.

Add this protection in the mmc_get_env_addr definition in sdhc_boot.c.

This fixes the retrieval of CONFIG_ENV_OFFSET on i.MX28.

Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 board/freescale/common/sdhc_boot.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
index e432318..1d7ff1e 100644
--- a/board/freescale/common/sdhc_boot.c
+++ b/board/freescale/common/sdhc_boot.c
@@ -32,6 +32,7 @@
 #define ESDHC_BOOT_IMAGE_SIZE	0x48
 #define ESDHC_BOOT_IMAGE_ADDR	0x50
 
+#if defined(CONFIG_FSL_ESDHC)
 int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
 {
 	u8 *tmp_buf;
@@ -60,4 +61,5 @@ int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
 	free(tmp_buf);
 
 	return 0;
+#endif
 }
-- 
1.7.1




More information about the U-Boot mailing list