Author: quozl Date: Thu Jan 27 01:13:35 2011 New Revision: 2153 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2153
Log: Remove machine signature check as it serves no purpose ... flashing wrong file is prevented by the changed crc-offset in addrs.fth. Move unused check-firmware-image into [if].
Modified: dev/olpc/spiflash/spiui.fth
Modified: dev/olpc/spiflash/spiui.fth ============================================================================== --- dev/olpc/spiflash/spiui.fth Thu Jan 27 00:40:25 2011 (r2152) +++ dev/olpc/spiflash/spiui.fth Thu Jan 27 01:13:35 2011 (r2153) @@ -42,14 +42,6 @@
\ Perform a series of sanity checks on the new firmware image.
-: check-firmware-image ( adr len -- adr len ) - dup /flash <> abort" Wrong image length" ( adr len ) - 2dup + h# 40 - ( adr len signature-adr ) - dup " CL1" comp abort" No firmware signature" ( adr len signature-adr ) - ." Firmware: " h# 10 type ( adr len ) - \ XXX add some more sanity checks -; - [ifdef] load-base : flash-buf load-base ; [else] @@ -76,8 +68,7 @@ /flash <> abort" Image file is the wrong length"
." Got firmware version: " - flash-buf h# f.ffc0 + dup h# 10 type cr ( adr ) - " CL1" comp abort" Wrong machine type" + flash-buf h# f.ffc0 + h# 10 type cr
?crc
@@ -282,6 +273,14 @@ h# 100000 /flash-block do (cr i .x i flash-erase-block /flash-block +loop cr ;
+: check-firmware-image ( adr len -- adr len ) + dup /flash <> abort" Wrong image length" ( adr len ) + 2dup + h# 40 - ( adr len signature-adr ) + dup " CL1" comp abort" No firmware signature" ( adr len signature-adr ) + ." Firmware: " h# 10 type ( adr len ) + \ XXX add some more sanity checks +; + : reprogram-firmware ( adr len -- ) check-firmware-image ( adr len ) /flash-block /string ( adr+ len- ) \ Remove EC ucode from the beginning