Author: quozl Date: Mon Nov 14 01:58:24 2011 New Revision: 2682 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2682
Log: OLPC - keep storage LED lit during fs-update and flash, by turning off light sensor
Modified: cpu/arm/olpc/1.75/devices.fth cpu/arm/olpc/1.75/leds.fth cpu/x86/pc/olpc/devices.fth cpu/x86/pc/olpc/via/devices.fth cpu/x86/pc/olpc/via/fsupdate.fth dev/olpc/kb3700/eccmds.fth
Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/arm/olpc/1.75/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -182,12 +182,21 @@ ['] ec-spi-reprogrammed to spi-reprogrammed ; : flash-vulnerable( ( -- ) + ols-off ignore-power-button hdd-led-on ; : )flash-vulnerable ( -- ) hdd-led-off ; +: fs-vulnerable( ( -- ) + ols-off + hdd-led-on +; +: )fs-vulnerable ( -- ) + hdd-led-off + ols-on +;
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
Modified: cpu/arm/olpc/1.75/leds.fth ============================================================================== --- cpu/arm/olpc/1.75/leds.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/arm/olpc/1.75/leds.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -6,11 +6,6 @@ " leds" device-name : open ( -- okay? ) true ; : close ( -- ) ; -: ols-led-on ( -- ) h# 57 ec-cmd ; -: ols-led-off ( -- ) h# 58 ec-cmd ; -: ols-assy-mode-on ( -- ) h# 59 ec-cmd ; -: ols-assy-mode-off ( -- ) h# 5a ec-cmd ; -: ols-led-ec-control ( -- ) h# 5b ec-cmd ;
: selftest ( -- ) ." Flashing LEDs" cr
Modified: cpu/x86/pc/olpc/devices.fth ============================================================================== --- cpu/x86/pc/olpc/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -320,6 +320,8 @@ load-base constant flash-buf : flash-vulnerable( ( -- ) ignore-power-button ; : )flash-vulnerable ( -- ) ; +: fs-vulnerable( ( -- ) ; +: )fs-vulnerable ( -- ) ;
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
Modified: cpu/x86/pc/olpc/via/devices.fth ============================================================================== --- cpu/x86/pc/olpc/via/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/via/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -296,6 +296,12 @@ : )flash-vulnerable ( -- ) hdd-led-off ; +: fs-vulnerable( ( -- ) + hdd-led-on +; +: )fs-vulnerable ( -- ) + hdd-led-off +;
fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming fload ${BP}/cpu/x86/pc/olpc/via/recover.fth \ XO-to-XO SPI FLASH recovery
Modified: cpu/x86/pc/olpc/via/fsupdate.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsupdate.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/via/fsupdate.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -67,7 +67,7 @@ also nand-commands definitions
: zblocks: ( "eblock-size" "#eblocks" ... -- ) - hdd-led-toggle + fs-vulnerable( ?compare-spec-line get-hex# to /nand-block get-hex# to #image-eblocks @@ -90,7 +90,7 @@ \ Asynchronous writes " write-blocks-end" $call-nand ( error? ) " Write error" ?nand-abort - hdd-led-off + )fs-vulnerable release-inflater fexit ;
Modified: dev/olpc/kb3700/eccmds.fth ============================================================================== --- dev/olpc/kb3700/eccmds.fth Fri Nov 11 09:45:01 2011 (r2681) +++ dev/olpc/kb3700/eccmds.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -82,7 +82,21 @@ d# 16 cscount-max ;
-: als@ ( -- w ) h# 56 ec-cmd-w@ ; +: als@ ( -- w ) h# 56 ec-cmd-w@ ; +: ols-led-on ( -- ) h# 57 ec-cmd ; +: ols-led-off ( -- ) h# 58 ec-cmd ; +: ols-assy-mode-on ( -- ) h# 59 ec-cmd ; +: ols-assy-mode-off ( -- ) h# 5a ec-cmd ; +: ols-led-ec-control ( -- ) h# 5b ec-cmd ; +: ols-off + ols-led-on + ols-led-ec-control + ols-assy-mode-on +; +: ols-on + ols-led-ec-control + ols-assy-mode-off +;
: ec-min-pwr ( -- ) h# 5d ec-cmd-w@ w->n ; : ec-max-pwr ( -- ) h# 5e ec-cmd-w@ w->n ;
openfirmware@openfirmware.info