Author: rsmith Date: Wed Apr 28 10:06:57 2010 New Revision: 1792 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1792
Log: Add word ops to ec-cmd
- Allows testing of new 16-bit SCI operations.
Modified: dev/olpc/kb3700/ecio.fth
Modified: dev/olpc/kb3700/ecio.fth ============================================================================== --- dev/olpc/kb3700/ecio.fth Wed Apr 21 10:12:48 2010 (r1791) +++ dev/olpc/kb3700/ecio.fth Wed Apr 28 10:06:57 2010 (r1792) @@ -101,6 +101,7 @@ : ec-wl ( -- l ) lbsplit ec-wb ec-wb ec-wb ec-wb ;
: (ec-cmd-b!) ( b cmd -- ) ec-cmd-out ec-wb ; +: (ec-cmd-w!) ( b cmd -- ) ec-cmd-out ec-ww ; : (ec-cmd-l!) ( l cmd -- ) ec-cmd-out ec-wl ; : (ec-cmd-b@) ( cmd -- b ) ec-cmd-out ec-rb ; : (ec-cmd-w@) ( cmd -- w ) ec-cmd-out ec-rw ; @@ -129,6 +130,17 @@ too-many-retries ;
+: ec-cmd-w! ( w cmd -- ) + #ec-retries 0 do ( b cmd ) + 2dup ['] (ec-cmd-w!) catch 0= if ( b cmd ) + 2drop unloop exit + then ( b cmd x x ) + 2drop ( b cmd ) + loop ( b cmd ) + too-many-retries +; + + : ec-cmd-l! ( l cmd -- ) #ec-retries 0 do ( b cmd ) 2dup ['] (ec-cmd-l!) catch 0= if ( b cmd )
openfirmware@openfirmware.info