summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2012-04-25 16:57:38 +0800
committerJosh Wu <josh.wu@atmel.com>2012-09-25 16:20:59 +0800
commitf1aff0510760efe8a5009df7178bd8d2b1537886 (patch)
tree30ce63b94a128994cf6c095a019be31afc22dc75
parent93aaa15e7d09489b1c52b0c2955f39c10a72d24d (diff)
MMC: enable save env into sd card
-rw-r--r--board/atmel/at91sama5ek/at91sama5ek.c2
-rw-r--r--boards.cfg1
-rw-r--r--include/configs/at91sama5ek.h24
3 files changed, 25 insertions, 2 deletions
diff --git a/board/atmel/at91sama5ek/at91sama5ek.c b/board/atmel/at91sama5ek/at91sama5ek.c
index 168b6dcdfd1..74cc04bd010 100644
--- a/board/atmel/at91sama5ek/at91sama5ek.c
+++ b/board/atmel/at91sama5ek/at91sama5ek.c
@@ -214,8 +214,10 @@ void lcd_show_board_info(void)
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
dram_size += gd->bd->bi_dram[i].size;
nand_size = 0;
+#ifdef CONFIG_SYS_USE_NANDFLASH
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
nand_size += nand_info[i].size;
+#endif
lcd_printf (" %ld MB SDRAM, %ld MB NAND\n",
dram_size >> 20,
nand_size >> 20 );
diff --git a/boards.cfg b/boards.cfg
index 7b3355ecb74..a2e97b9f4e9 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -95,6 +95,7 @@ at91sam9g20ek_nandflash arm arm926ejs at91sam9260ek atmel
at91sam9m10g45ek_nandflash arm arm926ejs at91sam9m10g45ek atmel at91 at91sam9m10g45ek:AT91SAM9M10G45,SYS_USE_NANDFLASH
at91sama5ek_nandflash arm armv7 at91sama5ek atmel at91 at91sama5ek:AT91SAMA5,SYS_USE_NANDFLASH
at91sama5ek_serialflash arm armv7 at91sama5ek atmel at91 at91sama5ek:AT91SAMA5,SYS_USE_SERIALFLASH
+at91sama5ek_sdcard arm armv7 at91sama5ek atmel at91 at91sama5ek:AT91SAMA5,SYS_USE_MMC
at91sam9rlek_dataflash arm arm926ejs at91sam9rlek atmel at91 at91sam9rlek:AT91SAM9RL,SYS_USE_DATAFLASH
at91sam9rlek_nandflash arm arm926ejs at91sam9rlek atmel at91 at91sam9rlek:AT91SAM9RL,SYS_USE_NANDFLASH
at91sam9x5ek_nandflash arm arm926ejs at91sam9x5ek atmel at91 at91sam9x5ek:AT91SAM9X5,SYS_USE_NANDFLASH
diff --git a/include/configs/at91sama5ek.h b/include/configs/at91sama5ek.h
index 9e7e790ed04..0225c6e3085 100644
--- a/include/configs/at91sama5ek.h
+++ b/include/configs/at91sama5ek.h
@@ -125,6 +125,8 @@
#define CONFIG_CMD_NAND
#elif CONFIG_SYS_USE_SERIALFLASH
#define CONFIG_CMD_SF
+#elif CONFIG_SYS_USE_MMC
+#define CONFIG_CMD_MMC
#endif
#define CONFIG_CMD_USB
@@ -176,13 +178,14 @@
/* MMC */
+#ifdef CONFIG_CMD_MMC
#define CONFIG_MMC
-#define CONFIG_CMD_MMC
#define CONFIG_GENERIC_MMC
#define CONFIG_GENERIC_ATMEL_MCI
#undef CONFIG_ATMEL_MCI_8BIT
#define ATMEL_BASE_MMCI ATMEL_BASE_MCI0
#define CONFIG_CMD_FAT
+#endif
/* USB */
#define CONFIG_USB_ATMEL
@@ -210,7 +213,7 @@
#define CONFIG_BOOTCOMMAND "sf probe 0; " \
"sf read 0x22000000 0x42000 0x250000; " \
"bootm 0x22000000"
-#else
+#elif CONFIG_SYS_USE_NANDFLASH
/* bootstrap + u-boot + env in nandflash */
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x60000
@@ -218,14 +221,31 @@
#define CONFIG_ENV_SIZE 0x20000
#define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x100000 0x300000;" \
"bootm 0x22000000"
+#elif CONFIG_SYS_USE_MMC
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_ENV_OFFSET 0x2000
+#define CONFIG_ENV_OFFSET_REDUND 0x4000
+#define CONFIG_ENV_SIZE 0x2000
+#define CONFIG_BOOTCOMMAND "mmcinfo;fatload mmc 0:1 0x22000000 uImage;" \
+ "bootm 0x22000000"
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#else
+#define CONIG_ENV_IS_NOWHERE
#endif
+#ifdef CONFIG_SYS_USE_MMC
+#define CONFIG_BOOTARGS \
+ "console=ttyS0,115200 earlyprintk " \
+ "root=/dev/mmcblk0p2 " \
+ "rw rootfstype=ext2 rootdelay=2"
+#else
#define CONFIG_BOOTARGS \
"console=ttyS0,115200 earlyprintk " \
"root=/dev/mtdblock2 " \
"mtdparts=atmel_nand:1M(boot)ro," \
"3M@1M(linux),-(root) " \
"rw rootfstype=jffs2"
+#endif
#define CONFIG_BAUDRATE 115200
#define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }