[openfirmware] [commit] r3414 - in cpu/arm/olpc: . 4.0

repository service svn at openfirmware.info
Sat Nov 3 03:34:49 CET 2012


Author: quozl
Date: Sat Nov  3 03:34:49 2012
New Revision: 3414
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3414

Log:
OLPC XO-4 - touchscreen, switch to latest firmware 0.0.0.7 with missing IR PCB support, determine available version number from file, enable automatic reflash for wider testing (breaks manufacturing tests on B1).

Modified:
   cpu/arm/olpc/4.0/nn-version.fth
   cpu/arm/olpc/nnflash.fth

Modified: cpu/arm/olpc/4.0/nn-version.fth
==============================================================================
--- cpu/arm/olpc/4.0/nn-version.fth	Sat Nov  3 00:17:39 2012	(r3413)
+++ cpu/arm/olpc/4.0/nn-version.fth	Sat Nov  3 03:34:49 2012	(r3414)
@@ -1,5 +1,2 @@
 \ The Neonode touchscreen firmware
-macro: NN_VERSION 0_0_0_6
-
-\ FIXME: change in nnflash.fth too, until it knows how to read it
-\ using Neonode's instructions.
+macro: NN_VERSION 0_0_0_7

Modified: cpu/arm/olpc/nnflash.fth
==============================================================================
--- cpu/arm/olpc/nnflash.fth	Sat Nov  3 00:17:39 2012	(r3413)
+++ cpu/arm/olpc/nnflash.fth	Sat Nov  3 03:34:49 2012	(r3414)
@@ -1,11 +1,38 @@
 \ See license at end of file
 purpose: Reflash a Neonode touchscreen controller
 
+: (nnv)  ( version.d adr -- version.d )
+   2 $number abort" nn.hex, not a number"
+   >r 8 dlshift swap r> or swap
+;
+
+: $nn-version  ( file$ -- version.d )
+   $read-open           ( )
+   3 0 do
+      load-base d# 100 ifd @ read-line abort" nn.hex, read-line failed" 2drop
+   loop
+   load-base d# 25 +    ( adr )
+   >r  0.               ( version.d  r: adr )
+   r@ d#  2 + (nnv)  r@         (nnv)  r@ d#  6 + (nnv)  r@ d#  4 + (nnv)
+   r@ d# 10 + (nnv)  r@ d#  8 + (nnv)  r@ d# 14 + (nnv)  r@ d# 12 + (nnv)
+   r> drop              ( version.d )
+   ifd @ fclose
+   \ 59ms
+;
+
 : get-touchscreen-version  ( -- version.d )
    " /touchscreen" open-dev                    ( handle )
    dup 0= abort" could not open touchscreen"
    " get-version" 2 pick $call-method          ( handle version.d )
    >r >r close-dev r> r>                       ( version.d )
+   \ 20ms first time, 270ms subsequent
+;
+
+: nn-up-to-date?  ( file$ -- flag )
+   $nn-version                  ( version-in-file.d )
+   2dup h# 0001.0000.0000.0000. d>= abort" nn.hex, major version conflict"
+   get-touchscreen-version      ( version-in-file.d version-in-controller.d )
+   d<=
 ;
 
 : nn-image$  " rom:\nn.hex"  ;
@@ -15,11 +42,6 @@
 ;
 : flash-nn  ( "filename" -- )  safe-parse-word  ?enough-power  reflash-nn  ;
 : flash-nn! ( "filename" -- )  safe-parse-word                 reflash-nn  ;
-: nn-up-to-date?  ( file$ -- flag )
-   2drop  h# 0000.0000.0000.0006.  \ FIXME: get version from file
-   get-touchscreen-version   \ 20ms first time, 270ms subsequent
-   d<=
-;
 
 : update-nn-flash  ( -- )
    nn-image$  2dup nn-up-to-date?  if
@@ -32,7 +54,8 @@
 : update-nn-flash?  ( -- flag )
    \ XO-4 B1 have clear lightguides incompatible with later versions
    \ of touchscreen firmware.
-   board-revision h# 4b20  <  if  false exit  then
+   \ (disabled temporarily so that automatic update can be tested)
+   \ board-revision h# 4b20  <  if  false exit  then
    nn-image$  nn-up-to-date?  0=
 ;
 



More information about the openfirmware mailing list