Index: host/share/cros_write_firmware/spi.script |
diff --git a/host/share/cros_write_firmware/spi.script b/host/share/cros_write_firmware/spi.script |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6745d092c4b5b28a973f84b8a4e4c5f49d248889 |
--- /dev/null |
+++ b/host/share/cros_write_firmware/spi.script |
@@ -0,0 +1,16 @@ |
+setenv _crc 'crc32 ${address} ${firmware_size}' |
+setenv _init 'echo Initing SPI; sf probe 0' |
+setenv _erase 'echo Erasing SPI; sf erase 0 ${length}' |
+setenv _write 'echo Writing SPI; sf write ${address} 0 ${length}' |
+setenv _clear 'echo Clearing RAM; mw.b ${address} 0 ${length}' |
+setenv _read 'echo Reading SPI; sf read ${address} 0 ${length}' |
+ |
+run _crc |
+run _init |
+run _erase |
+run _write |
+run _clear |
+run _read |
+run _crc |
+ |
+echo If the 2 CRCs above are equal, flash was successful |