Save environment data to mmc.
PATCH 1/1 Save environment data to mmc.
This patch is to save environment data to mmc card. It uses interfaces defined in generic mmc.
--- common/cmd_nvedit.c | 3 +- common/env_mmc.c | 359 +++++++++++++++++++++++++++++++++++++++++++++++++ include/environment.h | 18 +++ lib_arm/board.c | 10 +- lib_ppc/board.c | 12 +- 5 files changed, 390 insertions(+), 12 deletions(-) create mode 100644 common/env_mmc.c
common/cmd_nvedit.c +2 -1
@@ -60,9 +60,10 @@ DECLARE_GLOBAL_DATA_PTR; !defined (CONFIG_ENV_IS_IN_NVRAM ) && \ !defined (CONFIG_ENV_IS_IN_ONENAND ) && \ !defined (CONFIG_ENV_IS_IN_SPI_FLASH ) && \ + !defined (CONFIG_ENV_IS_IN_MMC ) && \ !defined(CONFIG_ENV_IS_NOWHERE)# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\ -SPI_FLASH|MG_DISK|NVRAM|NOWHERE} +SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}#endif #define XMK_STR (x) #x
common/env_mmc.c new file +359 -0
359 lines not on this page · raw message
include/environment.h +18 -0
@@ -94,6 +94,24 @@# endif #endif /* CONFIG_ENV_IS_IN_MG_DISK */ +#if defined(CONFIG_ENV_IS_IN_MMC ) +# ifndef CONFIG_ENV_OFFSET +# error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_MMC" +# endif +# ifndef CONFIG_ENV_ADDR +# define CONFIG_ENV_ADDR (CONFIG_ENV_OFFSET) +# endif +# ifndef CONFIG_ENV_OFFSET +# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR) +# endif +# ifdef CONFIG_ENV_OFFSET_REDUND +# define CONFIG_SYS_REDUNDAND_ENVIRONMENT +# endif +# ifdef CONFIG_ENV_IS_EMBEDDED +# define ENV_IS_EMBEDDED 1 +# endif +#endif /* CONFIG_ENV_IS_IN_MMC */ +/* Embedded env is only supported for some flash types */ #ifdef CONFIG_ENV_IS_EMBEDDED # if !defined(CONFIG_ENV_IS_IN_FLASH) && \
lib_arm/board.c +5 -5
@@ -335,6 +335,11 @@ void start_armboot (void)nand_init ();/* go init the NAND */ #endif +#ifdef CONFIG_GENERIC_MMC +puts ("MMC: " ); +mmc_initialize (gd->bd); +#endif +#if defined(CONFIG_CMD_ONENAND )onenand_init ();#endif
@@ -416,11 +421,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);board_late_init ();#endif -#ifdef CONFIG_GENERIC_MMC -puts ("MMC: " ); -mmc_initialize (gd->bd); -#endif -#ifdef CONFIG_BITBANGMII bb_miiphy_init ();#endif
lib_ppc/board.c +6 -6
@@ -776,6 +776,12 @@ void board_init_r (gd_t *id, ulong dest_addr)nand_init ();/* go init the NAND */ #endif +#ifdef CONFIG_GENERIC_MMC +WATCHDOG_RESET (); +puts ("MMC: " ); +mmc_initialize (bd); +#endif +/* relocate environment function pointers etc. */ env_relocate ();
@@ -932,12 +938,6 @@ void board_init_r (gd_t *id, ulong dest_addr)scsi_init ();#endif -#ifdef CONFIG_GENERIC_MMC -WATCHDOG_RESET (); -puts ("MMC: " ); -mmc_initialize (bd); -#endif -#if defined(CONFIG_CMD_DOC )WATCHDOG_RESET ();puts ("DOC: " );
Signature · 1 line
1.6.0.4
PATCH 1/1 Save environment data to mmc.
Quoted 4 lines · On Wednesday 04 November 2009 05:02:44 Terry Lv wrote:
This patch is to save environment data to mmc card. It uses interfaces defined in generic mmc.
Signed-off-by Terry Lv <[email protected]>
Quoted 8 lines
--- common/cmd_nvedit.c | 3 +- common/env_mmc.c include/environment.h | lib_arm/board.c | 10 +- lib_ppc/board.c | 12 +- 5 files changed, 390 insertions(+), 12 deletions(-) create mode 100644 common/env_mmc.c
you never added env_mmc to the Makefile
common/env_mmc.c line 33
Quoted 3 lines
common/env_mmc.c new file +1
-0+#if defined(CONFIG_ENV_IS_IN_MMC )/* Environment is in MMC Flash */
have this config check be in the Makefile, then it isnt needed in the source as the build system will only build it when needed
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091104/d08fba5b/attachment.pgp
PATCH 1/1 Save environment data to mmc.
Oh, sorry, I will fix that.
Thanks
-----Original Message-----
From: Mike Frysinger [mailto:vapier at gentoo.org]
Sent: 2009?11?4? 19:02
To: u-boot at lists.denx.de
Cc: Lv Terry-R65388
Subject: Re: [U-Boot] [PATCH] Save environment data to mmc.
Quoted 4 lines · On Wednesday 04 November 2009 05:02:44 Terry Lv wrote:
This patch is to save environment data to mmc card. It uses interfaces defined in generic mmc.
Signed-off-by Terry Lv <[email protected]>
Quoted 8 lines
--- common/cmd_nvedit.c | 3 +- common/env_mmc.c include/environment.h | lib_arm/board.c | 10 +- lib_ppc/board.c | 12 +- 5 files changed, 390 insertions(+), 12 deletions(-) create mode100644
common/env_mmc.c
you never added env_mmc to the Makefile
common/env_mmc.c line 33
Quoted 3 lines
common/env_mmc.c new file +1
-0+#if defined(CONFIG_ENV_IS_IN_MMC )/* Environment is in MMC Flash */
have this config check be in the Makefile, then it isnt needed in the source as the build system will only build it when needed -mike