Author: wmb Date: Wed Dec 1 10:07:24 2010 New Revision: 2053 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2053
Log: OLPC XO-1.75 - enabled EC command timeouts.
Modified: cpu/arm/olpc/1.75/devices.fth dev/olpc/kb3700/spicmd.fth
Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Tue Nov 30 21:50:14 2010 (r2052) +++ cpu/arm/olpc/1.75/devices.fth Wed Dec 1 10:07:24 2010 (r2053) @@ -292,7 +292,7 @@ ec-api-ver@ " ec-version" integer-property [then]
- ec-name$ " ec-name" string-property + ['] ec-name$ catch 0= if " ec-name" string-property then dend
" /openprom" find-device
Modified: dev/olpc/kb3700/spicmd.fth ============================================================================== --- dev/olpc/kb3700/spicmd.fth Tue Nov 30 21:50:14 2010 (r2052) +++ dev/olpc/kb3700/spicmd.fth Wed Dec 1 10:07:24 2010 (r2053) @@ -177,15 +177,15 @@ 0 value datain? 0 value command-finished?
-0 value ec-cmd-time-limit -: ec-cmd-timeout? ( -- flag ) - ec-cmd-time-limit 0= if false exit then - get-msecs ec-cmd-time-limit - 0>= +0 value cmd-time-limit +: cmd-timeout? ( -- flag ) + cmd-time-limit 0= if false exit then + get-msecs cmd-time-limit - 0>= ; -: cancel-cmd-timeout ( -- ) 0 to ec-cmd-time-limit ; +: cancel-cmd-timeout ( -- ) 0 to cmd-time-limit ; : set-cmd-timeout ( -- ) - get-msecs d# 1000 + to ec-cmd-time-limit - ec-cmd-time-limit 0= if 1 to ec-cmd-time-limit then \ Avoid reserved value + get-msecs d# 1000 + to cmd-time-limit + cmd-time-limit 0= if 1 to cmd-time-limit then \ Avoid reserved value ;
defer do-state ' noop to do-state @@ -341,13 +341,17 @@ to datain? to datalen to databuf false to command-finished?
+ set-cmd-timeout ['] do-state behavior ['] upstream = if - set-cmd-timeout set-cmd else handoff-command then - begin poll command-finished? until + begin ( ) + poll ( ) + cmd-timeout? throw ( ) + command-finished? ( done? ) + until ;
: no-data-command ( adr len sticky? -- )