From: Piotr Dymacz Date: Sat, 26 Jun 2021 03:58:42 +0000 (+0200) Subject: imx6: image: fix Gateworks Ventana boot script filename X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5ec4b180c2d262b4130f0e84e6e829c671efbb92;p=openwrt%2Fstaging%2Fjogo.git imx6: image: fix Gateworks Ventana boot script filename U-Boot for the Gateworks Ventana includes filename of the boot script in the default/embedded environment (see 'include/configs/gw_ventana.h' in the U-Boot sources). This restores the old boot script filename ('6x_bootscript-ventana'), making Ventana boards boot again. Fixes: 8dba71dd33 ("imx6: image: drop BOOT_SCRIPT and fix DEVICE_NAME") Reported-by: Koen Vandeputte Signed-off-by: Piotr Dymacz --- diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 948694381e..5f8e5f1c04 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -124,7 +124,7 @@ define Device/gateworks_ventana DEVICE_VENDOR := Gateworks DEVICE_MODEL := Ventana family DEVICE_VARIANT := normal NAND flash - DEVICE_NAME := gateworks_ventana + DEVICE_NAME := ventana DEVICE_DTS:= \ imx6dl-gw51xx \ imx6dl-gw52xx \ diff --git a/target/linux/imx6/image/bootscript-gateworks_ventana b/target/linux/imx6/image/bootscript-gateworks_ventana deleted file mode 100644 index 734f74a30c..0000000000 --- a/target/linux/imx6/image/bootscript-gateworks_ventana +++ /dev/null @@ -1,85 +0,0 @@ -echo "Gateworks Ventana OpenWrt Boot script v1.02" - -# set some defaults -# set some defaults -test -n "$fs" || fs=ext2 -test -n "$disk" || disk=0 -setenv nextcon 0 -setenv bootargs console=${console},${baudrate} -setenv loadaddr 10800000 -setenv fdt_addr 18000000 - -# detect dtype by looking for kernel on media the bootloader -# has mounted (in order of preference: usb/mmc/sata) -# -# This assumes the bootloader has already started the respective subsystem -# or mounted the filesystem if appropriate to get to this bootscript -# -# To Speed up boot set dtype manually -if test -n "$dtype" ; then - echo "Using dtype from env: $dtype" -else - echo "Detecting boot device (dtype)..." - if ${fs}load usb ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then - dtype=usb - elif ${fs}load mmc ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then - dtype=mmc - elif ${fs}load sata ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then - dtype=sata - elif ubifsload ${loadaddr} ${bootdir}/uImage ; then - dtype=nand - fi - echo "detected dtype:$dtype" -fi - -echo "Booting from ${dtype}..." -if itest.s "x${dtype}" == "xnand" ; then - # fix partition name - # OpenWrt kernel bug prevents partition name of 'rootfs' from booting - # instead name the partition ubi which is what is looked for by - # procd sysupgrade - mtdparts del rootfs && mtdparts add nand0 - ubi - echo "mtdparts:${mtdparts}" - setenv fsload ubifsload - setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs" -else - setenv fsload "${fs}load ${dtype} ${disk}:1" - part uuid ${dtype} ${disk}:1 uuid - if test -z "${uuid}"; then - # fallback to bootdev - if test -n "$bootdev" ; then - echo "Using bootdev from env: $bootdev" - else - if itest.s "x${dtype}" == "xmmc" ; then - bootdev=mmcblk0p1 - else - bootdev=sda1 - fi - fi - setenv root "root=/dev/${bootdev}" - else - setenv root "root=PARTUUID=${uuid}" - fi - setenv root "$root rootfstype=${fs} rootwait rw" -fi - -setenv bootargs "${bootargs}" "${root}" "${video}" "${extra}" -if ${fsload} ${loadaddr} ${bootdir}/uImage; then - if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then - echo Loaded DTB from ${bootdir}/${fdt_file} - test -n "$fixfdt" && run fixfdt - bootm ${loadaddr} - ${fdt_addr} - elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then - echo Loaded DTB from ${bootdir}/${fdt_file1} - test -n "$fixfdt" && run fixfdt - bootm ${loadaddr} - ${fdt_addr} - elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then - echo Loaded DTB from ${bootdir}/${fdt_file2} - test -n "$fixfdt" && run fixfdt - bootm ${loadaddr} - ${fdt_addr} - else - echo "Error loading device-tree" - fi -else - echo "Error loading kernel image" -fi diff --git a/target/linux/imx6/image/bootscript-ventana b/target/linux/imx6/image/bootscript-ventana new file mode 100644 index 0000000000..734f74a30c --- /dev/null +++ b/target/linux/imx6/image/bootscript-ventana @@ -0,0 +1,85 @@ +echo "Gateworks Ventana OpenWrt Boot script v1.02" + +# set some defaults +# set some defaults +test -n "$fs" || fs=ext2 +test -n "$disk" || disk=0 +setenv nextcon 0 +setenv bootargs console=${console},${baudrate} +setenv loadaddr 10800000 +setenv fdt_addr 18000000 + +# detect dtype by looking for kernel on media the bootloader +# has mounted (in order of preference: usb/mmc/sata) +# +# This assumes the bootloader has already started the respective subsystem +# or mounted the filesystem if appropriate to get to this bootscript +# +# To Speed up boot set dtype manually +if test -n "$dtype" ; then + echo "Using dtype from env: $dtype" +else + echo "Detecting boot device (dtype)..." + if ${fs}load usb ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then + dtype=usb + elif ${fs}load mmc ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then + dtype=mmc + elif ${fs}load sata ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then + dtype=sata + elif ubifsload ${loadaddr} ${bootdir}/uImage ; then + dtype=nand + fi + echo "detected dtype:$dtype" +fi + +echo "Booting from ${dtype}..." +if itest.s "x${dtype}" == "xnand" ; then + # fix partition name + # OpenWrt kernel bug prevents partition name of 'rootfs' from booting + # instead name the partition ubi which is what is looked for by + # procd sysupgrade + mtdparts del rootfs && mtdparts add nand0 - ubi + echo "mtdparts:${mtdparts}" + setenv fsload ubifsload + setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs" +else + setenv fsload "${fs}load ${dtype} ${disk}:1" + part uuid ${dtype} ${disk}:1 uuid + if test -z "${uuid}"; then + # fallback to bootdev + if test -n "$bootdev" ; then + echo "Using bootdev from env: $bootdev" + else + if itest.s "x${dtype}" == "xmmc" ; then + bootdev=mmcblk0p1 + else + bootdev=sda1 + fi + fi + setenv root "root=/dev/${bootdev}" + else + setenv root "root=PARTUUID=${uuid}" + fi + setenv root "$root rootfstype=${fs} rootwait rw" +fi + +setenv bootargs "${bootargs}" "${root}" "${video}" "${extra}" +if ${fsload} ${loadaddr} ${bootdir}/uImage; then + if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then + echo Loaded DTB from ${bootdir}/${fdt_file} + test -n "$fixfdt" && run fixfdt + bootm ${loadaddr} - ${fdt_addr} + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then + echo Loaded DTB from ${bootdir}/${fdt_file1} + test -n "$fixfdt" && run fixfdt + bootm ${loadaddr} - ${fdt_addr} + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then + echo Loaded DTB from ${bootdir}/${fdt_file2} + test -n "$fixfdt" && run fixfdt + bootm ${loadaddr} - ${fdt_addr} + else + echo "Error loading device-tree" + fi +else + echo "Error loading kernel image" +fi