diff --git a/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script b/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script index 24147a2..1cf41d6 100644 --- a/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script +++ b/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script @@ -25,127 +25,157 @@ setexpr rd_addr $linux_addr + 0x4000000 # allow 64MB for kernel # CMA (memory allocation) if test -z "${mem}" ; then - # CMA used by etnaviv display driver and coda VPU driver - # specific requirements depend on display res and encode/decode res - # coherent_pool is used by various drivers such as ath10k - setenv mem "cma=64M coherent_pool=4M" - echo "Detected ${mem_mb}MB DRAM: $mem" + # CMA used by etnaviv display driver and coda VPU driver + # specific requirements depend on display res and encode/decode res + # coherent_pool is used by various drivers such as ath10k + setenv mem "cma=64M coherent_pool=4M" + echo "Detected ${mem_mb}MB DRAM: $mem" + fi + if itest.s "x${mem}" == "xNA" ; then - echo "Leaving CMA alone..." + echo "Leaving CMA alone..." + else - setenv extra "${extra}" "${mem}" - echo "Memory configuration used from env mem: $mem" + setenv extra "${extra}" "${mem}" + echo "Memory configuration used from env mem: $mem" + fi # Display output if test -z "${video}" ; then - # locally used variables - setenv lvds_flag - setenv hdmi_flag + # locally used variables + setenv lvds_flag + setenv hdmi_flag - # Default displays to display if displays is empty - if test -z "${displays}"; then - setenv displays "${display}" - fi - - # Detect HDMI if displays is empty (HDMI) - if test -z "${displays}" ; then - i2c dev 2 - if hdmidet ; then # HDMI - setenv displays "HDMI" - echo "HDMI Detected" + # Default displays to display if displays is empty + if test -z "${displays}"; then + setenv displays "${display}" + fi + + # Detect HDMI if displays is empty (HDMI) + if test -z "${displays}" ; then + i2c dev 2 + + if hdmidet ; then # HDMI + setenv displays "HDMI" + echo "HDMI Detected" + + fi fi - fi # Configure displays echo "Display(s) to configure: ${displays}" for disp in ${displays} ; do if itest.s "x${disp}" == "xHDMI" ; then - if test -z "${hdmi_flag}" ; then # Only allow one HDMI display - setenv hdmi_flag 1 - test -n "${hdmi}" || hdmi=1080p - if itest.s "x${hdmi}" == "x1080p" ; then - setenv hdmi "1920x1080M@60" - elif itest.s "x${hdmi}" == "x720p" ; then - setenv hdmi "1280x720M@60" - elif itest.s "x${hdmi}" == "x480p" ; then - setenv hdmi "720x480M@60" + if test -z "${hdmi_flag}" ; then # Only allow one HDMI display + setenv hdmi_flag 1 + test -n "${hdmi}" || hdmi=1080p + + if itest.s "x${hdmi}" == "x1080p" ; then + setenv hdmi "1920x1080M@60" + + elif itest.s "x${hdmi}" == "x720p" ; then + setenv hdmi "1280x720M@60" + + elif itest.s "x${hdmi}" == "x480p" ; then + setenv hdmi "720x480M@60" + + fi + + setenv video "${video}" "video=HDMI-A-1:${hdmi}" fi - setenv video "${video}" "video=HDMI-A-1:${hdmi}" - fi - # Freescale MCIMX-LVDS1 10" XGA Touchscreen Display - elif itest.s "x${disp}" == "xHannstar-XGA" ; then - if test -z "${lvds_flag}" ; then # Only allow one LVDS display - setenv lvds_flag 1 - setenv video "${video}" "video=LVDS-1:1024x768@65M" - setenv display "Hannstar-XGA" - fi + # Freescale MCIMX-LVDS1 10" XGA Touchscreen Display + elif itest.s "x${disp}" == "xHannstar-XGA" ; then + if test -z "${lvds_flag}" ; then # Only allow one LVDS display + setenv lvds_flag 1 + setenv video "${video}" "video=LVDS-1:1024x768@65M" + setenv display "Hannstar-XGA" - # GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display - elif itest.s "x${disp}" == "xDLC700JMGT4" ; then - if test -z "${lvds_flag}" ; then # Only allow one LVDS display - setenv lvds_flag 1 - setenv video "${video}" "video=LVDS-1:1024x600@65M" - setenv display "DLC700JMGT4" - fi + fi - # GW17030 DLC800FIGT3 8" XGA Touchscreen Display" - elif itest.s "x${disp}" == "xDLC800FIGT3" ; then - if test -z "${lvds_flag}" ; then # Only allow one LVDS display - setenv lvds_flag 1 - setenv video "${video}" "video=LVDS-1:1024x768@65M" - setenv display "DLC800FIGT3" - fi + # GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display + elif itest.s "x${disp}" == "xDLC700JMGT4" ; then + if test -z "${lvds_flag}" ; then # Only allow one LVDS display + setenv lvds_flag 1 + setenv video "${video}" "video=LVDS-1:1024x600@65M" + setenv display "DLC700JMGT4" - elif itest.s "x${disp}" != "none" ; then - echo "${disp} is an unsupported display type" - echo "Valid Displays: HDMI|Hannstar-XGA|DLC700JMGT4|DLC800FIGT3" - fi - done + fi - # disable unused connectors - if test -z "${hdmi_flag}" ; then - setenv video "${video}" "video=HDMI-A-1:d" - fi - if test -z "${lvds_flag}" ; then - setenv video "${video}" "video=LVDS-1:d" - fi + # GW17030 DLC800FIGT3 8" XGA Touchscreen Display" + elif itest.s "x${disp}" == "xDLC800FIGT3" ; then + if test -z "${lvds_flag}" ; then # Only allow one LVDS display + setenv lvds_flag 1 + setenv video "${video}" "video=LVDS-1:1024x768@65M" + setenv display "DLC800FIGT3" + + fi + + elif itest.s "x${disp}" != "none" ; then + echo "${disp} is an unsupported display type" + echo "Valid Displays: HDMI|Hannstar-XGA|DLC700JMGT4|DLC800FIGT3" + + fi + done + + # disable unused connectors + if test -z "${hdmi_flag}" ; then + setenv video "${video}" "video=HDMI-A-1:d" + + fi + + if test -z "${lvds_flag}" ; then + setenv video "${video}" "video=LVDS-1:d" + + fi + + # Set only if video is set + if test -n "${video}" ; then + setenv video "${video}" + + fi + + echo "Video configuration: ${video}" - # Set only if video is set - if test -n "${video}" ; then - setenv video "${video}" - fi - echo "Video configuration: ${video}" else - echo "Video configuration used from env video: ${video}" + echo "Video configuration used from env video: ${video}" + fi # setup root and load options based on dev type if itest.s "x${dtype}" == "xnand" ; then - echo "Booting from NAND/ubifs..." - setenv root "root=ubi0:rootfs ubi.mtd=2 ubi.fm_autoconvert=1 rootfstype=ubifs rw rootwait" - setenv fsload "ubifsload" + echo "Booting from NAND/ubifs..." + setenv root "root=ubi0:rootfs ubi.mtd=2 ubi.fm_autoconvert=1 rootfstype=ubifs rw rootwait" + setenv fsload "ubifsload" + elif itest.s "x${dtype}" == "xmmc" ; then - echo "Booting from MMC..." - part uuid mmc 0:1 uuid - if test -z "${uuid}" ; then - setenv root "root=/dev/mmcblk0p1 rootwait rw rootfstype=ext4" - else - setenv root "root=PARTUUID=${uuid} rootwait rw rootfstype=ext4" - fi - setenv fsload "ext4load $dtype 0:1" - setenv rd_addr # ramdisk not needed for IMX6 MMC + echo "Booting from MMC..." + part uuid mmc 0:1 uuid + + if test -z "${uuid}" ; then + setenv root "root=/dev/mmcblk0p1 rootwait rw rootfstype=ext4" + + else + setenv root "root=PARTUUID=${uuid} rootwait rw rootfstype=ext4" + + fi + + setenv fsload "ext4load $dtype 0:1" + setenv rd_addr # ramdisk not needed for IMX6 MMC + elif itest.s "x${dtype}" == "xusb" ; then - echo "Booting from USB Mass Storage..." - setenv root "root=/dev/sda1 rootwait" - setenv fsload "ext4load $dtype 0:1" + echo "Booting from USB Mass Storage..." + setenv root "root=/dev/sda1 rootwait" + setenv fsload "ext4load $dtype 0:1" + elif itest.s "x${dtype}" == "xsata" ; then - echo "Booting from SATA..." - setenv root "root=/dev/sda1 rootwait" - setenv fsload "ext4load $dtype 0:1" - setenv rd_addr # ramdisk not needed for IMX6 AHCI SATA + echo "Booting from SATA..." + setenv root "root=/dev/sda1 rootwait" + setenv fsload "ext4load $dtype 0:1" + setenv rd_addr # ramdisk not needed for IMX6 AHCI SATA + fi # setup bootargs @@ -165,12 +195,16 @@ $fsload $fdt_addr boot/$fdt_file1 || $fsload $fdt_addr boot/$fdt_file2 echo "Loading Kernel..." $fsload $linux_addr boot/uImage + if itest.s "x${rd_addr}" != "x" ; then - echo "Loading Ramdisk..." - $fsload $rd_addr boot/uramdisk + echo "Loading Ramdisk..." + $fsload $rd_addr boot/uramdisk + fi + if itest.s "x${dtype}" == "xnand" ; then - ubifsumount + ubifsumount + fi # fdt fixup @@ -178,9 +212,11 @@ test -n "$fixfdt" && run fixfdt # boot if itest.s "x${rd_addr}" != "x" ; then - echo "Booting ramdisk with "$bootargs"..." - bootm $linux_addr $rd_addr $fdt_addr + echo "Booting ramdisk with "$bootargs"..." + bootm $linux_addr $rd_addr $fdt_addr + else - echo "Booting with "$bootargs"..." - bootm $linux_addr - $fdt_addr + echo "Booting with "$bootargs"..." + bootm $linux_addr - $fdt_addr + fi