Skip to contentSkip to conversation

sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option

PATCH New Fabio Estevam 3 participants 4 messages Jan 11, 2012 – Jan 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
Changes since v1:
- Remove unneeded ifdef from board/freescale/common/sdhc_boot.c

 board/freescale/common/Makefile |    2 +-
 include/configs/MPC8536DS.h     |    1 +
 include/configs/P1010RDB.h      |    1 +
 include/configs/P1_P2_RDB.h     |    1 +
 include/configs/P2020COME.h     |    1 +
 include/configs/P2020DS.h       |    1 +
 include/configs/P2041RDB.h      |    1 +
 include/configs/corenet_ds.h    |    1 +
 include/configs/p1_p2_rdb_pc.h  |    1 +
 9 files changed, 9 insertions(+), 1 deletions(-)
board/freescale/common/Makefile +1 -1
index 9077aaf..0b40dc7 100644
@@ -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
include/configs/MPC8536DS.h +1 -0
index 16db98f..c26cb63 100644
@@ -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
include/configs/P1010RDB.h +1 -0
index a9251b4..297cc0a 100644
@@ -604,6 +604,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)
include/configs/P1_P2_RDB.h +1 -0
index 00fa74d..916b519 100644
@@ -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)
include/configs/P2020COME.h +1 -0
index cf20d2b..365322c 100644
@@ -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)
include/configs/P2020DS.h +1 -0
index 2d9657a..f0eb029 100644
@@ -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)
include/configs/P2041RDB.h +1 -0
index a48055e..da98f8f 100644
@@ -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)
include/configs/corenet_ds.h +1 -0
index 7925b95..77dd0a2 100644
@@ -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)
include/configs/p1_p2_rdb_pc.h +1 -0
index 9297dd0..57170da 100644
@@ -726,6 +726,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)
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option

Quoted 17 lines · Fabio Estevam

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.

---
Changes since v1:
- Remove unneeded ifdef from board/freescale/common/sdhc_boot.c

Quoted 10 lines
board/freescale/common/Makefile |    2 +-
include/configs/MPC8536DS.h     |    1 +
include/configs/P1010RDB.h      |    1 +
include/configs/P1_P2_RDB.h     |    1 +
include/configs/P2020COME.h     |    1 +
include/configs/P2020DS.h       |    1 +
include/configs/P2041RDB.h      |    1 +
include/configs/corenet_ds.h    |    1 +
include/configs/p1_p2_rdb_pc.h  |    1 +
9 files changed, 9 insertions(+), 1 deletions(-)

- k

#2 lore raw

PATCH v2 1/1 sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option

In reply to Fabio Estevam
Quoted 17 lines · Fabio Estevam

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.

---
Changes since v1:
- Remove unneeded ifdef from board/freescale/common/sdhc_boot.c

Quoted 10 lines
 board/freescale/common/Makefile |    2 +-
 include/configs/MPC8536DS.h     |    1 +
 include/configs/P1010RDB.h      |    1 +
 include/configs/P1_P2_RDB.h     |    1 +
 include/configs/P2020COME.h     |    1 +
 include/configs/P2020DS.h       |    1 +
 include/configs/P2041RDB.h      |    1 +
 include/configs/corenet_ds.h    |    1 +
 include/configs/p1_p2_rdb_pc.h  |    1 +
 9 files changed, 9 insertions(+), 1 deletions(-)

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH v2 1/1 sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option

In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

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.

Quoted 7 lines

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.

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================