Commit e2801a9659b495576c388aed6a820185071d000d

Authored by Tim Harvey
Committed by Stefano Babic
1 parent aec3761a77

imx: ventana: update boot scripts to support ubifs boot vol

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>

Showing 1 changed file with 27 additions and 17 deletions Side-by-side Diff

include/configs/gw_ventana.h
... ... @@ -338,28 +338,29 @@
338 338 "fdt_high=0xffffffff\0" \
339 339 "fdt_addr=0x18000000\0" \
340 340 "initrd_high=0xffffffff\0" \
  341 + "bootdir=boot\0" \
341 342 "loadfdt=" \
342   - "if ${fsload} ${fdt_addr} boot/${fdt_file}; then " \
343   - "echo Loaded DTB from boot/${fdt_file}; " \
344   - "elif ${fsload} ${fdt_addr} boot/${fdt_file1}; then " \
345   - "echo Loaded DTB from boot/${fdt_file1}; " \
346   - "elif ${fsload} ${fdt_addr} boot/${fdt_file2}; then " \
347   - "echo Loaded DTB from boot/${fdt_file2}; " \
  343 + "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
  344 + "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
  345 + "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
  346 + "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
  347 + "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
  348 + "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
348 349 "fi\0" \
349 350 \
350   - "script=boot/6x_bootscript-ventana6x_bootscript-ventana\0" \" \
  351 + "script=6x_bootscript-ventana6x_bootscript-ventana\0" \" \
351 352 "loadscript=" \
352   - "if ${fsload} ${loadaddr} ${script}; then " \
  353 + "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
353 354 "source; " \
354 355 "fi\0" \
355 356 \
356   - "uimage=boot/uImageuImage\0" \" \
  357 + "uimage=uImageuImage\0" \" \
357 358 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
358 359 "mmc_boot=" \
359 360 "setenv fsload 'ext2load mmc 0:1'; " \
360 361 "mmc dev 0 && mmc rescan && " \
361 362 "run loadscript; " \
362   - "if ${fsload} ${loadaddr} ${uimage}; then " \
  363 + "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
363 364 "setenv bootargs console=${console},${baudrate} " \
364 365 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
365 366 "rootwait rw ${video} ${extra}; " \
... ... @@ -373,7 +374,7 @@
373 374 "sata_boot=" \
374 375 "setenv fsload 'ext2load sata 0:1'; sata init && " \
375 376 "run loadscript; " \
376   - "if ${fsload} ${loadaddr} ${uimage}; then " \
  377 + "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
377 378 "setenv bootargs console=${console},${baudrate} " \
378 379 "root=/dev/sda1 rootfstype=ext4 " \
379 380 "rootwait rw ${video} ${extra}; " \
... ... @@ -386,7 +387,7 @@
386 387 "usb_boot=" \
387 388 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
388 389 "run loadscript; " \
389   - "if ${fsload} ${loadaddr} ${uimage}; then " \
  390 + "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
390 391 "setenv bootargs console=${console},${baudrate} " \
391 392 "root=/dev/sda1 rootfstype=ext4 " \
392 393 "rootwait rw ${video} ${extra}; " \
393 394  
... ... @@ -429,8 +430,8 @@
429 430 #else
430 431 #define CONFIG_EXTRA_ENV_SETTINGS \
431 432 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
432   - "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
433 433 \
  434 + "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
434 435 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
435 436 "tftp ${loadaddr} ${image_rootfs} && " \
436 437 "nand erase.part rootfs && " \
437 438  
438 439  
... ... @@ -438,12 +439,21 @@
438 439 \
439 440 "flash_boot=" \
440 441 "setenv fsload 'ubifsload'; " \
441   - "ubi part rootfs && ubifsmount ubi0:rootfs; " \
  442 + "ubi part rootfs; " \
  443 + "if ubi check boot; then " \
  444 + "ubifsmount ubi0:boot; " \
  445 + "setenv root ubi0:rootfs ubi.mtd=2 " \
  446 + "rootfstype=squashfs,ubifs; " \
  447 + "setenv bootdir; " \
  448 + "elif ubi check rootfs; then " \
  449 + "ubifsmount ubi0:rootfs; " \
  450 + "setenv root ubi0:rootfs ubi.mtd=2 " \
  451 + "rootfstype=ubifs; " \
  452 + "fi; " \
442 453 "run loadscript; " \
443   - "if ${fsload} ${loadaddr} ${uimage}; then " \
  454 + "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
444 455 "setenv bootargs console=${console},${baudrate} " \
445   - "root=ubi0:rootfs ubi.mtd=2 " \
446   - "rootfstype=ubifs ${video} ${extra}; " \
  456 + "root=${root} ${video} ${extra}; " \
447 457 "if run loadfdt && fdt addr ${fdt_addr}; then " \
448 458 "ubifsumount; " \
449 459 "bootm ${loadaddr} - ${fdt_addr}; " \