blob: b87b7e5801ef9283a3237564830a63e0b07709ed [file] [log] [blame]
Lukasz Majewski678cfb62024-01-15 14:51:28 +01001bootmode=update
2bootpri=mmc_mmc
3bootsec=sf_swu
4consdev=ttyAMA0
5baudrate=115200
6dtbfile=imx28-xea.dtb
7rootdev=/dev/mmcblk0p2
8netdev=eth0
9swufile=swupdate-image-xea-upd.itb
10sf_kernel_offset=0xA0000
11sf_swu_size=0xF40000
12ethact=FEC
13arch=xea
14lwe_env=
15 if dhcp ${loadaddr} ${hostname}/${lwe_uenv} ; then
16 source ${loadaddr};
17 fi
18lwe_uenv=env_uboot_xea.bin
19do_update_mmc=
20 if mmc rescan ; then
21 mmc dev 0 ${update_mmc_part} ;
22 if dhcp ${hostname}/${update_filename} ; then
23 setexpr fw_sz ${filesize} / 0x200 ;
24 setexpr fw_sz ${fw_sz} + 1 ;
25 mmc write ${loadaddr} ${update_offset} ${fw_sz} ;
26 fi ;
27 fi
28do_update_sf=
29 if sf probe ; then
30 if dhcp ${hostname}/${update_filename} ; then
31 sf erase ${update_offset} +${filesize} ;
32 sf write ${loadaddr} ${update_offset} ${filesize} ;
33 fi ;
34 fi
35factory_reset=
36 if sf probe ; then
37 run update_swu ;
38 setenv bootmode update ;
39 saveenv ;
40 fi
41update_spl_filename=u-boot.sb
42update_spl=
43 setenv update_filename ${update_spl_filename} ;
44 setenv update_offset 0 ;
45 run do_update_sf
46update_uboot_filename=u-boot.img
47update_uboot=
48 setenv update_filename ${update_uboot_filename} ;
49 setenv update_offset 0x10000 ;
50 run do_update_sf ;
51 setenv update_mmc_part 1 ;
52 setenv update_offset 0 ;
53 run do_update_mmc ;
54 setenv update_mmc_part 2 ;
55 run do_update_mmc
56update_kernel_filename=uImage
57update_kernel=
58 setenv update_mmc_part 1 ;
59 setenv update_filename ${update_kernel_filename} ;
60 setenv update_offset 0x800 ;
61 run do_update_mmc ;
62 setenv update_filename ${dtbfile} ;
63 setenv update_offset 0x400 ;
64 run do_update_mmc
65update_swu=
66 setenv update_filename ${swufile} ;
67 setenv update_offset ${sf_kernel_offset} ;
68 run do_update_sf
69addcons=
70 setenv bootargs ${bootargs}
71 console=${consdev},${baudrate}
72addip=
73 setenv bootargs ${bootargs}
74 ip=${ipaddr}:${serverip}:${gatewayip}:
75 ${netmask}:${hostname}:${netdev}:off
76addmisc=
77 setenv bootargs ${bootargs} ${miscargs}
78addargs=run addcons addmisc
79mmcload=
80 mmc rescan ;
81 mmc dev 0 1 ;
82 mmc read ${loadaddr} 0x800 0x2000 ;
83 mmc read ${dtbaddr} 0x400 0x80
84netload=
85 dhcp ${loadaddr} ${hostname}/${bootfile} ;
86 tftp ${dtbaddr} ${hostname}/${dtbfile}
87usbload=
88 usb start ;
89 load usb 0:1 ${loadaddr} ${bootfile}
90miscargs=panic=1
91mmcargs=setenv bootargs root=${rootdev} rw rootwait
92nfsargs=
93 setenv bootargs root=/dev/nfs rw
94 nfsroot=${serverip}:${rootpath},v3,tcp
95mmc_mmc=
96 if run mmcload mmcargs addargs ; then
97 bootm ${loadaddr} - ${dtbaddr} ;
98 fi
99mmc_nfs=
100 if run mmcload nfsargs addip addargs ; then
101 bootm ${loadaddr} - ${dtbaddr} ;
102 fi
103sf_mmc=
104 if run sfload mmcargs addargs ; then
105 bootm ${loadaddr} - ${dtbaddr} ;
106 fi
107sf_swu=
108 if sf probe ; then
109 sf read ${loadaddr} ${sf_kernel_offset} ${sf_swu_size} ;
110 setenv bootargs root=/dev/ram0 rw ;
111 run addargs ;
112 bootm ${loadaddr} ;
113 fi
114net_mmc=
115 if run netload mmcargs addargs ; then
116 bootm ${loadaddr} - ${dtbaddr} ;
117 fi
118net_nfs=
119 if run netload nfsargs addip addargs ; then
120 bootm ${loadaddr} - ${dtbaddr} ;
121 fi
122prebootcmd=
123 if test ${envsaved} != y ; then ;
124 setenv envsaved y ;
125 saveenv ;
126 fi ;
127 if test ${bootmode} = normal ; then
128 setenv bootdelay 0 ;
129 setenv bootpri mmc_mmc ;
130 elif test ${bootmode} = devel ; then
131 setenv bootdelay 3 ;
132 setenv bootpri net_mmc ;
133 else
134 if test ${bootmode} != update ; then
135 echo Warning: unknown bootmode ${bootmode} ;
136 fi ;
137 setenv bootdelay 1 ;
138 setenv bootpri sf_swu ;
139 fi