Skip to content
Snippets Groups Projects
Commit 61b94fb7 authored by Troy Kisky's avatar Troy Kisky
Browse files

bootscripts: net_upgradeu: add imx8m support

parent 113b20a0
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ offset=0x400 ...@@ -15,6 +15,7 @@ offset=0x400
erase_size=0xC0000 erase_size=0xC0000
qspi_offset=0x0 qspi_offset=0x0
a_base=0x10100000 a_base=0x10100000
block_size=0x200
if itest.s x51 == "x${imx_cpu}"; then if itest.s x51 == "x${imx_cpu}"; then
a_base=0x90100000 a_base=0x90100000
...@@ -22,6 +23,9 @@ elif itest.s x53 == "x${imx_cpu}"; then ...@@ -22,6 +23,9 @@ elif itest.s x53 == "x${imx_cpu}"; then
a_base=0x70100000 a_base=0x70100000
elif itest.s x6SX == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then elif itest.s x6SX == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then
a_base=0x80100000 a_base=0x80100000
elif itest.s x8MQ == "x${imx_cpu}"; then
a_base=0x42000000
offset=0x8400
fi fi
qspi_match=1 qspi_match=1
...@@ -33,6 +37,54 @@ setexpr a_script ${a_base} ...@@ -33,6 +37,54 @@ setexpr a_script ${a_base}
setenv stdout serial,vga setenv stdout serial,vga
if itest.s "x${sfname}" == "x" ; then
# U-Boot resides in (e)MMC
if itest.s "x${env_dev}" == "x" || itest.s "x${env_part}" == "x"; then
echo "Please set env_dev/part to the appropriate values"
exit
fi
# Load bootloader binary for this board
if tftp ${a_uImage1} u-boot.${uboot_defconfig} ; then
else
echo "File u-boot.${uboot_defconfig} not found on TFTP server" ;
exit
fi
# Compute block count for filesize and offset
setexpr cntoffset ${offset} / ${block_size}
setexpr cntfile ${filesize} / ${block_size}
# Add 1 in case the $filesize is not a multiple of $block_size
setexpr cntfile ${cntfile} + 1
# Select media partition (if different from main partition)
mmc dev ${env_dev} ${env_part}
# Read and compare current U-Boot
mmc read ${a_uImage2} ${cntoffset} ${cntfile}
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
mmc write ${a_uImage1} ${cntoffset} ${cntfile}
# Make sure to boot from the proper partition
if itest ${env_part} != 0 ; then
mmc partconf ${env_dev} 1 ${env_part} 0
fi
# Switch back to main eMMC partition (to avoid confusion)
mmc dev ${env_dev}
else
# U-Boot resides in NOR flash
if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000 ; then if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000 ; then
echo "probed SPI ROM" ; echo "probed SPI ROM" ;
else else
...@@ -161,6 +213,7 @@ if itest.s "x" != "x${next}" ; then ...@@ -161,6 +213,7 @@ if itest.s "x" != "x${next}" ; then
echo "${next} not found" echo "${next} not found"
fi fi
fi fi
fi
echo "---- U-Boot upgraded. resetting" echo "---- U-Boot upgraded. resetting"
sleep 2 sleep 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment