2009-10-28 13:41:54 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /env/config
|
|
|
|
|
|
|
|
if [ x$1 = xnand ]; then
|
2009-12-15 08:11:09 +00:00
|
|
|
part=/dev/nand0.barebox
|
2009-10-28 13:41:54 +00:00
|
|
|
elif [ x$1 = xnor ]; then
|
2009-12-15 08:11:09 +00:00
|
|
|
part=/dev/nor0.barebox
|
2009-10-28 13:41:54 +00:00
|
|
|
else
|
|
|
|
echo "usage: $0 nor|nand"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2009-12-15 08:11:09 +00:00
|
|
|
loadb -f barebox.bin -c
|
2009-10-28 13:41:54 +00:00
|
|
|
|
|
|
|
unprotect $part
|
|
|
|
echo
|
|
|
|
echo "erasing partition $part"
|
|
|
|
erase $part
|
|
|
|
|
|
|
|
echo
|
2009-12-15 08:11:09 +00:00
|
|
|
echo "flashing barebox.bin to $part"
|
2009-10-28 13:41:54 +00:00
|
|
|
echo
|
2009-12-15 08:11:09 +00:00
|
|
|
cp barebox.bin $part
|
|
|
|
crc32 -f barebox.bin
|
2009-10-28 13:41:54 +00:00
|
|
|
crc32 -f $part
|