Commit 23ac62d4c72c9be762cb8613b8269599295f7c88

Authored by Wu, Josh
Committed by Andreas Bießmann
1 parent da78fb5414

ARM: at91: at91sam9n12ek: save the environment to a fat file in MMC card

Insteading in mmc's raw sectors, this patch will save the environment
in a fat file (uboot.env) in mmc card's first FAT patition by default.

If you want to save in mmc's raw sectors, you only need to define
CONFIG_ENV_IS_IN_MMC.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>

Showing 1 changed file with 13 additions and 2 deletions Side-by-side Diff

include/configs/at91sam9n12ek.h
... ... @@ -201,11 +201,22 @@
201 201 #else /* CONFIG_SYS_USE_MMC */
202 202  
203 203 /* bootstrap + u-boot + env + linux in mmc */
204   -#define CONFIG_ENV_IS_IN_MMC
205   -/* For FAT system, most cases it should be in the reserved sector */
  204 +
  205 +#ifdef CONFIG_ENV_IS_IN_MMC
  206 +/* Use raw reserved sectors to save environment */
206 207 #define CONFIG_ENV_OFFSET 0x2000
207 208 #define CONFIG_ENV_SIZE 0x1000
208 209 #define CONFIG_SYS_MMC_ENV_DEV 0
  210 +#else
  211 +/* Use file in FAT file to save environment */
  212 +#define CONFIG_ENV_IS_IN_FAT
  213 +#define CONFIG_FAT_WRITE
  214 +#define FAT_ENV_INTERFACE "mmc"
  215 +#define FAT_ENV_FILE "uboot.env"
  216 +#define FAT_ENV_DEVICE_AND_PART "0"
  217 +#define CONFIG_ENV_SIZE 0x4000
  218 +#endif
  219 +
209 220 #define CONFIG_BOOTCOMMAND \
210 221 "setenv bootargs ${console} ${mtdparts} ${bootargs_mmc};" \
211 222 "fatload mmc 0:1 0x21000000 dtb;" \