kumquat-buildroot/board/boundarydevices/nitrogen6x/6x_upgrade.txt
Gary Bisson 9ebb123893 board/boundarydevices: update u-boot scripts for 3.14 kernels
Those scripts will support coming platforms such as iMX6SoloX or
iMX6QuadPlus.

One important change is that the bootscript now relies on U-Boot to
make the display detection in order to simplify the script.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-09-19 15:41:13 +02:00

70 lines
1.5 KiB
Plaintext

if itest.s a$uboot_defconfig == a; then
echo "Please set uboot_defconfig to the appropriate value"
exit
fi
offset=0x400
a_uImage1=0x12000000
a_uImage2=0x12400000
if itest.s x6SX == "x$cpu" ; then
a_uImage1=0x82000000
a_uImage2=0x82400000
fi
setenv stdout serial,vga
echo "check U-Boot" ;
if load ${dtype} ${disk}:1 ${a_uImage1} u-boot.$uboot_defconfig ; then
else
echo "No U-Boot image found on SD card" ;
exit
fi
echo "read $filesize bytes from SD card" ;
if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000 ; then
echo "probed SPI ROM" ;
else
echo "Error initializing EEPROM" ;
exit
fi ;
if sf read ${a_uImage2} $offset $filesize ; then
else
echo "Error reading boot loader from EEPROM" ;
exit
fi
if cmp.b ${a_uImage1} ${a_uImage2} $filesize ; then
echo "------- U-Boot versions match" ;
exit
fi
echo "Need U-Boot upgrade" ;
echo "Program in 5 seconds" ;
for n in 5 4 3 2 1 ; do
echo $n ;
sleep 1 ;
done
echo "erasing" ;
sf erase 0 0xC0000 ;
# two steps to prevent bricking
echo "programming" ;
setexpr a1 ${a_uImage1} + 0x400
setexpr o1 ${offset} + 0x400
setexpr s1 ${filesize} - 0x400
sf write ${a1} ${o1} ${s1} ;
sf write ${a_uImage1} $offset 0x400 ;
echo "verifying" ;
if sf read ${a_uImage2} $offset $filesize ; then
else
echo "Error re-reading EEPROM" ;
exit
fi
if cmp.b ${a_uImage1} ${a_uImage2} $filesize ; then
else
echo "Read verification error" ;
exit
fi
while echo "---- U-Boot upgraded. reset" ; do
sleep 120
done