Author: rsmith Date: Thu Oct 11 00:12:48 2012 New Revision: 3358 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3358
Log: OLPC ARM: Update strp so it gets a valid suspend power reading
Use the ec-sus-pwr command rather than ec-max-pwr for getting the power when the host is in suspend. ec-sus-pwr only takes a reading if the EC thinks the host is in suspend. Even with that a more delay was required for the time spent in suspend than what wake1 was providing. The EC only samples the gauge every 100ms and the gauge itself only updates every 88ms. Wake1 was setting up a 1 second rtc wakeup but by the time the host actually makes it into suspend the EC didn't have enough time left to get a good consistent reading. This patch makes a wake2 with a 2 second target and updates the suspend test to use it.
Modified: cpu/arm/mmp2/rtc.fth cpu/arm/olpc/4.0/ec-version.fth cpu/arm/olpc/suspend.fth
Modified: cpu/arm/mmp2/rtc.fth ============================================================================== --- cpu/arm/mmp2/rtc.fth Wed Oct 10 21:24:16 2012 (r3357) +++ cpu/arm/mmp2/rtc.fth Thu Oct 11 00:12:48 2012 (r3358) @@ -40,13 +40,14 @@ 5 enable-interrupt ( ) ; : wake1 ( -- ) ['] cancel-alarm 1 rtc-wake ; +: wake2 ( -- ) ['] cancel-alarm 2 rtc-wake ; : alarm-in-3 ( -- ) ['] take-alarm 3 rtc-wake ; : wakeup-loop ( -- ) d# 1000000 0 do 0 d# 13 at-xy i .d 5 0 do cr i . - wake1 strp + wake2 strp d# 500 ms key? if unloop unloop exit then loop
Modified: cpu/arm/olpc/4.0/ec-version.fth ============================================================================== --- cpu/arm/olpc/4.0/ec-version.fth Wed Oct 10 21:24:16 2012 (r3357) +++ cpu/arm/olpc/4.0/ec-version.fth Thu Oct 11 00:12:48 2012 (r3358) @@ -1,6 +1,6 @@ \ The EC microcode macro: EC_PLATFORM cl4 -macro: EC_VERSION 7_0_2_02 +macro: EC_VERSION 7_0_2_03
\ Alternate command for getting EC microcode, for testing new versions. \ Temporarily uncomment the line and modify the path as necessary
Modified: cpu/arm/olpc/suspend.fth ============================================================================== --- cpu/arm/olpc/suspend.fth Wed Oct 10 21:24:16 2012 (r3357) +++ cpu/arm/olpc/suspend.fth Thu Oct 11 00:12:48 2012 (r3358) @@ -215,4 +215,4 @@ platform-on ;
-: strp ( -- ) ec-rst-pwr str ec-max-pwr .d ." mW " soc .% space ; +: strp ( -- ) ec-rst-pwr str ec-sus-pwr .d ." mW " soc .% space ;