1 if itest.s a$uboot_defconfig == a; then
2 echo "Please set uboot_defconfig to the appropriate value"
10 if itest.s x6SX == "x${cpu}" || itest.s x7D == "x${cpu}"; then
15 setenv stdout serial,vga
18 if load ${dtype} ${disk}:1 ${a_uImage1} u-boot.$uboot_defconfig ; then
20 echo "No U-Boot image found on SD card" ;
23 echo "read $filesize bytes from SD card" ;
24 if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000 ; then
25 echo "probed SPI ROM" ;
27 echo "Error initializing EEPROM" ;
30 if sf read ${a_uImage2} $offset $filesize ; then
32 echo "Error reading boot loader from EEPROM" ;
35 if cmp.b ${a_uImage1} ${a_uImage2} $filesize ; then
36 echo "------- U-Boot versions match" ;
39 echo "Need U-Boot upgrade" ;
40 echo "Program in 5 seconds" ;
41 for n in 5 4 3 2 1 ; do
48 # two steps to prevent bricking
50 setexpr a1 ${a_uImage1} + 0x400
51 setexpr o1 ${offset} + 0x400
52 setexpr s1 ${filesize} - 0x400
53 sf write ${a1} ${o1} ${s1} ;
54 sf write ${a_uImage1} $offset 0x400 ;
57 if sf read ${a_uImage2} $offset $filesize ; then
59 echo "Error re-reading EEPROM" ;
62 if cmp.b ${a_uImage1} ${a_uImage2} $filesize ; then
64 echo "Read verification error" ;
67 while echo "---- U-Boot upgraded. reset" ; do