Author: quozl Date: Mon Jan 31 01:36:17 2011 New Revision: 2159 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2159
Log: Change machine signature check to use a value stored in dictionary instead of SPI FLASH. #10616. Not tested on XO-1.75 A2. Tested on XO-1.5. (Build broken on XO-1 as of 2152, reset-port undefined).
Modified: cpu/arm/olpc/1.75/config.fth cpu/arm/olpc/1.75/olpc.bth cpu/x86/pc/biosload/config-olpc.fth cpu/x86/pc/olpc/config.fth cpu/x86/pc/olpc/olpc.bth cpu/x86/pc/olpc/via/config.fth cpu/x86/pc/olpc/via/olpc.bth dev/olpc/spiflash/spiui.fth
Modified: cpu/arm/olpc/1.75/config.fth ============================================================================== --- cpu/arm/olpc/1.75/config.fth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/arm/olpc/1.75/config.fth Mon Jan 31 01:36:17 2011 (r2159) @@ -6,3 +6,5 @@
fload ${BP}/cpu/arm/olpc/1.75/addrs.fth fload ${BP}/cpu/arm/mmp2/hwaddrs.fth + +create machine-signature ," CL2"
Modified: cpu/arm/olpc/1.75/olpc.bth ============================================================================== --- cpu/arm/olpc/1.75/olpc.bth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/arm/olpc/1.75/olpc.bth Mon Jan 31 01:36:17 2011 (r2159) @@ -182,7 +182,7 @@ /rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank -" CL2" signature swap move +machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q4${FW_MAJOR}" expand$ signature d# 13 + swap move signature h# 10 ofd @ fputs
Modified: cpu/x86/pc/biosload/config-olpc.fth ============================================================================== --- cpu/x86/pc/biosload/config-olpc.fth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/x86/pc/biosload/config-olpc.fth Mon Jan 31 01:36:17 2011 (r2159) @@ -28,6 +28,8 @@ create use-null-nvram create no-floppy-node
+create machine-signature ," CL1" + fload ${BP}/cpu/x86/pc/biosload/addrs.fth
\ LICENSE_BEGIN
Modified: cpu/x86/pc/olpc/config.fth ============================================================================== --- cpu/x86/pc/olpc/config.fth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/x86/pc/olpc/config.fth Mon Jan 31 01:36:17 2011 (r2159) @@ -37,6 +37,8 @@ create use-null-nvram \ Don't store configuration variables \ create use-flash-nvram \ Store configuration variables in firmware FLASH
+create machine-signature ," CL1" + fload ${BP}/cpu/x86/pc/olpc/addrs.fth
\ LICENSE_BEGIN
Modified: cpu/x86/pc/olpc/olpc.bth ============================================================================== --- cpu/x86/pc/olpc/olpc.bth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/x86/pc/olpc/olpc.bth Mon Jan 31 01:36:17 2011 (r2159) @@ -88,7 +88,7 @@ /rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank -" CL1" signature swap move +machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q2${FW_MAJOR}" expand$ signature d# 13 + swap move signature h# 10 ofd @ fputs
Modified: cpu/x86/pc/olpc/via/config.fth ============================================================================== --- cpu/x86/pc/olpc/via/config.fth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/x86/pc/olpc/via/config.fth Mon Jan 31 01:36:17 2011 (r2159) @@ -49,6 +49,8 @@ create use-null-nvram \ Don't store configuration variables \ create use-flash-nvram \ Store configuration variables in firmware FLASH
+create machine-signature ," CL1" + fload ${BP}/cpu/x86/pc/olpc/via/addrs.fth
\ LICENSE_BEGIN
Modified: cpu/x86/pc/olpc/via/olpc.bth ============================================================================== --- cpu/x86/pc/olpc/via/olpc.bth Fri Jan 28 04:00:03 2011 (r2158) +++ cpu/x86/pc/olpc/via/olpc.bth Mon Jan 31 01:36:17 2011 (r2159) @@ -204,7 +204,7 @@ /rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank -" CL1" signature swap move +machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q3${FW_MAJOR}" expand$ signature d# 13 + swap move signature h# 10 ofd @ fputs
Modified: dev/olpc/spiflash/spiui.fth ============================================================================== --- dev/olpc/spiflash/spiui.fth Fri Jan 28 04:00:03 2011 (r2158) +++ dev/olpc/spiflash/spiui.fth Mon Jan 31 01:36:17 2011 (r2159) @@ -69,7 +69,7 @@
." Got firmware version: " flash-buf h# f.ffc0 + dup h# 10 type cr ( adr ) - h# ffff.ffc0 3 comp abort" Wrong machine signature" + machine-signature count comp abort" Wrong machine signature"
?crc
@@ -277,7 +277,7 @@ : check-firmware-image ( adr len -- adr len ) dup /flash <> abort" Wrong image length" ( adr len ) 2dup + h# 40 - ( adr len signature-adr ) - h# ffff.ffc0 3 comp abort" Wrong machine signature" + machine-signature count comp abort" Wrong machine signature" ( adr len signature-adr ) ." Firmware: " h# 10 type ( adr len ) \ XXX add some more sanity checks