]> git.sur5r.net Git - u-boot/commitdiff
ts4800: update environment to boot with device tree
authorDamien Riegel <damien.riegel@savoirfairelinux.com>
Thu, 21 Apr 2016 21:34:02 +0000 (17:34 -0400)
committerStefano Babic <sbabic@denx.de>
Tue, 24 May 2016 13:05:45 +0000 (15:05 +0200)
This commit updates the environment variables to be able to boot with a
device tree. The expected partition layout on the SD card is:
 - partition 1: type 0xDA, contains u-boot.bin
 - partition 2: type 0xC (fat), contains zImage and device tree
 - partition 3: type 0x83, root filesystem.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
include/configs/ts4800.h

index aa0605f28d7760b4794160fd9d0abc91afc14eed..03928633c7bb88e7fa9c5de36d3f366ad8955f05 100644 (file)
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "script=boot.scr\0" \
-       "image=uImage\0" \
+       "image=zImage\0" \
+       "fdt_file=imx51-ts4800.dtb\0" \
+       "fdt_addr=0x90fe0000\0" \
        "mmcdev=0\0" \
-       "mmcpart=1\0" \
-       "mmcargs=setenv bootargs root=/dev/mmcblk0p2 rootwait rw\0" \
+       "mmcpart=2\0" \
+       "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
+       "mmcargs=setenv bootargs root=${mmcroot}\0" \
        "addtty=setenv bootargs ${bootargs} console=ttymxc0,${baudrate}\0" \
        "loadbootscript=" \
                "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
        "bootscript=echo Running bootscript from mmc ...; " \
                "source\0" \
        "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};\0" \
+       "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
        "mmcboot=echo Booting from mmc ...; " \
                "run mmcargs addtty; " \
-                "bootm; "
+               "if run loadfdt; then " \
+                       "bootz ${loadaddr} - ${fdt_addr}; " \
+               "else " \
+                       "echo ERR: cannot load FDT; " \
+               "fi; "
+
 
 #define CONFIG_BOOTCOMMAND \
        "mmc dev ${mmcdev}; if mmc rescan; then " \