1 echo "Gateworks Ventana OpenWrt Boot script v1.01"
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 dtype and bootdev by looking for kernel on media the bootloader
13 # has mounted (in order of preference: usb/mmc/sata)
15 # This assumes the bootloader has already started the respective subsystem
16 # or mounted the filesystem if appropriate to get to this bootscript
18 # To Speed up boot set dtype manually
19 if test -n "$dtype" ; then
20 echo "Using dtype from env: $dtype"
22 echo "Detecting boot device (dtype)..."
23 if ${fs}load usb ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
25 elif ${fs}load mmc ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
27 elif ${fs}load sata ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then
29 elif ubifsload ${loadaddr} ${bootdir}/uImage ; then
32 echo "detected dtype:$dtype"
34 if test -n "$bootdev" ; then
35 echo "Using bootdev from env: $bootdev"
37 if itest.s "x${dtype}" == "xmmc" ; then
44 if itest.s "x${dtype}" == "xnand" ; then
45 echo "Booting from NAND..."
47 # OpenWrt kernel bug prevents partition name of 'rootfs' from booting
48 # instead name the partition ubi which is what is looked for by
50 mtdparts del rootfs && mtdparts add nand0 - ubi
51 echo "mtdparts:${mtdparts}"
52 setenv fsload ubifsload
53 setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs"
55 echo "Booting from block device ${bootdev}..."
56 setenv fsload "${fs}load ${dtype} ${disk}:1"
57 setenv root "root=/dev/${bootdev} rootfstype=${fs} rootwait rw"
60 setenv bootargs "${bootargs}" "${root}" "${video}" "${extra}"
61 if ${fsload} ${loadaddr} ${bootdir}/uImage; then
62 if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
63 echo Loaded DTB from ${bootdir}/${fdt_file}
64 test -n "$fixfdt" && run fixfdt
65 bootm ${loadaddr} - ${fdt_addr}
66 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
67 echo Loaded DTB from ${bootdir}/${fdt_file1}
68 test -n "$fixfdt" && run fixfdt
69 bootm ${loadaddr} - ${fdt_addr}
70 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
71 echo Loaded DTB from ${bootdir}/${fdt_file2}
72 test -n "$fixfdt" && run fixfdt
73 bootm ${loadaddr} - ${fdt_addr}
75 echo "Error loading device-tree"
78 echo "Error loading kernel image"