1
setenv stdout serial,vga
4
if ${fs}load ${dtype} ${disk}:1 12000000 u-boot.imx || ${fs}load ${dtype} ${disk}:1 12000000 u-boot.nopadding ; then
5
echo "read $filesize bytes from SD card" ;
6
if sf probe || sf probe || \
7
sf probe 1 27000000 || sf probe 1 27000000 ; then
8
echo "probed SPI ROM" ;
9
if sf read 0x12400000 $offset $filesize ; then
10
if cmp.b 0x12000000 0x12400000 $filesize ; then
11
echo "------- U-Boot versions match" ;
13
echo "Need U-Boot upgrade" ;
14
echo "Program in 5 seconds" ;
15
for n in 5 4 3 2 1 ; do
21
# two steps to prevent bricking
23
sf write 0x12000000 $offset $filesize ;
25
if sf read 0x12400000 $offset $filesize ; then
26
if cmp.b 0x12000000 0x12400000 $filesize ; then
27
while echo "---- U-Boot upgraded. reset" ; do
31
echo "Read verification error" ;
34
echo "Error re-reading EEPROM" ;
38
echo "Error reading boot loader from EEPROM" ;
41
echo "Error initializing EEPROM" ;
44
echo "No U-Boot image found on SD card" ;