Author: quozl Date: Wed Aug 31 07:35:10 2011 New Revision: 2488 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2488
Log: OLPC XO-1.5 XO-1.75 - move storage LED manipulation to fw.bth for XO-1.5 and XO-1.75, use storage LED when writing to EC or OpenFirmware FLASH, show a display indicator of EC automatic reflash, fixes #11117. The indicator is on the bottom left of display, and is a green laptop followed by three grey dots as an ellipsis ... no progress reported to display, only to serial port.
Modified: cpu/arm/olpc/1.75/devices.fth cpu/arm/olpc/1.75/ecflash.fth cpu/arm/olpc/1.75/fw.bth cpu/arm/olpc/1.75/leds.fth cpu/x86/pc/olpc/gui.fth cpu/x86/pc/olpc/via/fw.bth cpu/x86/pc/olpc/via/leds.fth dev/olpc/spiflash/spiui.fth
Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/arm/olpc/1.75/devices.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -179,6 +179,10 @@
false constant tethered? \ We only support reprogramming our own FLASH
+: hdd-led-off ( -- ) d# 10 gpio-clr ; +: hdd-led-on ( -- ) d# 10 gpio-set ; +: hdd-led-toggle ( -- ) d# 10 gpio-pin@ if hdd-led-off else hdd-led-on then ; + fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming \ fload ${BP}/dev/olpc/spiflash/recover.fth \ XO-to-XO SPI FLASH recovery : ofw-fw-filename$ " disk:\boot\olpc.rom" ;
Modified: cpu/arm/olpc/1.75/ecflash.fth ============================================================================== --- cpu/arm/olpc/1.75/ecflash.fth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/arm/olpc/1.75/ecflash.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -37,6 +37,7 @@ \ Tells the EC to auto-restart after power cycling : set-ec-reboot ( -- ) 1 h# f018 edi-b! ; : reflash-ec + hdd-led-on [ifdef] cl2-a1 " enter-updater" $call-ec ." Erasing ..." cr " erase-flash" $call-ec cr @@ -53,6 +54,7 @@ load-base load-base /ec-flash + /ec-flash comp abort" Miscompare!" cr + hdd-led-off [ifndef] cl2-a1 ." Restarting EC and rebooting" cr d# 2000 ms @@ -92,7 +94,8 @@ bl left-parse-string 2nip ( version$ ) ec-name$ $caps-compare 0<= ( flag ) ; -: ?update-ec-flash ( -- ) + +: update-ec-flash ( -- ) " ecimage.bin" find-drop-in if ( adr len ) 2dup ec-up-to-date? if ( adr len ) free-mem ( ) @@ -110,6 +113,13 @@ then ;
+: update-ec-flash? ( -- flag ) + " ecimage.bin" find-drop-in if ( adr len ) + 2dup ec-up-to-date? 0= ( adr len flag ) + >r free-mem r> ( flag ) + then +; + \ LICENSE_BEGIN \ Copyright (c) 2010 FirmWorks \
Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/arm/olpc/1.75/fw.bth Wed Aug 31 07:35:10 2011 (r2488) @@ -333,10 +333,6 @@ fload ${BP}/cpu/x86/pc/olpc/via/nbrx.fth fload ${BP}/cpu/x86/pc/olpc/via/blockfifo.fth
-: hdd-led-off ( -- ) d# 10 gpio-clr ; -: hdd-led-on ( -- ) d# 10 gpio-set ; -: hdd-led-toggle ( -- ) d# 10 gpio-pin@ if hdd-led-off else hdd-led-on then ; - alias fast-hash crypto-hash \ fast-hash uses acceleration when available fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth @@ -478,7 +474,7 @@
show-child
- ?update-ec-flash + update-ec-flash? if show-reflash update-ec-flash then
install-alarm ?sound
Modified: cpu/arm/olpc/1.75/leds.fth ============================================================================== --- cpu/arm/olpc/1.75/leds.fth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/arm/olpc/1.75/leds.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -6,8 +6,6 @@ " leds" device-name : open ( -- okay? ) true ; : close ( -- ) ; -: hdd-led-on ( -- ) d# 10 gpio-set ; -: hdd-led-off ( -- ) d# 10 gpio-clr ; : ols-led-on ( -- ) h# 57 ec-cmd ; : ols-led-off ( -- ) h# 58 ec-cmd ; : ols-assy-mode-on ( -- ) h# 59 ec-cmd ;
Modified: cpu/x86/pc/olpc/gui.fth ============================================================================== --- cpu/x86/pc/olpc/gui.fth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/x86/pc/olpc/gui.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -373,6 +373,12 @@ d# 588 d# 638 to icon-xy " bigdot" show-icon " vga?" $call-screen 0= if dcon-unfreeze dcon-freeze then ; + +: show-reflash ( -- ) \ bottom left corner, laptop and ellipsis + d# 0 d# 810 to icon-xy " int" show-icon + d# 450 d# 150 do i d# 844 to icon-xy " bigdot" show-icon d# 100 +loop +; + : show-x ( -- ) " x" show-icon ; : show-sad ( -- ) icon-xy
Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/x86/pc/olpc/via/fw.bth Wed Aug 31 07:35:10 2011 (r2488) @@ -110,6 +110,13 @@
fload ${BP}/cpu/x86/acpiio.fth \ ACPI register access
+: hdd-led@ h# 4c acpi-l@ ; +: hdd-led! h# 4c acpi-l! ; +h# 400000 constant hdd-led +: hdd-led-toggle ( -- ) hdd-led@ hdd-led xor hdd-led! ; +: hdd-led-off ( -- ) hdd-led@ hdd-led or hdd-led! ; +: hdd-led-on ( -- ) hdd-led@ hdd-led invert and hdd-led! ; + fload ${BP}/cpu/x86/pc/olpc/via/probemem.fth \ Memory probing
[ifdef] virtual-mode @@ -496,8 +503,7 @@ fload ${BP}/cpu/x86/pc/olpc/via/nbtx.fth fload ${BP}/cpu/x86/pc/olpc/via/nbrx.fth fload ${BP}/cpu/x86/pc/olpc/via/blockfifo.fth -: hdd-led-toggle ( -- ) h# 4c acpi-l@ h# 400000 xor h# 4c acpi-l! ; -: hdd-led-off ( -- ) h# 4c acpi-l@ h# 400000 or h# 4c acpi-l! ; + : fast-hash ( adr len hashname$ -- ) 2dup " sha256" $= if ( eblock# hashname$ r: hash$ ) 2drop sha-256 ( eblock# calc-hash$ r: hash$ )
Modified: cpu/x86/pc/olpc/via/leds.fth ============================================================================== --- cpu/x86/pc/olpc/via/leds.fth Wed Aug 31 03:12:52 2011 (r2487) +++ cpu/x86/pc/olpc/via/leds.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -6,10 +6,6 @@ " leds" device-name : open ( -- okay? ) true ; : close ( -- ) ; -: gpio-lo ( mask -- ) h# 4c acpi-l@ swap invert and h# 4c acpi-l! ; -: gpio-hi ( mask -- ) h# 4c acpi-l@ swap or h# 4c acpi-l! ; -: hdd-led-on ( -- ) h# 400000 gpio-lo ; -: hdd-led-off ( -- ) h# 400000 gpio-hi ; : selftest ( -- ) ." Flashing LEDs" cr " /wlan" test-dev " /wlan" test-dev \ Twice for longer flashing
Modified: dev/olpc/spiflash/spiui.fth ============================================================================== --- dev/olpc/spiflash/spiui.fth Wed Aug 31 03:12:52 2011 (r2487) +++ dev/olpc/spiflash/spiui.fth Wed Aug 31 07:35:10 2011 (r2488) @@ -192,6 +192,7 @@ ;
: reflash ( -- ) \ Flash from data already in memory + hdd-led-on ?file flash-write-enable
@@ -208,6 +209,7 @@ else .verify-msg then + hdd-led-off ;
defer fw-filename$ ' null$ to fw-filename$
openfirmware@openfirmware.info