From: Przemyslaw Marczak Date: Fri, 4 Dec 2015 15:21:02 +0000 (+0100) Subject: odroid xu3/xu4: add bootclone and ubootupgrade environment scripts X-Git-Tag: accepted/tizen/unified/20201110.125028~335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c8ccd776f3368fcef649a1dd057357493d0acc8;p=platform%2Fkernel%2Fu-boot.git odroid xu3/xu4: add bootclone and ubootupgrade environment scripts Script ubootupgrade: This script allows updating U-Boot from file u-boot-mmc.bin existing on boot partition, e.g. with SD card reader. This is useful for XU4, when U-Boot upgrade is needed, then it can be delivered with 'boot.img' as regular file and upgraded by running: run ubootupgrade Script bootclone: This script allows cloning bootloader firmware including: - bl1, bl2, U-Boot ,and TZSW from bootable SD card to clean eMMC card using XU3/XU4 board. This is useful, when user have SD card reader only and wants prepare a bootable eMMC card. The script expects that SD is bootable and can be run as follows: run bootclone Signed-off-by: Przemyslaw Marczak --- diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 40eb5f0..16f8ee6 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -132,7 +132,39 @@ "dfu_interface=mmc\0" \ "dfu_device=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \ "dfu_alt_system="CONFIG_DFU_ALT_SYSTEM \ - "dfu_alt_info=Autoset by THOR/DFU command run.\0" + "dfu_alt_info=Autoset by THOR/DFU command run.\0" \ + "bootclone=" \ + "echo ' 'Bootloader clone from SD to eMMC.;" \ + "echo ' 'Checking SD/eMMC configuration...;" \ + "if mmc dev 1 1; then " \ + "mmc dev 0;" \ + "mmc read 0x40000000 0x1 0xa3e;" \ + "mmc dev 1 1;" \ + "mmc write 0x40000000 0x0 0xa3e;" \ + "mmc dev 1 0;" \ + "else " \ + "echo ' 'Wrong cards setup.;" \ + "echo ' 'Make sure that eMMC is in proper slot.;" \ + "echo ' 'Switch SW1 DIP to SD card booting.;" \ + "fi;\0" \ + "ubootupgrade=" \ + "if test -e mmc 0:${mmcbootpart} u-boot-mmc.bin; then " \ + "echo U-Boot upgrade from partition: ${mmcbootpart}.;" \ + "echo Found U-Boot image: u-boot-mmc.bin;" \ + "fatload mmc 0:1 0x40000000 u-boot-mmc.bin;" \ + "if mmc dev 0 1; then " \ + "echo Boot device is eMMC;" \ + "mmc write 0x40000000 0x3e 0x800;" \ + "mmc dev 0 0;" \ + "else " \ + "echo Boot device is SD;" \ + "mmc write 0x40000000 0x3f 0x800;" \ + "fi;" \ + "echo Bootloader upgrade done;" \ + "reset;" \ + "else " \ + "echo U-Boot image: u-boot-mmc.bin not found!;" \ + "fi;\0" /* Hacking */ #define EXYNOS5422_MFC_CPLL_FIX