Commit 37294bd4 authored by Angus Ainslie's avatar Angus Ainslie
Browse files

scripts/write_flash.sh: add an offest into the flash



The DDR firmware will need to be written somewhere other than offset 0
Signed-off-by: default avatarAngus Ainslie <angus@akkea.ca>
parent d78a8a7d
Pipeline #60636 passed with stages
in 3 minutes and 11 seconds
......@@ -3,11 +3,18 @@
set -e
if [ $# -lt 1 ]; then
echo "Usage: $0 <file>"
echo "\tWrites a file to the NOR flash"
echo "Usage: $0 <file> [offset]"
echo "\tWrites a file to the NOR flash at offset 4096 byte pages."
echo "\tdefault offset is 0."
exit 1
fi
if [ $# -eq 2 ]; then
OFFSET=$2
else
OFFSET=0
fi
cleanup()
{
[ -z "${UUU_SCRIPT}" ] || rm -f "${UUU_SCRIPT}"
......@@ -40,11 +47,11 @@ SDPV: jump
FB: ucmd setenv fastboot_buffer 0x43000000
FB: download -f ${FILE}
FB: ucmd sf probe
FB: ucmd sf erase 0 ${HEX_SIZE}
FB: ucmd sf erase ${OFFSET} ${HEX_SIZE}
FB: delay 2000
FB: ucmd sf write 0x43000000 0 ${HEX_SIZE}
FB: ucmd sf write 0x43000000 ${OFFSET} ${HEX_SIZE}
FB: delay 2000
FB: ucmd sf read 0x44000000 0 ${HEX_SIZE}
FB: ucmd sf read 0x44000000 ${OFFSET} ${HEX_SIZE}
FB: delay 2000
FB: ucmd cmp 0x43000000 0x44000000 ${HEX_WORDS}
FB: Done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment