Changeset 2367


Ignore:
Timestamp:
Jul 14, 2011, 12:54:21 PM (4 years ago)
Author:
wmb
Message:

OLPC XO-1.75 - avoid EC command timeouts in the EC-SPI protocol by draining the FIFO if the EC has timed out and sent extra packets, acking only when the FIFO is empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dev/olpc/kb3700/spicmd.fth

    r2325 r2367  
    262262   pulse-ack
    263263;
     264: ?do-ack  ( -- )
     265   \ If there is more data in the FIFO, it means that the EC
     266   \ timed out and "inferred" an ACK, so we don't ACK until
     267   \ the FIFO is empty.
     268   ssp-ready? 0=  if  prime-fifo pulse-ack  then
     269;
    264270: (upstream)  ( -- )
    265271   ssp-ssdr rl@  ssp-ssdr rl@              ( channel# data )
     
    268274   then
    269275   over case                               ( channel# data )
    270       0 of  2drop prime-fifo pulse-ack  endof  ( channel# data )  \ Invalid
     276      0 of  2drop ?do-ack  endof           ( channel# data )  \ Invalid
    271277      1 of  2drop handoff-command   endof  ( channel# data )  \ Switched
    272278      ( default )                          ( channel# data channel# )
    273          enque  prime-fifo pulse-ack       ( channel# )
     279         enque  ?do-ack                    ( channel# )
    274280   endcase
    275281;
     
    332338;
    333339
     340: drain  ( -- )
     341   begin  ssp-ready?  while  poll  repeat
     342;
    334343: data-command  ( databuf datalen datain? cmdadr cmdlen more? -- )
    335344   to sticky?  to cmdlen   to cmdbuf
     
    339348   set-cmd-timeout
    340349   ['] do-state behavior ['] upstream =  if
     350      drain
    341351      set-cmd
    342352   else
Note: See TracChangeset for help on using the changeset viewer.