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

repository service svn at openfirmware.info
Tue Jan 10 02:45:53 CET 2012


Author: quozl
Date: Tue Jan 10 02:45:52 2012
New Revision: 2805
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2805

Log:
OLPC XO-1.75 - retry EDI interface activation when using it for tag maintenance operations, change EDI byte in to reveal an inactive state, tested on C1 SKU201, fix for #11565.

Modified:
   cpu/arm/olpc/ecflash.fth
   cpu/arm/olpc/edi.fth

Modified: cpu/arm/olpc/ecflash.fth
==============================================================================
--- cpu/arm/olpc/ecflash.fth	Sun Jan  8 05:29:01 2012	(r2804)
+++ cpu/arm/olpc/ecflash.fth	Tue Jan 10 02:45:52 2012	(r2805)
@@ -39,7 +39,7 @@
 : set-ec-reboot  ( -- )  1 h# f018 edi-b!  ;
 : ?reflash-ec-flags  ( adr -- )
    use-edi-spi                          ( adr )
-   spi-start                            ( adr )  \ avoids holding EC in reset
+   edi-open-active                      ( adr )  \ avoids holding EC in reset
    load-base /flash-page ec-flags-offset edi-read-flash         ( adr )
    dup load-base /flash-page comp       ( adr different? )
    if

Modified: cpu/arm/olpc/edi.fth
==============================================================================
--- cpu/arm/olpc/edi.fth	Sun Jan  8 05:29:01 2012	(r2804)
+++ cpu/arm/olpc/edi.fth	Tue Jan 10 02:45:52 2012	(r2805)
@@ -26,12 +26,20 @@
 ;
 [ifndef] edi-wait-b
 : edi-wait-b  ( -- b )  \ Wait for and receive EC response byte
-   d# 10000 0  do 
-      spi-in h# 50 =  if
-         spi-in           ( b )
-         spi-cs-off       ( b )
-         unloop exit
-      then
+   d# 100 0  do
+      spi-in              ( d )
+      dup h# 5f <>  if    ( d )
+         dup h# 50 =  if  ( d )
+            drop
+            spi-in        ( b )
+            spi-cs-off    ( b )
+            unloop exit
+         then             ( d )
+         spi-cs-off       ( d )
+         h# ff =  abort" EDI byte in inactive"
+         true abort" EDI byte in confused"
+      then                ( d )
+      drop
    loop
    spi-cs-off
    true abort" EDI byte in timeout"
@@ -228,6 +236,10 @@
    \ 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