Author: wmb Date: Fri Sep 16 02:43:04 2011 New Revision: 2514 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2514
Log: OLPC XO-1.75 - Better management of ACK line to EC when not ready to receive events.
Modified: dev/olpc/kb3700/eccmds.fth dev/olpc/kb3700/spicmd.fth
Modified: dev/olpc/kb3700/eccmds.fth ============================================================================== --- dev/olpc/kb3700/eccmds.fth Fri Sep 16 02:41:48 2011 (r2513) +++ dev/olpc/kb3700/eccmds.fth Fri Sep 16 02:43:04 2011 (r2514) @@ -9,8 +9,14 @@ : do-ec-cmd-buf ( [ args ] #args #results cmd-code -- buf-adr ) " ec-command-buf" $call-ec ; +: open-ec ( -- ) + ec-ih 0= if " /ec-spi" open-dev to ec-ih then +; +: close-ec ( -- ) + ec-ih if ec-ih close-dev 0 to ec-ih then +; stand-init: EC - " /ec-spi" open-dev to ec-ih + open-ec ;
: too-many-retries ( -- ) true abort" Too many EC command retries" ;
Modified: dev/olpc/kb3700/spicmd.fth ============================================================================== --- dev/olpc/kb3700/spicmd.fth Fri Sep 16 02:41:48 2011 (r2513) +++ dev/olpc/kb3700/spicmd.fth Fri Sep 16 02:43:04 2011 (r2514) @@ -331,6 +331,7 @@ true ; : close ( -- ) + set-ack open-count 1 = if ssp-base h# 1000 " map-out" $call-parent 0 is ssp-base then @@ -388,9 +389,10 @@ dup get-msecs - 0< ( limit ) until ( limit ) drop + clr-cmd true abort" EC command result timeout" ; - + : ec-command-buf ( [ args ] #args #results cmd-code -- result-buf-adr ) 0 set-cmdbuf ( )