public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
@ 2011-12-20 16:33 Fabio Estevam
  2011-12-29  9:47 ` Stefano Babic
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Fabio Estevam @ 2011-12-20 16:33 UTC (permalink / raw)
  To: u-boot

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>
---
 board/freescale/common/Makefile    |    2 +-
 board/freescale/common/sdhc_boot.c |    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 +
 10 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 9077aaf..5f8f7c6 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 e432318..68c335b 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 16db98f..4b5373c 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 af4609f..0a22a5c 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 00fa74d..29f016b 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 cf20d2b..f3d1db0 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 2d9657a..2d9b916 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 a48055e..3c04e89 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 7925b95..613ca49 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 8e8fa16..1b10475 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)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-20 16:33 [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option Fabio Estevam
@ 2011-12-29  9:47 ` Stefano Babic
  2011-12-29 11:54   ` Fabio Estevam
  2011-12-29 11:57 ` Liu Hui-R64343
  2012-01-11 18:44 ` Kumar Gala
  2 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2011-12-29  9:47 UTC (permalink / raw)
  To: u-boot

On 20/12/2011 17:33, Fabio Estevam wrote:
> 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>
> ---

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-29  9:47 ` Stefano Babic
@ 2011-12-29 11:54   ` Fabio Estevam
  2012-01-10 17:28     ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2011-12-29 11:54 UTC (permalink / raw)
  To: u-boot

Kumar/Andy,

On Thu, Dec 29, 2011 at 7:47 AM, Stefano Babic <sbabic@denx.de> wrote:
> On 20/12/2011 17:33, Fabio Estevam wrote:
>> 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>
>
> Acked-by: Stefano Babic <sbabic@denx.de>

Are you guys OK with this?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-20 16:33 [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option Fabio Estevam
  2011-12-29  9:47 ` Stefano Babic
@ 2011-12-29 11:57 ` Liu Hui-R64343
  2011-12-29 12:38   ` Marek Vasut
  2012-01-11 18:44 ` Kumar Gala
  2 siblings, 1 reply; 9+ messages in thread
From: Liu Hui-R64343 @ 2011-12-29 11:57 UTC (permalink / raw)
  To: u-boot


>-----Original Message-----
>From: Fabio Estevam [mailto:festevam at gmail.com]
>Sent: Wednesday, December 21, 2011 12:33 AM
>To: u-boot at lists.denx.de
>Cc: sbabic at denx.de; marek.vasut at gmail.com; Fleming Andy-AFLEMING; Gala
>Kumar-B11780; Guo Shawn-R65073; Liu Hui-R64343; Huang Changming-R66093;
>Estevam Fabio-R49496
>Subject: [PATCH] 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>
>---
> board/freescale/common/Makefile    |    2 +-
> board/freescale/common/sdhc_boot.c |    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 +
> 10 files changed, 11 insertions(+), 1 deletions(-)
>

Acked-by: Jason Liu <r64343@freescale.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-29 11:57 ` Liu Hui-R64343
@ 2011-12-29 12:38   ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2011-12-29 12:38 UTC (permalink / raw)
  To: u-boot

> >-----Original Message-----
> >From: Fabio Estevam [mailto:festevam at gmail.com]
> >Sent: Wednesday, December 21, 2011 12:33 AM
> >To: u-boot at lists.denx.de
> >Cc: sbabic at denx.de; marek.vasut at gmail.com; Fleming Andy-AFLEMING; Gala
> >Kumar-B11780; Guo Shawn-R65073; Liu Hui-R64343; Huang Changming-R66093;
> >Estevam Fabio-R49496
> >Subject: [PATCH] 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>
> >---
> >
> > board/freescale/common/Makefile    |    2 +-
> > board/freescale/common/sdhc_boot.c |    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 +
> > 10 files changed, 11 insertions(+), 1 deletions(-)
> 
> Acked-by: Jason Liu <r64343@freescale.com>

Did you get a third identity (Liu Hui)?

M

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-29 11:54   ` Fabio Estevam
@ 2012-01-10 17:28     ` Fabio Estevam
  2012-01-11  9:53       ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-01-10 17:28 UTC (permalink / raw)
  To: u-boot

