From: Piotr Dymacz Date: Sat, 9 Jan 2021 15:47:41 +0000 (+0100) Subject: imx6: image: use vendor_model scheme X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cbc8bcfbaa71fe0928bf07d29ec0fe6217fd51ad;p=openwrt%2Fstaging%2Fblogic.git imx6: image: use vendor_model scheme This switches device names to the common 'vendor_model' approach as in most of other targets in OpenWrt. Signed-off-by: Piotr Dymacz --- diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 7608bd6d8c28..efd553efb928 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -127,10 +127,11 @@ define Device/Default IMAGES := endef -define Device/ventana +define Device/gateworks_ventana DEVICE_VENDOR := Gateworks DEVICE_MODEL := Ventana family DEVICE_VARIANT := normal NAND flash + DEVICE_NAME := ventana DEVICE_DTS:= \ imx6dl-gw51xx \ imx6dl-gw52xx \ @@ -165,7 +166,7 @@ define Device/ventana KERNEL += | boot-overlay IMAGES := nand.ubi bootfs.tar.gz dtb UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15 - BOOT_SCRIPT := bootscript-ventana + BOOT_SCRIPT := bootscript-gateworks_ventana IMAGE/nand.ubi := append-ubi IMAGE/bootfs.tar.gz := bootfs.tar.gz IMAGE/dtb := install-dtb @@ -173,33 +174,32 @@ define Device/ventana BLOCKSIZE := 128k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB endef -TARGET_DEVICES += ventana +TARGET_DEVICES += gateworks_ventana -define Device/ventana-large - $(Device/ventana) +define Device/gateworks_ventana-large + $(Device/gateworks_ventana) DEVICE_VARIANT := large NAND flash - DEVICE_NAME := ventana IMAGES := nand.ubi PAGESIZE := 4096 BLOCKSIZE := 256k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB endef -TARGET_DEVICES += ventana-large +TARGET_DEVICES += gateworks_ventana-large -define Device/wandboard +define Device/wandboard_dual DEVICE_VENDOR := Wandboard DEVICE_MODEL := Dual DEVICE_DTS := imx6dl-wandboard endef -TARGET_DEVICES += wandboard +TARGET_DEVICES += wandboard_dual -define Device/cubox-i +define Device/solidrun_cubox-i DEVICE_VENDOR := SolidRun DEVICE_MODEL := CuBox-i KERNEL := kernel-bin KERNEL_SUFFIX := -zImage UBOOT := mx6cuboxi - BOOT_SCRIPT := bootscript-cubox + BOOT_SCRIPT := bootscript-solidrun_cubox DEVICE_NAME := cubox DEVICE_PACKAGES := kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid DEVICE_DTS := imx6q-cubox-i imx6dl-cubox-i imx6q-hummingboard imx6dl-hummingboard @@ -208,9 +208,9 @@ define Device/cubox-i IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard IMAGE/dtb := install-dtb endef -TARGET_DEVICES += cubox-i +TARGET_DEVICES += solidrun_cubox-i -define Device/apalis +define Device/toradex_apalis DEVICE_VENDOR := Toradex DEVICE_MODEL := Apalis family SUPPORTED_DEVICES := apalis,ixora apalis,eval @@ -222,7 +222,7 @@ define Device/apalis kmod-can kmod-can-flexcan kmod-can-raw \ kmod-leds-gpio kmod-gpio-button-hotplug \ kmod-pps-gpio kmod-rtc-ds1307 - BOOT_SCRIPT := bootscript-apalis + BOOT_SCRIPT := bootscript-toradex_apalis FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) @@ -231,6 +231,6 @@ define Device/apalis ARTIFACTS := recovery.scr ARTIFACT/recovery.scr := recovery-scr endef -TARGET_DEVICES += apalis +TARGET_DEVICES += toradex_apalis $(eval $(call BuildImage)) diff --git a/target/linux/imx6/image/bootscript-apalis b/target/linux/imx6/image/bootscript-apalis deleted file mode 100644 index 3a3a6dadb145..000000000000 --- a/target/linux/imx6/image/bootscript-apalis +++ /dev/null @@ -1,21 +0,0 @@ -echo "Toradex Apalis OpenWrt Boot script v1.1" - -run emmcfinduuid - -setenv nextcon 0 -setenv boot_file uImage -setenv fdt_file imx6q-apalis-ixora.dtb -setenv root root=PARTUUID=${uuid} rootfstype=squashfs rootwait -setenv bootargs earlyprintk console=${console},${baudrate}n8 ${root} -setenv fsload ext4load mmc ${emmcdev}:${emmcbootpart} - -if ${fsload} ${kernel_addr_r} ${boot_file}; then - if ${fsload} ${fdt_addr_r} ${fdt_file}; then - test -n "$fdt_fixup" && run fdt_fixup - bootm ${kernel_addr_r} - ${fdt_addr_r} - else - echo "Error loading device-tree" - fi -else - echo "Error loading kernel image" -fi diff --git a/target/linux/imx6/image/bootscript-cubox b/target/linux/imx6/image/bootscript-cubox deleted file mode 100644 index 2ed48ab9415f..000000000000 --- a/target/linux/imx6/image/bootscript-cubox +++ /dev/null @@ -1,31 +0,0 @@ -echo "CuBox OpenWrt Boot script" - -# Set console variable for both UART and HDMI -setenv console console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 - -# Find correct dtb -if test ${board_rev} = MX6DL; then - setenv fdt_soc_type imx6dl; -elif test ${board_rev} = MX6Q; then - setenv fdt_soc_type imx6q; -fi -if test ${board_name} = CUBOXI; then - setenv fdt_name ${fdt_soc_type}-cubox-i.dtb; -elif test ${board_name} = HUMMINGBOARD; then - setenv fdt_name ${fdt_soc_type}-hummingboard.dtb; -fi - -# Set correct devtype and partition -if test ${devtype} != mmc; then setenv devtype mmc; fi -if mmc dev 0; then - setenv mmcdev 0 -elif mmc dev 1; then - setenv mmcdev 1 -fi - -# Boot from the SD card is supported at the moment -setenv bootargs "${console} root=/dev/mmcblk1p2 rw rootwait" -mmc dev ${mmcdev} -load ${devtype} ${mmcdev}:${devplist} ${kernel_addr_r} /uImage -load ${devtype} ${mmcdev}:${devplist} ${fdt_addr_r} /${fdt_name} -bootz ${kernel_addr_r} - ${fdt_addr_r} diff --git a/target/linux/imx6/image/bootscript-gateworks_ventana b/target/linux/imx6/image/bootscript-gateworks_ventana new file mode 100644 index 000000000000..734f74a30c5f --- /dev/null +++ b/target/linux/imx6/image/bootscript-gateworks_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 diff --git a/target/linux/imx6/image/bootscript-solidrun_cubox b/target/linux/imx6/image/bootscript-solidrun_cubox new file mode 100644 index 000000000000..2ed48ab9415f --- /dev/null +++ b/target/linux/imx6/image/bootscript-solidrun_cubox @@ -0,0 +1,31 @@ +echo "CuBox OpenWrt Boot script" + +# Set console variable for both UART and HDMI +setenv console console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 + +# Find correct dtb +if test ${board_rev} = MX6DL; then + setenv fdt_soc_type imx6dl; +elif test ${board_rev} = MX6Q; then + setenv fdt_soc_type imx6q; +fi +if test ${board_name} = CUBOXI; then + setenv fdt_name ${fdt_soc_type}-cubox-i.dtb; +elif test ${board_name} = HUMMINGBOARD; then + setenv fdt_name ${fdt_soc_type}-hummingboard.dtb; +fi + +# Set correct devtype and partition +if test ${devtype} != mmc; then setenv devtype mmc; fi +if mmc dev 0; then + setenv mmcdev 0 +elif mmc dev 1; then + setenv mmcdev 1 +fi + +# Boot from the SD card is supported at the moment +setenv bootargs "${console} root=/dev/mmcblk1p2 rw rootwait" +mmc dev ${mmcdev} +load ${devtype} ${mmcdev}:${devplist} ${kernel_addr_r} /uImage +load ${devtype} ${mmcdev}:${devplist} ${fdt_addr_r} /${fdt_name} +bootz ${kernel_addr_r} - ${fdt_addr_r} diff --git a/target/linux/imx6/image/bootscript-toradex_apalis b/target/linux/imx6/image/bootscript-toradex_apalis new file mode 100644 index 000000000000..3a3a6dadb145 --- /dev/null +++ b/target/linux/imx6/image/bootscript-toradex_apalis @@ -0,0 +1,21 @@ +echo "Toradex Apalis OpenWrt Boot script v1.1" + +run emmcfinduuid + +setenv nextcon 0 +setenv boot_file uImage +setenv fdt_file imx6q-apalis-ixora.dtb +setenv root root=PARTUUID=${uuid} rootfstype=squashfs rootwait +setenv bootargs earlyprintk console=${console},${baudrate}n8 ${root} +setenv fsload ext4load mmc ${emmcdev}:${emmcbootpart} + +if ${fsload} ${kernel_addr_r} ${boot_file}; then + if ${fsload} ${fdt_addr_r} ${fdt_file}; then + test -n "$fdt_fixup" && run fdt_fixup + bootm ${kernel_addr_r} - ${fdt_addr_r} + 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 deleted file mode 100644 index 734f74a30c5f..000000000000 --- a/target/linux/imx6/image/bootscript-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/recovery-apalis b/target/linux/imx6/image/recovery-apalis deleted file mode 100644 index d75b95434587..000000000000 --- a/target/linux/imx6/image/recovery-apalis +++ /dev/null @@ -1,15 +0,0 @@ -# flash u-boot-with-spl.imx -# using fixed size of 1M for U-Boot + SPL -mmc dev 0 1 -mmc write 0x12100000 0x2 0x800 - -# flash openwrt-imx6-apalis-squashfs.combined.bin -setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' -run set_blkcnt -mmc dev 0 0 -mmc write 0x12500000 0 ${blkcnt} - -env default -f -a -saveenv - -reset diff --git a/target/linux/imx6/image/recovery-toradex_apalis b/target/linux/imx6/image/recovery-toradex_apalis new file mode 100644 index 000000000000..d75b95434587 --- /dev/null +++ b/target/linux/imx6/image/recovery-toradex_apalis @@ -0,0 +1,15 @@ +# flash u-boot-with-spl.imx +# using fixed size of 1M for U-Boot + SPL +mmc dev 0 1 +mmc write 0x12100000 0x2 0x800 + +# flash openwrt-imx6-apalis-squashfs.combined.bin +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +run set_blkcnt +mmc dev 0 0 +mmc write 0x12500000 0 ${blkcnt} + +env default -f -a +saveenv + +reset