aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-12-21 14:01:01 +0100
committerEric Miao <eric.miao@linaro.org>2012-01-06 23:02:03 +0800
commit02f39f5c863389db921b93739b5ba001334f1348 (patch)
treef6c480c7a71aff288c2010dd1b6ddea31e7c0ec2
parent805565422fc1ccf0d5ca289db7d65f49617d5a2d (diff)
sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
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 The mmc_get_env_addr implementation that exists at board/freescale/common/sdhc_boot.c is meant to be used only for PowerPC boards, but currently it is being used for all platforms that have CONFIG_ENV_IS_IN_MMC defined. Introduce CONFIG_FSL_FIXED_MMC_LOCATION so that the boards that need to use the mmc_get_env_addr version from board/freescale/common/sdhc_boot.c could activate this config option on their board file. This fixes the retrieval of CONFIG_ENV_OFFSET on non-PowerPC boards. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
-rw-r--r--board/freescale/common/Makefile2
-rw-r--r--board/freescale/common/sdhc_boot.c2
-rw-r--r--include/configs/MPC8536DS.h1
-rw-r--r--include/configs/P1010RDB.h1
-rw-r--r--include/configs/P1_P2_RDB.h1
-rw-r--r--include/configs/P2020COME.h1
-rw-r--r--include/configs/P2020DS.h1
-rw-r--r--include/configs/P2041RDB.h1
-rw-r--r--include/configs/corenet_ds.h1
-rw-r--r--include/configs/p1_p2_rdb_pc.h1
10 files changed, 11 insertions, 1 deletions
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 9077aaf10..0b40dc7bf 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -39,7 +39,7 @@ COBJS-$(CONFIG_PQ_MDS_PIB) += pq-mds-pib.o
COBJS-$(CONFIG_ID_EEPROM) += sys_eeprom.o
COBJS-$(CONFIG_FSL_SGMII_RISER) += sgmii_riser.o
ifndef CONFIG_RAMBOOT_PBL
-COBJS-$(CONFIG_ENV_IS_IN_MMC) += sdhc_boot.o
+COBJS-$(CONFIG_FSL_FIXED_MMC_LOCATION) += sdhc_boot.o
endif
COBJS-$(CONFIG_MPC8541CDS) += cds_pci_ft.o
diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
index e4323181f..934be6fe4 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
+#ifdef CONFIG_FSL_FIXED_MMC_LOCATION
int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
{
u8 *tmp_buf;
@@ -61,3 +62,4 @@ int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr)
return 0;
}
+#endif
diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index 16db98fe5..c26cb639b 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -659,6 +659,7 @@
#define CONFIG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_SYS_MMC_ENV_DEV 0
#else
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index af4609f84..5edd1aad3 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -609,6 +609,7 @@ extern unsigned long get_sdram_size(void);
#if defined(CONFIG_SYS_RAMBOOT)
#if defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_SIZE 0x2000
#elif defined(CONFIG_RAMBOOT_SPIFLASH)
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
index 00fa74d6f..916b51941 100644
--- a/include/configs/P1_P2_RDB.h
+++ b/include/configs/P1_P2_RDB.h
@@ -519,6 +519,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
#define CONFIG_ENV_OFFSET ((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE)
#elif defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_SYS_MMC_ENV_DEV 0
#elif defined(CONFIG_RAMBOOT_SPIFLASH)
diff --git a/include/configs/P2020COME.h b/include/configs/P2020COME.h
index cf20d2b2e..365322c6a 100644
--- a/include/configs/P2020COME.h
+++ b/include/configs/P2020COME.h
@@ -350,6 +350,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
*/
#if defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC 1
+ #define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_SYS_MMC_ENV_DEV 0
#elif defined(CONFIG_RAMBOOT_SPIFLASH)
diff --git a/include/configs/P2020DS.h b/include/configs/P2020DS.h
index 2d9657a15..f0eb0294a 100644
--- a/include/configs/P2020DS.h
+++ b/include/configs/P2020DS.h
@@ -596,6 +596,7 @@
*/
#if defined(CONFIG_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_SYS_MMC_ENV_DEV 0
#elif defined(CONFIG_SPIFLASH)
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index a48055e2c..da98f8f02 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -92,6 +92,7 @@
#elif defined(CONFIG_SDCARD)
#define CONFIG_SYS_EXTRA_ENV_RELOC
#define CONFIG_ENV_IS_IN_MMC
+ #define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_OFFSET (512 * 1097)
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index 7925b9583..77dd0a2d1 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -88,6 +88,7 @@
#elif defined(CONFIG_SDCARD)
#define CONFIG_SYS_EXTRA_ENV_RELOC
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_OFFSET (512 * 1097)
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 8e8fa163b..778a4f9a7 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -733,6 +733,7 @@
#define CONFIG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_SYS_MMC_ENV_DEV 0
#elif defined(CONFIG_NAND_U_BOOT)