[openfirmware] [commit] r2702 - in cpu: arm/olpc/1.75 x86/pc/olpc

repository service svn at openfirmware.info
Thu Nov 24 07:38:36 CET 2011


Author: quozl
Date: Thu Nov 24 07:38:35 2011
New Revision: 2702
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2702

Log:
OLPC XO-1.75 - automatic EC reflash, use chip icon, show progress bar, show battery icon with sad face if not enough power

Modified:
   cpu/arm/olpc/1.75/ecflash.fth
   cpu/arm/olpc/1.75/edi.fth
   cpu/arm/olpc/1.75/fw.bth
   cpu/x86/pc/olpc/gui.fth

Modified: cpu/arm/olpc/1.75/ecflash.fth
==============================================================================
--- cpu/arm/olpc/1.75/ecflash.fth	Wed Nov 23 06:42:38 2011	(r2701)
+++ cpu/arm/olpc/1.75/ecflash.fth	Thu Nov 24 07:38:35 2011	(r2702)
@@ -101,13 +101,8 @@
       else                           ( adr len )
          2dup load-base swap move    ( adr len )
          free-mem                    ( )
-         ['] ?enough-power catch  ?dup  if  ( error )
-            .error
-	    ." Skipping EC reflash" cr
-         else
-	    ." Updating EC code" cr
-	    reflash-ec
-	 then
+	 ." Updating EC code" cr
+	 reflash-ec
       then
    then
 ;

Modified: cpu/arm/olpc/1.75/edi.fth
==============================================================================
--- cpu/arm/olpc/1.75/edi.fth	Wed Nov 23 06:42:38 2011	(r2701)
+++ cpu/arm/olpc/1.75/edi.fth	Thu Nov 24 07:38:35 2011	(r2702)
@@ -14,6 +14,7 @@
 \  spi-in     ( -- byte ) - Receive byte
 
 d# 128 constant /flash-page
+defer edi-progress  ' drop to edi-progress  ( n -- )
 
 : edi-cmd,adr  ( offset cmd -- )   \ Send command plus 3 address bytes
    spi-cs-on     ( offset cmd )
@@ -140,6 +141,7 @@
          dup i + erase-page                    ( adr offset )
          over i +  over i +  edi-program-page  ( adr offset )
       then                                     ( adr offset )
+      i edi-progress                           ( adr offset )
    /flash-page +loop                           ( adr offset )
    2drop                                       ( )
 ;

Modified: cpu/arm/olpc/1.75/fw.bth
==============================================================================
--- cpu/arm/olpc/1.75/fw.bth	Wed Nov 23 06:42:38 2011	(r2701)
+++ cpu/arm/olpc/1.75/fw.bth	Thu Nov 24 07:38:35 2011	(r2702)
@@ -514,7 +514,18 @@
 
    show-child
 
-   update-ec-flash?  if  show-reflash  update-ec-flash  then
+   update-ec-flash?  if
+      ['] ?enough-power catch  ?dup  if  ( error )
+	 show-no-power
+	 .error
+	 ." Skipping EC reflash, not enough power" cr
+	 d# 1000 ms
+      else
+	 show-reflash
+	 ['] show-reflash-dot to edi-progress
+	 update-ec-flash
+      then
+   then
 
    install-alarm
    ?sound

Modified: cpu/x86/pc/olpc/gui.fth
==============================================================================
--- cpu/x86/pc/olpc/gui.fth	Wed Nov 23 06:42:38 2011	(r2701)
+++ cpu/x86/pc/olpc/gui.fth	Thu Nov 24 07:38:35 2011	(r2702)
@@ -374,11 +374,45 @@
    " vga?" $call-screen  0=  if  dcon-unfreeze dcon-freeze  then
 ;
 
-: show-reflash ( -- )  \ bottom left corner, laptop and ellipsis
-   d# 0 d# 810 to icon-xy " int" show-icon
-   d# 450 d# 150 do i d# 844 to icon-xy " bigdot" show-icon d# 100 +loop
+: show-no-power  ( -- )  \ chip, battery, overlaid sad face
+   d#  25 d# 772 to icon-xy " spi"     show-icon
+   d# 175 d# 772 to icon-xy " battery" show-icon
+   d# 175 d# 790 to icon-xy " sad"     show-icon
 ;
 
+d# 834 value bar-y
+d# 150 value bar-x
+0 value dot-adr
+
+: read-dot  ( -- )  \ rom: is unavailable during reflash
+   0 to dot-adr  0 0 to icon-xy         ( )
+   " darkdot" $get-image if exit then   ( )
+   prep-565  4drop  to dot-adr          ( )
+;
+
+: show-reflash  ( -- )  \ bottom left corner, chip and progress dots
+   d# 25 d# 772 to icon-xy " spi" show-icon
+   d# 992 bar-x + bar-y to icon-xy " yellowdot" show-icon
+   read-dot
+;
+
+: show-reflash-dot  ( n -- )  \ n to vary h# 0 to h# 8000
+   dup h# 400 mod 0=  if                   ( n )
+      dot-adr 0=  if  drop exit  then      ( n )
+      dot-adr swap h# 20 /  bar-x + bar-y  ( adr x y )
+      image-width image-height             ( adr x y w h )
+      " draw-transparent-rectangle" $call-screen
+   else
+      drop
+   then
+;
+
+0 [if]
+: test-reflash-dot
+   page show-reflash  t( h# 8000 0 do  i show-reflash-dot  h# 80 +loop )t
+;
+[then]
+
 : show-x  ( -- )  " x" show-icon  ;
 : show-sad  ( -- )
    icon-xy



More information about the openfirmware mailing list