imx6: added fixfdt to bootscript
[openwrt/openwrt.git] / target / linux / imx6 / image / bootscript-ventana
index 8c789e57c9047e7f04086a194175f96f91f15d18..941afb519aeae4b2b55611f37a41e5419450a146 100644 (file)
@@ -1,4 +1,4 @@
-echo "Gateworks Ventana OpenWrt Boot script v1.00"
+echo "Gateworks Ventana OpenWrt Boot script v1.01"
 
 # set some defaults
 # set some defaults
@@ -9,80 +9,6 @@ setenv bootargs console=${console},${baudrate}
 setenv loadaddr 10800000
 setenv fdt_addr 18000000
 
-# detect displays in the following priority: HDMI, LVDS
-# setenv display to override detection for a single display
-# or setenv video if you want multiple displays
-if test -n "$video" ; then
-  echo "using video config from env: $video"
-  setenv bootargs "${bootargs}" "${video}"
-else
-  if test -n "$display" ; then
-    echo "using display from env: $display"
-  elif test -n "$panel" ; then
-    echo "using display from env: $panel"
-    setenv display "$panel"
-  else
-    echo "Detecting displays..."
-    i2c dev 2
-    if hdmidet ; then
-       echo "  HDMI detected"
-       setenv display "HDMI"
-    elif i2c probe 0x04 ; then
-       echo "  Freescale MXC-LVDS1 detected"
-       setenv display "LVDS"
-    elif i2c probe 0x14 ; then
-       echo "  DLC800FIGT3 detected"
-       setenv display "LVDS"
-    elif i2c probe 0x38 ; then
-       echo "  DLC700JMGT4 detected"
-       setenv display "LVDS"
-    fi
-  fi
-
-  # configure displays
-  echo "Configuring kernel bootargs for display(s): $display"
-  for p in ${display}; do
-    if itest.s "x${p}" == "xHannstar-XGA" ; then
-       setenv ptype "LVDS"
-    elif itest.s "x${p}" == "xDLC700JMGT4" ; then
-       setenv ptype "LVDS"
-    elif itest.s "x${p}" == "xDLC800FIGT3" ; then
-       setenv ptype "LVDS"
-    elif itest.s "x${p}" == "xLVDS" ; then
-       setenv ptype "LVDS"
-    elif itest.s "x${p}" == "xHDMI" ; then
-       setenv ptype "HDMI"
-       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
-    else
-        echo "${p} not supported"
-    fi
-
-    if itest.s "x${ptype}" == "xLVDS" ; then
-       echo "  mxcfb${nextcon}: LVDS ($p)"
-       setenv bootargs "${bootargs}" video=mxcfb${nextcon}:dev=ldb,bpp=32,if=RGB666
-       setexpr nextcon $nextcon + 1
-    elif itest.s "x${ptype}" == "xHDMI" ; then
-       echo "  mxcfb${nextcon}: HDMI ($hdmi)"
-       setenv bootargs "${bootargs}" video=mxcfb${nextcon}:dev=hdmi,bpp=32,${hdmi},if=RGB24
-       setexpr nextcon $nextcon + 1
-    fi
-
-  done
-
-  # disable remaining mxcfb devices
-  while test "4" -ne $nextcon ; do
-       setenv bootargs "${bootargs}" video=mxcfb${nextcon}:off
-       setexpr nextcon $nextcon + 1
-  done
-fi
-
 # detect dtype and bootdev by looking for kernel on media the bootloader
 # has mounted (in order of preference: usb/mmc/sata)
 #
@@ -109,9 +35,9 @@ if test -n "$bootdev" ; then
        echo "Using bootdev from env: $bootdev"
 else
        if itest.s "x${dtype}" == "xmmc" ; then
-               bootdev=mmcblk0
+               bootdev=mmcblk0p1
        else
-               bootdev=sda
+               bootdev=sda1
        fi
 fi
 
@@ -128,19 +54,22 @@ if itest.s "x${dtype}" == "xnand" ; then
 else
        echo "Booting from block device ${bootdev}..."
        setenv fsload "${fs}load ${dtype} ${disk}:1"
-       setenv root "root=/dev/${bootdev}"
+       setenv root "root=/dev/${bootdev} rootfstype=${fs} rootwait rw"
 fi
 
-setenv bootargs "${bootargs}" "${root}" "${extra}"
+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"