1 echo "Gateworks Ventana OpenWrt Boot script v1.00"
5 test -n "$fs" || fs=ext2
6 test -n "$disk" || disk=0
8 setenv bootargs console=${console},${baudrate}
9 setenv loadaddr 10800000
10 setenv fdt_addr 18000000
12 # detect displays in the following priority: HDMI, LVDS
13 # setenv display to override detection for a single display
14 # or setenv video if you want multiple displays
15 if test -n "$video" ; then
16 echo "using video config from env: $video"
17 setenv bootargs "${bootargs}" "${video}"
19 if test -n "$display" ; then
20 echo "using display from env: $display"
21 elif test -n "$panel" ; then
22 echo "using display from env: $panel"
23 setenv display "$panel"
25 echo "Detecting displays..."
30 elif i2c probe 0x04 ; then
31 echo " Freescale MXC-LVDS1 detected"
33 elif i2c probe 0x14 ; then
34 echo " DLC800FIGT3 detected"
36 elif i2c probe 0x38 ; then
37 echo " DLC700JMGT4 detected"
43 echo "Configuring kernel bootargs for display(s): $display"
44 for p in ${display}; do
45 if itest.s "x${p}" == "xHannstar-XGA" ; then
47 elif itest.s "x${p}" == "xDLC700JMGT4" ; then
49 elif itest.s "x${p}" == "xDLC800FIGT3" ; then
51 elif itest.s "x${p}" == "xLVDS" ; then
53 elif itest.s "x${p}" == "xHDMI" ; then
55 test -n "$hdmi" || hdmi=1080p
56 if itest.s "x${hdmi}" == "x1080p" ; then
57 setenv hdmi "1920x1080M@60"
58 elif itest.s "x${hdmi}" == "x720p" ; then
59 setenv hdmi "1280x720M@60"
60 elif itest.s "x${hdmi}" == "x480p" ; then
61 setenv hdmi "720x480M@60"
64 echo "${p} not supported"
67 if itest.s "x${ptype}" == "xLVDS" ; then
68 echo " mxcfb${nextcon}: LVDS ($p)"
69 setenv bootargs "${bootargs}" video=mxcfb${nextcon}:dev=ldb,bpp=32,if=RGB666
70 setexpr nextcon $nextcon + 1
71 elif itest.s "x${ptype}" == "xHDMI" ; then
72 echo " mxcfb${nextcon}: HDMI ($hdmi)"
73 setenv bootargs "${bootargs}" video=mxcfb${nextcon}:dev=hdmi,bpp=32,${hdmi},if=RGB24
74 setexpr nextcon $nextcon + 1
79 # disable remaining mxcfb devices
80 while test "4" -ne $nextcon ; do
81 setenv bootargs "${bootargs}" video=mxcfb${nextcon}:off
82 setexpr nextcon $nextcon + 1
86 # detect dtype and bootdev by looking for kernel on media the bootloader
87 # has mounted (in order of preference: usb/mmc/sata)
89 # This assumes the bootloader has already started the respective subsystem
90 # or mounted the filesystem if appropriate to get to this bootscript
92 # To Speed up boot set dtype manually
93 if test -n "$dtype" ; then
94 echo "Using dtype from env: $dtype"
96 echo "Detecting boot device (dtype)..."
97 if ${fs}load usb ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
99 elif ${fs}load mmc ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
101 elif ${fs}load sata ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
103 elif ubifsload ${loadaddr} ${bootdir}/uImage ; then
106 echo "detected dtype:$dtype"
108 if test -n "$bootdev" ; then
109 echo "Using bootdev from env: $bootdev"
111 if itest.s "x${dtype}" == "xmmc" ; then
118 if itest.s "x${dtype}" == "xnand" ; then
119 echo "Booting from NAND..."
121 # OpenWrt kernel bug prevents partition name of 'rootfs' from booting
122 # instead name the partition ubi which is what is looked for by
124 mtdparts del rootfs && mtdparts add nand0 - ubi
125 echo "mtdparts:${mtdparts}"
126 setenv fsload ubifsload
127 setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs"
129 echo "Booting from block device ${bootdev}..."
130 setenv fsload "${fs}load ${dtype} ${disk}:1"
131 setenv root "root=/dev/${bootdev}"
134 setenv bootargs "${bootargs}" "${root}" "${extra}"
135 if ${fsload} ${loadaddr} ${bootdir}/uImage; then
136 if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
137 echo Loaded DTB from ${bootdir}/${fdt_file}
138 bootm ${loadaddr} - ${fdt_addr}
139 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
140 echo Loaded DTB from ${bootdir}/${fdt_file1}
141 bootm ${loadaddr} - ${fdt_addr}
142 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
143 echo Loaded DTB from ${bootdir}/${fdt_file2}
144 bootm ${loadaddr} - ${fdt_addr}
146 echo "Error loading device-tree"
149 echo "Error loading kernel image"