Andy,

Any comment about this patch?

Without this patch we get corrupted SD cards after trying to store env
vars on several i.MX boards.

Regards,

Fabio Estevam

On Thu, Dec 29, 2011 at 9:54 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Kumar/Andy,
>
> On Thu, Dec 29, 2011 at 7:47 AM, Stefano Babic <sbabic@denx.de> wrote:
>> On 20/12/2011 17:33, Fabio Estevam wrote:
>>> 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>
>>
>> Acked-by: Stefano Babic <sbabic@denx.de>
>
> Are you guys OK with this?
>
> Regards,
>
> Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2012-01-10 17:28     ` Fabio Estevam
@ 2012-01-11  9:53       ` Dirk Behme
  2012-01-11 10:42         ` Stefano Babic
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2012-01-11  9:53 UTC (permalink / raw)
  To: u-boot

On 10.01.2012 18:28, Fabio Estevam wrote:
> Andy,
> 
> Any comment about this patch?
> 
> Without this patch we get corrupted SD cards after trying to store env
> vars on several i.MX boards.

As this seems to hurt more and more i.MX guys, could we somehow get this 
applied asap (if there are no comments any more)?

Many thanks

Dirk

> On Thu, Dec 29, 2011 at 9:54 AM, Fabio Estevam <festevam@gmail.com> wrote:
>> Kumar/Andy,
>>
>> On Thu, Dec 29, 2011 at 7:47 AM, Stefano Babic <sbabic@denx.de> wrote:
>>> On 20/12/2011 17:33, Fabio Estevam wrote:
>>>> 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>
>>> Acked-by: Stefano Babic <sbabic@denx.de>
>> Are you guys OK with this?
>>
>> Regards,
>>
>> Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2012-01-11  9:53       ` Dirk Behme
@ 2012-01-11 10:42         ` Stefano Babic
  0 siblings, 0 replies; 9+ messages in thread
From: Stefano Babic @ 2012-01-11 10:42 UTC (permalink / raw)
  To: u-boot

On 11/01/2012 10:53, Dirk Behme wrote:

> As this seems to hurt more and more i.MX guys, could we somehow get this
> applied asap (if there are no comments any more)?

The issue hurts i.MX, but the patch modifies some PowerPC boards. I
would like to get the ACK from PowerPC guys before merging into u-boot-imx.

Best regards,
Stefano Babic

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option
  2011-12-20 16:33 [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option Fabio Estevam
  2011-12-29  9:47 ` Stefano Babic
  2011-12-29 11:57 ` Liu Hui-R64343
@ 2012-01-11 18:44 ` Kumar Gala
  2 siblings, 0 replies; 9+ messages in thread
From: Kumar Gala @ 2012-01-11 18:44 UTC (permalink / raw)
  To: u-boot


On Dec 20, 2011, at 10:33 AM, Fabio Estevam wrote:

> 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>
> ---
> board/freescale/common/Makefile    |    2 +-
> board/freescale/common/sdhc_boot.c |    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 +
> 10 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
> index 9077aaf..5f8f7c6 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 e432318..68c335b 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

Why is this ifdef needed since we already have it dealt with in the Makefile?

> 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 16db98f..4b5373c 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 af4609f..0a22a5c 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 00fa74d..29f016b 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 cf20d2b..f3d1db0 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 2d9657a..2d9b916 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 a48055e..3c04e89 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 7925b95..613ca49 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 8e8fa16..1b10475 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)
> -- 
> 1.7.1
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-11 18:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 16:33 [U-Boot] [PATCH] sdhc_boot: Introduce CONFIG_FSL_FIXED_MMC_LOCATION option Fabio Estevam
2011-12-29  9:47 ` Stefano Babic
2011-12-29 11:54   ` Fabio Estevam
2012-01-10 17:28     ` Fabio Estevam
2012-01-11  9:53       ` Dirk Behme
2012-01-11 10:42         ` Stefano Babic
2011-12-29 11:57 ` Liu Hui-R64343
2011-12-29 12:38   ` Marek Vasut
2012-01-11 18:44 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox