Author: rsmith Date: Wed Jun 15 07:36:02 2011 New Revision: 2281 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2281
Log: XO-1 Add bat_reset support
Needs special EC code
Modified: dev/olpc/kb3700/battery.fth
Modified: dev/olpc/kb3700/battery.fth ============================================================================== --- dev/olpc/kb3700/battery.fth Wed Jun 15 07:35:59 2011 (r2280) +++ dev/olpc/kb3700/battery.fth Wed Jun 15 07:36:02 2011 (r2281) @@ -7,10 +7,15 @@ [then]
\ Names try to match the variable names in EC code + +h# F780 constant ec-bProcessOneWireIndex +h# F7CF constant ec-bHDQ_ACCESS_FLAG2 + h# FA00 constant ec-rambase h# 01 constant ec-pwr_limit h# 09 constant ec-va2 h# 20 constant ec-platformID +h# A5 constant ec-mBAT_STATUS
h# FC00 constant ec-gpiobase h# 00 constant ec-gpiofs00 @@ -523,6 +528,14 @@ drop ;
+\ Instruct the EC to completely reset the battery +\ subsystem. (XO-1 F series EC code) + +: (bat-reset) ( -- ) + 1 ec-bHDQ_ACCESS_FLAG2 ec! + 4 ec-bProcessOneWireIndex ec! +; + : bat-set-default-status ( val -- ) ds-bank0 1w-recall ds-default-status 1w-write-start @@ -712,6 +725,12 @@ bat-disable-charge ;
+: bat-reset + batman-init? + (bat-reset) + batman-stop +; + fload ${BP}/dev/olpc/kb3700/batstat.fth
\ LICENSE_BEGIN