]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mx6sabresd: Add eMMC specific environment to allow U-Boot update
authorOtavio Salvador <otavio@ossystems.com.br>
Mon, 6 Jan 2014 15:27:20 +0000 (13:27 -0200)
committerStefano Babic <sbabic@denx.de>
Mon, 13 Jan 2014 10:52:28 +0000 (11:52 +0100)
A new 'update_emmc_firmware' target is added to allow for easy U-Boot
update in the eMMC as it has secury boot partition and this needs
specific handling on how to program the specific partition.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
include/configs/mx6sabre_common.h
include/configs/mx6sabresd.h

index 21c848f90bd2d0ee52bf422089dfd1f78f782969..5ee7fa5448d026beabcadb4eec69a9c864ea1970 100644 (file)
 #define CONFIG_LOADADDR                        0x12000000
 #define CONFIG_SYS_TEXT_BASE           0x17800000
 
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+#define EMMC_ENV \
+       "emmcdev=2\0" \
+       "update_emmc_firmware=" \
+               "if test ${ip_dyn} = yes; then " \
+                       "setenv get_cmd dhcp; " \
+               "else " \
+                       "setenv get_cmd tftp; " \
+               "fi; " \
+               "if ${get_cmd} ${update_sd_firmware_filename}; then " \
+                       "if mmc dev ${emmcdev} && " \
+                               "mmc open ${emmcdev} 1; then "  \
+                               "setexpr fw_sz ${filesize} / 0x200; " \
+                               "setexpr fw_sz ${fw_sz} + 1; "  \
+                               "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+                               "mmc close ${emmcdev} 1; " \
+                       "fi; "  \
+               "fi\0"
+#else
+#define EMMC_ENV ""
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "script=boot.scr\0" \
        "uimage=uImage\0" \
                                "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
                        "fi; "  \
                "fi\0" \
+       EMMC_ENV          \
        "mmcargs=setenv bootargs console=${console},${baudrate} " \
                "root=${mmcroot}\0" \
        "loadbootscript=" \
index 3229bc70d868f8187fd86594ba8220b5eba71444..4919f53328d92b15c664b6ad04be5c7da470daad 100644 (file)
@@ -23,6 +23,8 @@
 #endif
 #define PHYS_SDRAM_SIZE                (1u * 1024 * 1024 * 1024)
 
+#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
+
 #include "mx6sabre_common.h"
 
 #define CONFIG_SYS_FSL_USDHC_NUM       3