Author: quozl Date: Thu Oct 11 02:55:36 2012 New Revision: 3359 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3359
Log: OLPC - make SPI and EC flash animation scale calculation at run time, tested on XO-4
Modified: cpu/arm/olpc/1.75/config-a1.fth cpu/arm/olpc/1.75/config.fth cpu/arm/olpc/3.0/config.fth cpu/arm/olpc/4.0/config.fth cpu/arm/olpc/cl4/config.fth cpu/arm/olpc/edi.fth dev/olpc/spiflash/spiflash.fth dev/olpc/spiflash/spiui.fth
Modified: cpu/arm/olpc/1.75/config-a1.fth ============================================================================== --- cpu/arm/olpc/1.75/config-a1.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/1.75/config-a1.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -30,7 +30,6 @@
char 3 constant expected-ec-version h# 10000 constant /ec-flash -d# 1 constant ec-scale
h# 10000 constant l2-#sets
Modified: cpu/arm/olpc/1.75/config.fth ============================================================================== --- cpu/arm/olpc/1.75/config.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/1.75/config.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -32,7 +32,6 @@
char 4 constant expected-ec-version h# 8000 constant /ec-flash -d# 0 constant ec-scale h# 7e80 constant ec-flags-offset \ don't program or verify this page
\ These constants are correct for XO-1.75 and XO-CL4; they might
Modified: cpu/arm/olpc/3.0/config.fth ============================================================================== --- cpu/arm/olpc/3.0/config.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/3.0/config.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -31,7 +31,6 @@
char 4 constant expected-ec-version h# 8000 constant /ec-flash -d# 0 constant ec-scale
h# 18000 constant console-uart-base
Modified: cpu/arm/olpc/4.0/config.fth ============================================================================== --- cpu/arm/olpc/4.0/config.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/4.0/config.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -29,7 +29,6 @@
char 7 constant expected-ec-version h# ec00 constant /ec-flash -d# 1 constant ec-scale h# eb80 constant ec-flags-offset \ don't program or verify this page
fload ${BP}/cpu/arm/olpc/cl4/gpiopins.fth
Modified: cpu/arm/olpc/cl4/config.fth ============================================================================== --- cpu/arm/olpc/cl4/config.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/cl4/config.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -28,7 +28,6 @@
char 7 constant expected-ec-version h# ec00 constant /ec-flash -d# 1 constant ec-scale h# eb80 constant ec-flags-offset \ don't program or verify this page
fload ${BP}/cpu/arm/olpc/cl4/gpiopins.fth
Modified: cpu/arm/olpc/edi.fth ============================================================================== --- cpu/arm/olpc/edi.fth Thu Oct 11 00:12:48 2012 (r3358) +++ cpu/arm/olpc/edi.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -195,6 +195,11 @@ wait-flash-busy ( ) ;
+: .edi-progress ( n -- ) + /ec-flash h# 8000 > if 1 else 0 then rshift ( dot# ) + edi-progress ( ) +; + : edi-program-flash ( adr len offset -- ) cr ( adr len offset ) swap 0 ?do ( adr offset ) @@ -203,7 +208,7 @@ dup i + erase-page ( adr offset ) over i + over i + edi-program-page ( adr offset ) then ( adr offset ) - i ec-scale rshift edi-progress ( adr offset ) + i .edi-progress ( adr offset ) /flash-page +loop ( adr offset ) 2drop ( ) ;
Modified: dev/olpc/spiflash/spiflash.fth ============================================================================== --- dev/olpc/spiflash/spiflash.fth Thu Oct 11 00:12:48 2012 (r3358) +++ dev/olpc/spiflash/spiflash.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -297,9 +297,8 @@ \ those commands. The AB command seems to be supported by all \ of them, so it's a good starting point.
-0 value flash-scale -: 2mb-flash ( -- ) h# 20.0000 to /flash 6 to flash-scale ; -: 1mb-flash ( -- ) h# 10.0000 to /flash 5 to flash-scale ; +: 2mb-flash ( -- ) h# 20.0000 to /flash ; +: 1mb-flash ( -- ) h# 10.0000 to /flash ;
0 value spi-id# : spi-identify ( -- )
Modified: dev/olpc/spiflash/spiui.fth ============================================================================== --- dev/olpc/spiflash/spiui.fth Thu Oct 11 00:12:48 2012 (r3358) +++ dev/olpc/spiflash/spiui.fth Thu Oct 11 02:55:36 2012 (r3359) @@ -11,7 +11,8 @@ defer spi-progress ' drop to spi-progress ( n -- )
: .progress ( offset -- ) - flash-scale rshift dup spi-progress h# 400 + spi-progress + /flash h# 10.0000 > if 6 else 5 then rshift ( dot# ) + dup spi-progress h# 400 + spi-progress ( ) ;
: write-flash-range ( adr end-offset start-offset -- )