[U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash env config to at91-sama5_common.h
Josh Wu
josh.wu at atmel.com
Tue Jul 7 13:08:19 CEST 2015
As all sama5 nandflash env configurations are same, so move them to
at91-sama5_common.h.
Signed-off-by: Josh Wu <josh.wu at atmel.com>
---
include/configs/at91-sama5_common.h | 12 ++++++++++++
include/configs/sama5d3_xplained.h | 9 +--------
include/configs/sama5d3xek.h | 9 +--------
include/configs/sama5d4_xplained.h | 9 +--------
include/configs/sama5d4ek.h | 9 +--------
5 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 99fa0b1..90227ad 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -83,6 +83,18 @@
"256K(env),256k(env_redundent),256k(spare)," \
"512k(dtb),6M(kernel)ro,-(rootfs) " \
"rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
+
+#ifdef CONFIG_SYS_USE_NANDFLASH
+/* u-boot env in nand flash */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET 0xc0000
+#define CONFIG_ENV_OFFSET_REDUND 0x100000
+#define CONFIG_ENV_SIZE 0x20000
+#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
+ "nand read 0x22000000 0x200000 0x600000;" \
+ "bootz 0x22000000 - 0x21000000"
+#endif
+
#endif
#define CONFIG_BAUDRATE 115200
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index e5de24b..b0e9295 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -117,14 +117,7 @@
#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
#if CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 71441a4..6a19eb6 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -167,14 +167,7 @@
"sf read 0x22000000 0x42000 0x300000; " \
"bootm 0x22000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootm 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index a7d9e78..917d481 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -132,14 +132,7 @@
"sf read 0x22000000 0x100000 0x300000; " \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index 8ecb6d3..e21569b 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -130,14 +130,7 @@
"sf read 0x22000000 0x100000 0x300000; " \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env*/
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
--
1.9.1
More information about the U-Boot
mailing list