]> git.sur5r.net Git - u-boot/commitdiff
ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
authorWu, Josh <Josh.wu@atmel.com>
Wed, 19 Aug 2015 11:11:18 +0000 (19:11 +0800)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Fri, 21 Aug 2015 13:47:04 +0000 (15:47 +0200)
As almost all sama5 sd/mmc env configurations are same, so move them to
at91-sama5_common.h.

Also define CONFIG_ENV_VARS_UBOOT_CONFIG to have the varaible: $board_name.
Then we can use 'at91-${board_name}.dtb' as the dtb name.

TODO: since sama5d3xek has different dtb name, we need to some extra
stuff to make it work on sama5d3xek boards.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
include/configs/at91-sama5_common.h
include/configs/sama5d3_xplained.h
include/configs/sama5d3xek.h
include/configs/sama5d4_xplained.h
include/configs/sama5d4ek.h

index 2bded45548e5b05ac4b1130fca8e2a97d4d17b7b..bb737a1fe847d8542507f2654a01dc05f69ab8a6 100644 (file)
@@ -27,6 +27,7 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DISPLAY_CPUINFO
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_CMD_BOOTZ
 #define CONFIG_OF_LIBFDT               /* Device Tree support */
 
 #define CONFIG_CMD_DHCP
 
 #ifdef CONFIG_SYS_USE_MMC
+/* u-boot env in sd/mmc card */
+#define CONFIG_ENV_IS_IN_FAT
+#define CONFIG_FAT_WRITE
+#define FAT_ENV_INTERFACE      "mmc"
+#define FAT_ENV_DEVICE_AND_PART        "0"
+#define FAT_ENV_FILE           "uboot.env"
+#define CONFIG_ENV_SIZE                0x4000
+
+#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x21000000 at91-${board_name}.dtb; " \
+                               "fatload mmc 0:1 0x22000000 zImage; "   \
+                               "bootz 0x22000000 - 0x21000000"
 #define CONFIG_BOOTARGS                                                        \
        "console=ttyS0,115200 earlyprintk "                             \
        "root=/dev/mmcblk0p2 rw rootwait"
index c4141a019d174a320ed842f7a84dc3248074b55d..91ef1236e7e64738238acc28b7e913038737442e 100644 (file)
                                "nand read 0x22000000 0x200000 0x600000;" \
                                "bootz 0x22000000 - 0x21000000"
 #elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE      "mmc"
-#define FAT_ENV_FILE           "uboot.env"
-#define FAT_ENV_DEVICE_AND_PART        "0"
-#define CONFIG_ENV_SIZE                0x4000
-#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
-                               "fatload mmc 0:1 0x22000000 zImage; " \
-                               "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
 #else
 #define CONFIG_ENV_IS_NOWHERE
 #endif
index 9497bea9467480f0bcf915499ba43ddbb235bd70..5c7b722da386448321c3690b5886bbcc590ec3e3 100644 (file)
                                "nand read 0x22000000 0x200000 0x600000;" \
                                "bootm 0x22000000 - 0x21000000"
 #elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE      "mmc"
-#define FAT_ENV_FILE           "uboot.env"
-#define FAT_ENV_DEVICE_AND_PART        "0"
-#define CONFIG_ENV_SIZE                0x4000
-#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x21000000 dtb; " \
-                               "fatload mmc 0:1 0x22000000 uImage; " \
-                               "bootm 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
 #else
 #define CONFIG_ENV_IS_NOWHERE
 #endif
index e06dfc9a90f6145a59f139b86d419835f01d3c2d..fe585c431e89bb27181b144cd782c8691ea49d7b 100644 (file)
                                "nand read 0x22000000 0x200000 0x600000;" \
                                "bootz 0x22000000 - 0x21000000"
 #elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define CONFIG_FAT_WRITE
-#define FAT_ENV_INTERFACE      "mmc"
-/*
- * We don't specify the part number, if device 0 has partition table, it means
- * the first partition; it no partition table, then take whole device as a
- * FAT file system.
- */
-#define FAT_ENV_DEVICE_AND_PART        "0"
-#define FAT_ENV_FILE           "uboot.env"
-#define CONFIG_ENV_SIZE                0x4000
-#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
-                               "fatload mmc 0:1 0x22000000 zImage; " \
-                               "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
 #endif
 
-
-
 /* SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x200000
index eadccc182aa1e5871aa232a191ee208c49086229..ee31e9de885903a8b45f60c59321e51b37690de7 100644 (file)
                                "nand read 0x22000000 0x200000 0x600000;" \
                                "bootz 0x22000000 - 0x21000000"
 #elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define CONFIG_FAT_WRITE
-#define FAT_ENV_INTERFACE      "mmc"
-/*
- * We don't specify the part number, if device 0 has partition table, it means
- * the first partition; it no partition table, then take whole device as a
- * FAT file system.
- */
-#define FAT_ENV_DEVICE_AND_PART        "0"
-#define FAT_ENV_FILE           "uboot.env"
-#define CONFIG_ENV_SIZE                0x4000
-#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
-                               "fatload mmc 0:1 0x22000000 zImage; " \
-                               "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
 #endif
 
 /* SPL */