Changeset 3180


Ignore:
Timestamp:
Aug 16, 2012, 2:01:14 AM (3 years ago)
Author:
rsmith
Message:

OLPC ARM - Refactor EDI start procedure

Reboot after reflash did not work because the EC chip ID (io3731 vs
io3790) was not set in the series of calls that the OFW flash makes.
Refactor the EDI startup so that there is a common EDI enable routine
for other words to call.

Location:
cpu/arm/olpc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/build-fw.fth

    r3127 r3180  
    203203: ignore-power-button  ( -- )
    204204   edi-spi-start
     205   edi-open-active
    205206   ['] reset-8051 catch if
    206207      ['] reset-8051 catch if ." Write Protected EC" cr then
  • cpu/arm/olpc/edi.fth

    r3166 r3180  
    336336   then
    337337;
    338 
    339 \ Does a dummy ready and throws away the result.
    340 \ required to get the EDI interface enabled
    341 : edi-start ( -- )
     338\ This is used to start EDI from routines where you do not want to
     339\ put the EC into reset.  ie the mfg tag reading routines
     340: edi-open-active  ( -- )
     341   spi-start
     342
     343   \ Does a dummy ready and throws away the result.
     344   \ required to get the EDI interface enabled
    342345   h# ff22 ['] edi-b@ catch if noop else drop then
    343 ;
    344 
     346
     347   set-chip-id
     348
     349   select-flash
     350;
     351\ Full EDI startup sequece.  Used when you want to reprogram the EC.
    345352: edi-open  ( -- )
    346    \ slow-edi-clock   \ Target speed between 1 and 2 MHz
    347    spi-start
    348 
    349    edi-start
    350 
    351    set-chip-id
    352 
    353    \ The first operation often fails so retry it
    354    ['] select-flash  catch  if  select-flash  then
     353   edi-open-active
     354
    355355   reset-8051
    356356
     
    361361      trim-tune
    362362   then
    363    \ fast-edi-clock   \ Target speed up to 16 MHz
    364    \ reset
    365 ;
    366 : edi-open-active  ( -- )
    367    spi-start
    368    ['] select-flash  catch  if  select-flash  then
    369 ;
    370 
     363;
    371364\ LICENSE_BEGIN
    372365\ Copyright (c) 2011 FirmWorks
Note: See TracChangeset for help on using the changeset viewer.