Changeset 3166


Ignore:
Timestamp:
Aug 14, 2012, 1:19:12 AM (2 years ago)
Author:
rsmith
Message:

OLPC 1.75 - Fix EC programming breakage

The changes to support the io3790 on the CL4 broke programming on the
1.75. This fixes up the breakage.
It also factors out the dummy read into its own word called edi-start.
Not necessary for the fix but was handy during debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/edi.fth

    r3157 r3166  
    1919: efcfg    ( -- reg# )  kb9010?  if  h# fead  else  h# fea0   then  ; 
    2020: efcmd    ( -- reg# )  kb9010?  if  h# feac  else  h# fea7   then  ; 
    21 : efdat    ( -- reg# )  kb9010?  if  h# feab  else  h# feaa   then  ; 
     21: efdat    ( -- reg# )  kb9010?  if  h# feab  else  h# feaa   then  ; \ io3731 has different read and write regs 
     22h# feab constant efdat-in 
    2223: rst8051  ( -- reg# )  kb9010?  if  h# ff14  else  h# f010   then  ; 
    2324: ecreboot ( -- reg# )  kb9010?  if  h# ff01  else  h# f018   then  ; 
    24  
    2525\ Issues with .py code 
    2626\ A14:A8 should be A15:A8 several places 
     
    141141 
    142142: finished?  ( b -- flag ) 
    143    kb9010?  if  2 and 0=  else h# 80 =  then 
     143   kb9010?  if  2 and 0=  else h# 80 and h# 80 =  then 
    144144; 
    145145: wait-flash-busy  ( -- )  \ Wait for an erase/programming operation to complete 
     
    221221   h# 90 flash-cmd 
    222222   wait-flash-busy 
    223    efdat edi-b@   \ reg: efdat 
    224 ; 
     223   efdat-in edi-b@   \ reg: efdat 
     224; 
     225 
    225226: trim-tune  ( -- ) 
    226227\   firmware-id  0=  if 
     
    335336   then 
    336337; 
     338 
     339\ Does a dummy ready and throws away the result. 
     340\ required to get the EDI interface enabled 
     341: edi-start ( -- ) 
     342   h# ff22 ['] edi-b@ catch if noop else drop then 
     343; 
     344 
    337345: edi-open  ( -- ) 
    338346   \ slow-edi-clock   \ Target speed between 1 and 2 MHz 
    339347   spi-start 
    340348 
    341    \ dummy read, to activate EDI and can fail so ignore the fail 
    342    h# ff22 ['] edi-b@ catch if noop else drop then 
    343     
     349   edi-start 
     350 
    344351   set-chip-id 
    345352 
Note: See TracChangeset for help on using the changeset viewer.