Author: wmb Date: Fri Jul 13 03:33:40 2012 New Revision: 3064 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3064
Log: OLPC - parameterize the location of the signature string in the FLASH, now that we must deal with different FLASH sizes.
Modified: cpu/arm/olpc/1.75/config.fth cpu/arm/olpc/1.75/keyject.bth cpu/arm/olpc/1.75/olpc.bth cpu/arm/olpc/3.0/config.fth cpu/arm/olpc/3.0/olpc.bth cpu/arm/olpc/build-fw.fth cpu/arm/olpc/cl4/config.fth cpu/arm/olpc/cl4/olpc.bth cpu/x86/pc/olpc/addrs.fth cpu/x86/pc/olpc/keyject.bth cpu/x86/pc/olpc/olpc.bth cpu/x86/pc/olpc/via/addrs.fth cpu/x86/pc/olpc/via/keyject.bth 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 Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/1.75/config.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -17,6 +17,7 @@ h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH h# f.ffd8 constant crc-offset +h# f.ffc0 constant signature-offset
h# 10.0000 constant /rom \ Total size of SPI FLASH
Modified: cpu/arm/olpc/1.75/keyject.bth ============================================================================== --- cpu/arm/olpc/1.75/keyject.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/1.75/keyject.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -167,12 +167,12 @@ /rom pad-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank signature$ signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf
Modified: cpu/arm/olpc/1.75/olpc.bth ============================================================================== --- cpu/arm/olpc/1.75/olpc.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/1.75/olpc.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -159,12 +159,12 @@ /rom pad-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank signature$ signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf
Modified: cpu/arm/olpc/3.0/config.fth ============================================================================== --- cpu/arm/olpc/3.0/config.fth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/3.0/config.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -16,6 +16,7 @@ h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH h# f.ffd8 constant crc-offset +h# f.ffc0 constant signature-offset
h# 10.0000 constant /rom \ Total size of SPI FLASH
Modified: cpu/arm/olpc/3.0/olpc.bth ============================================================================== --- cpu/arm/olpc/3.0/olpc.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/3.0/olpc.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -162,12 +162,12 @@ /rom pad-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank signature$ signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf
Modified: cpu/arm/olpc/build-fw.fth ============================================================================== --- cpu/arm/olpc/build-fw.fth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/build-fw.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -327,7 +327,7 @@ dend
" /openprom" find-device - flash-open pad d# 16 2dup h# fffc0 flash-read ( adr len ) + flash-open pad d# 16 2dup signature-offset flash-read ( adr len ) " model" string-property
" sourceurl" find-drop-in if " source-url" string-property then
Modified: cpu/arm/olpc/cl4/config.fth ============================================================================== --- cpu/arm/olpc/cl4/config.fth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/cl4/config.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -11,8 +11,9 @@ fload ${BP}/cpu/arm/olpc/addrs.fth
h# 1f.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH -h# 10.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH -h# 1e.ffd8 constant crc-offset +h# 20.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH +h# 1e.ffd0 constant crc-offset +h# 1e.ffc0 constant signature-offset
h# 20.0000 constant /rom \ Total size of SPI FLASH
Modified: cpu/arm/olpc/cl4/olpc.bth ============================================================================== --- cpu/arm/olpc/cl4/olpc.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/arm/olpc/cl4/olpc.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -163,18 +163,18 @@ /rom pad-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank signature$ signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf /rom buffer: filebuf
-\ Read the entire image, compute the CRC, and store it h# 28 from the end +\ Read the entire image, compute the CRC, and store it in the CRC location 0 ofd @ fseek filebuf /rom ofd @ fgets /rom <> abort" Can't read back image" 0 crctab filebuf /rom ($crc) crcbuf !
Modified: cpu/x86/pc/olpc/addrs.fth ============================================================================== --- cpu/x86/pc/olpc/addrs.fth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/addrs.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -78,6 +78,7 @@ h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH h# f.ffd0 constant crc-offset +h# f.ffc0 constant signature-offset
fload ${BP}/cpu/x86/pc/virtaddr.fth [ifndef] virtual-mode
Modified: cpu/x86/pc/olpc/keyject.bth ============================================================================== --- cpu/x86/pc/olpc/keyject.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/keyject.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -115,12 +115,12 @@ " rmstart.img" $add-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q2${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf
Modified: cpu/x86/pc/olpc/olpc.bth ============================================================================== --- cpu/x86/pc/olpc/olpc.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/olpc.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -107,12 +107,12 @@ " rmstart.img" $add-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q2${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
/l buffer: crcbuf
Modified: cpu/x86/pc/olpc/via/addrs.fth ============================================================================== --- cpu/x86/pc/olpc/via/addrs.fth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/via/addrs.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -111,6 +111,7 @@ h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH h# f.ffd4 constant crc-offset +h# f.ffc0 constant signature-offset
fload ${BP}/cpu/x86/pc/virtaddr.fth
Modified: cpu/x86/pc/olpc/via/keyject.bth ============================================================================== --- cpu/x86/pc/olpc/via/keyject.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/via/keyject.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -212,12 +212,12 @@ " rmstart.img" $add-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q3${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
create sipbuf
Modified: cpu/x86/pc/olpc/via/olpc.bth ============================================================================== --- cpu/x86/pc/olpc/via/olpc.bth Fri Jul 13 02:59:46 2012 (r3063) +++ cpu/x86/pc/olpc/via/olpc.bth Fri Jul 13 03:33:40 2012 (r3064) @@ -204,12 +204,12 @@ " rmstart.img" $add-file
\ Insert the revision signature -/rom h# 40 - ofd @ fseek h# 10 buffer: signature signature h# 10 blank machine-signature count signature swap move " ${FW_VERSION}" expand$ signature 6 + swap move " Q3${FW_MAJOR}" expand$ signature d# 13 + swap move +signature-offset ofd @ fseek signature h# 10 ofd @ fputs
create sipbuf
Modified: dev/olpc/spiflash/spiui.fth ============================================================================== --- dev/olpc/spiflash/spiui.fth Fri Jul 13 02:59:46 2012 (r3063) +++ dev/olpc/spiflash/spiui.fth Fri Jul 13 03:33:40 2012 (r3064) @@ -73,7 +73,7 @@ /flash <> abort" Image file is the wrong length"
." Got firmware version: " - flash-buf h# f.ffc0 + dup h# 10 type cr ( adr ) + flash-buf signature-offset + dup h# 10 type cr ( adr ) signature$ comp abort" Wrong machine signature"
?crc
openfirmware@openfirmware.info