]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
M28EVK: Add SD update command
authorMarek Vasut <marex@denx.de>
Tue, 1 May 2012 11:09:43 +0000 (11:09 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 15 May 2012 06:31:35 +0000 (08:31 +0200)
Add "update_sd_firmware" command to easily reload the SD card of
m28evk kit. This comes handy when the board boots from SD card.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
include/configs/m28evk.h

index 8cd5f31c8578da092c2b6e49dd437b424b3acf23..60f8a6c3691b5ff1ce71cb3cb1c9c3d6be15c6e8 100644 (file)
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        "update_nand_full_filename=u-boot.nand\0"                       \
        "update_nand_firmware_filename=u-boot.sb\0"                     \
+       "update_sd_firmware_filename=u-boot.sd\0"                       \
        "update_nand_firmware_maxsz=0x100000\0"                         \
        "update_nand_stride=0x40\0"     /* MX28 datasheet ch. 12.12 */  \
        "update_nand_count=0x4\0"       /* MX28 datasheet ch. 12.12 */  \
                "nand erase ${fcb_sz} ${fw_sz} ; "                      \
                "nand write ${loadaddr} ${fcb_sz} ${filesize} ; "       \
                "nand write ${loadaddr} ${fw_off} ${filesize} ; "       \
+               "fi\0"                                                  \
+       "update_sd_firmware="           /* Update the SD firmware partition */ \
+               "if mmc rescan ; then "                                 \
+               "if tftp ${update_sd_firmware_filename} ; then "        \
+               "setexpr fw_sz ${filesize} / 0x200 ; "  /* SD block size */ \
+               "setexpr fw_sz ${fw_sz} + 1 ; "                         \
+               "mmc write ${loadaddr} 0x800 ${fw_sz} ; "               \
+               "fi ; "                                                 \
                "fi\0"
 
 #endif /* __M28_H__ */