[openfirmware] [commit] r3180 - cpu/arm/olpc

repository service svn at openfirmware.info
Thu Aug 16 04:01:14 CEST 2012


Author: rsmith
Date: Thu Aug 16 04:01:14 2012
New Revision: 3180
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3180

Log:
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.

Modified:
   cpu/arm/olpc/build-fw.fth
   cpu/arm/olpc/edi.fth

Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth	Thu Aug 16 04:01:07 2012	(r3179)
+++ cpu/arm/olpc/build-fw.fth	Thu Aug 16 04:01:14 2012	(r3180)
@@ -202,6 +202,7 @@
 
 : ignore-power-button  ( -- )
    edi-spi-start
+   edi-open-active
    ['] reset-8051 catch if
       ['] reset-8051 catch if ." Write Protected EC" cr then
    then

Modified: cpu/arm/olpc/edi.fth
==============================================================================
--- cpu/arm/olpc/edi.fth	Thu Aug 16 04:01:07 2012	(r3179)
+++ cpu/arm/olpc/edi.fth	Thu Aug 16 04:01:14 2012	(r3180)
@@ -335,23 +335,23 @@
       ecsts edi-b!                         ( )
    then
 ;
-
-\ Does a dummy ready and throws away the result.
-\ required to get the EDI interface enabled
-: edi-start ( -- )
-   h# ff22 ['] edi-b@ catch if noop else drop then
-;
-
-: edi-open  ( -- )
-   \ slow-edi-clock   \ Target speed between 1 and 2 MHz
+\ This is used to start EDI from routines where you do not want to
+\ put the EC into reset.  ie the mfg tag reading routines
+: edi-open-active  ( -- )
    spi-start
 
-   edi-start
+   \ Does a dummy ready and throws away the result.
+   \ required to get the EDI interface enabled
+   h# ff22 ['] edi-b@ catch if noop else drop then
 
    set-chip-id
 
-   \ The first operation often fails so retry it
-   ['] select-flash  catch  if  select-flash  then
+   select-flash
+;
+\ Full EDI startup sequece.  Used when you want to reprogram the EC.
+: edi-open  ( -- )
+   edi-open-active
+
    reset-8051
 
    kb9010?  if
@@ -360,14 +360,7 @@
    else
       trim-tune
    then
-   \ fast-edi-clock   \ Target speed up to 16 MHz
-   \ reset
 ;
-: edi-open-active  ( -- )
-   spi-start
-   ['] select-flash  catch  if  select-flash  then
-;
-
 \ LICENSE_BEGIN
 \ Copyright (c) 2011 FirmWorks
 \ 



More information about the openfirmware mailing list