]> git.sur5r.net Git - u-boot/commitdiff
imx: ventana: update boot scripts to support ubifs boot vol
authorTim Harvey <tharvey@gateworks.com>
Wed, 8 Apr 2015 19:54:49 +0000 (12:54 -0700)
committerStefano Babic <sbabic@denx.de>
Wed, 22 Apr 2015 12:39:10 +0000 (14:39 +0200)
Added support in default boot scripts to find kernel/dtbs on a boot volume
separate from rootfs volume.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
include/configs/gw_ventana.h

index 0069120350e4ced101c5c47454e05af8edd94f41..684f3476a24ec070ff2c8d5fbeff1f400a70e2eb 100644 (file)
        "fdt_high=0xffffffff\0" \
        "fdt_addr=0x18000000\0" \
        "initrd_high=0xffffffff\0" \
+       "bootdir=boot\0" \
        "loadfdt=" \
-               "if ${fsload} ${fdt_addr} boot/${fdt_file}; then " \
-                       "echo Loaded DTB from boot/${fdt_file}; " \
-               "elif ${fsload} ${fdt_addr} boot/${fdt_file1}; then " \
-                       "echo Loaded DTB from boot/${fdt_file1}; " \
-               "elif ${fsload} ${fdt_addr} boot/${fdt_file2}; then " \
-                               "echo Loaded DTB from boot/${fdt_file2}; " \
+               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
+                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
+               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
+                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
+               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
+                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
                "fi\0" \
        \
-       "script=boot/6x_bootscript-ventana\0" \
+       "script=6x_bootscript-ventana\0" \
        "loadscript=" \
-               "if ${fsload} ${loadaddr} ${script}; then " \
+               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
                        "source; " \
                "fi\0" \
        \
-       "uimage=boot/uImage\0" \
+       "uimage=uImage\0" \
        "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
        "mmc_boot=" \
                "setenv fsload 'ext2load mmc 0:1'; " \
                "mmc dev 0 && mmc rescan && " \
                "run loadscript; " \
-               "if ${fsload} ${loadaddr} ${uimage}; then " \
+               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
                        "setenv bootargs console=${console},${baudrate} " \
                                "root=/dev/mmcblk0p1 rootfstype=ext4 " \
                                "rootwait rw ${video} ${extra}; " \
        "sata_boot=" \
                "setenv fsload 'ext2load sata 0:1'; sata init && " \
                "run loadscript; " \
-               "if ${fsload} ${loadaddr} ${uimage}; then " \
+               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
                        "setenv bootargs console=${console},${baudrate} " \
                                "root=/dev/sda1 rootfstype=ext4 " \
                                "rootwait rw ${video} ${extra}; " \
        "usb_boot=" \
                "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
                "run loadscript; " \
-               "if ${fsload} ${loadaddr} ${uimage}; then " \
+               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
                        "setenv bootargs console=${console},${baudrate} " \
                                "root=/dev/sda1 rootfstype=ext4 " \
                                "rootwait rw ${video} ${extra}; " \
 #else
        #define CONFIG_EXTRA_ENV_SETTINGS \
        CONFIG_EXTRA_ENV_SETTINGS_COMMON \
-       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
        \
+       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
        "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
                "tftp ${loadaddr} ${image_rootfs} && " \
                "nand erase.part rootfs && " \
        \
        "flash_boot=" \
                "setenv fsload 'ubifsload'; " \
-               "ubi part rootfs && ubifsmount ubi0:rootfs; " \
+               "ubi part rootfs; " \
+               "if ubi check boot; then " \
+                       "ubifsmount ubi0:boot; " \
+                       "setenv root ubi0:rootfs ubi.mtd=2 " \
+                               "rootfstype=squashfs,ubifs; " \
+                       "setenv bootdir; " \
+               "elif ubi check rootfs; then " \
+                       "ubifsmount ubi0:rootfs; " \
+                       "setenv root ubi0:rootfs ubi.mtd=2 " \
+                               "rootfstype=ubifs; " \
+               "fi; " \
                "run loadscript; " \
-               "if ${fsload} ${loadaddr} ${uimage}; then " \
+               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
                        "setenv bootargs console=${console},${baudrate} " \
-                               "root=ubi0:rootfs ubi.mtd=2 " \
-                               "rootfstype=ubifs ${video} ${extra}; " \
+                               "root=${root} ${video} ${extra}; " \
                        "if run loadfdt && fdt addr ${fdt_addr}; then " \
                                "ubifsumount; " \
                                "bootm ${loadaddr} - ${fdt_addr}; " \