blob: 9a316c74f21552893e775597572530b5ab19823b [file] [log] [blame]
Tom Rini7c329052022-06-13 22:57:37 -04001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2013 Gateworks Corporation
4 */
5
6splashpos=m,m
7splashimage=CONFIG_SYS_LOAD_ADDR
8usb_pgood_delay=2000
9console=ttymxc1
10bootdevs=usb mmc sata flash
11hwconfig=_UNKNOWN_
12
13disk=0
14part=1
15
16fdt_high=0xffffffff
17fdt_addr=0x18000000
18initrd_high=0xffffffff
19fixfdt=fdt addr ${fdt_addr}
20bootdir=boot
21loadfdt=
22 if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
23 echo Loaded DTB from ${bootdir}/${fdt_file};
24 run fixfdt;
25 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
26 echo Loaded DTB from ${bootdir}/${fdt_file1};
27 run fixfdt;
28 elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
29 echo Loaded DTB from ${bootdir}/${fdt_file2};
30 run fixfdt;
31 fi
32
33fs=ext4
34script=6x_bootscript-ventana
35loadscript=
36 if ${fsload} ${loadaddr} ${bootdir}/${script}; then
37 source ${loadaddr};
38 fi
39
40uimage=uImage
41mmc_root=mmcblk0p1
42mmc_boot=
43 setenv fsload "${fs}load mmc ${disk}:${part}";
44 mmc dev ${disk} && mmc rescan &&
45 setenv dtype mmc; run loadscript;
46 if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
47 setenv bootargs console=${console},${baudrate}
48 root=/dev/${mmc_root} rootfstype=${fs}
49 rootwait rw ${video} ${extra};
50 if run loadfdt; then
51 bootm ${loadaddr} - ${fdt_addr};
52 else
53 bootm;
54 fi;
55 fi
56
57sata_boot=
58 setenv fsload "${fs}load sata ${disk}:${part}";
59 sata init &&
60 setenv dtype sata; run loadscript;
61 if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
62 setenv bootargs console=${console},${baudrate}
63 root=/dev/sda1 rootfstype=${fs}
64 rootwait rw ${video} ${extra};
65 if run loadfdt; then
66 bootm ${loadaddr} - ${fdt_addr};
67 else
68 bootm;
69 fi;
70 fi
71
72usb_boot=
73 setenv fsload "${fs}load usb ${disk}:${part}";
74 usb start && usb dev ${disk} &&
75 setenv dtype usb; run loadscript;
76 if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
77 setenv bootargs console=${console},${baudrate}
78 root=/dev/sda1 rootfstype=${fs}
79 rootwait rw ${video} ${extra};
80 if run loadfdt; then
81 bootm ${loadaddr} - ${fdt_addr};
82 else
83 bootm;
84 fi;
85 fi
86
87#ifdef CONFIG_SPI_FLASH
88image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
89image_uboot=ventana/u-boot_spi.imx
90
91spi_koffset=0x90000
92spi_klen=0x200000
93
94spi_updateuboot=echo Updating uboot from
95 ${serverip}:${image_uboot}...;
96 tftpboot ${loadaddr} ${image_uboot} &&
97 sf probe && sf erase 0 80000 &&
98 sf write ${loadaddr} 400 ${filesize}
99spi_update=echo Updating OS from ${serverip}:${image_os}
100 to ${spi_koffset} ...;
101 tftp ${loadaddr} ${image_os} &&
102 sf probe &&
103 sf update ${loadaddr} ${spi_koffset} ${filesize}
104
105flash_boot=
106 if sf probe &&
107 sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
108 setenv bootargs console=${console},${baudrate}
109 root=/dev/mtdblock3
110 rootfstype=squashfs,jffs2
111 ${video} ${extra};
112 bootm;
113 fi
114#else
115image_rootfs=openwrt-imx6-ventana-rootfs.ubi
116nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
117 tftp ${loadaddr} ${image_rootfs} &&
118 nand erase.part rootfs &&
119 nand write ${loadaddr} rootfs ${filesize}
120
121flash_boot=
122 setenv fsload 'ubifsload';
123 ubi part rootfs;
124 if ubi check boot; then
125 ubifsmount ubi0:boot;
126 setenv root ubi0:rootfs ubi.mtd=2
127 rootfstype=squashfs,ubifs;
128 setenv bootdir;
129 elif ubi check rootfs; then
130 ubifsmount ubi0:rootfs;
131 setenv root ubi0:rootfs ubi.mtd=2
132 rootfstype=ubifs;
133 fi;
134 setenv dtype nand; run loadscript;
135 if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
136 setenv bootargs console=${console},${baudrate}
137 root=${root} ${video} ${extra};
138 if run loadfdt; then
139 ubifsumount;
140 bootm ${loadaddr} - ${fdt_addr};
141 else
142 ubifsumount; bootm;
143 fi;
144 fi
145#endif