Author: quozl Date: Thu Nov 1 00:32:08 2012 New Revision: 3404 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3404
Log: OLPC XO-4 - touchscreen rework for firmware 0.0.0.6, which contained new behaviours not previously advised by Neonode
Modified: cpu/arm/olpc/nn-touchscreen.fth cpu/arm/olpc/nnflash.fth
Modified: cpu/arm/olpc/nn-touchscreen.fth ============================================================================== --- cpu/arm/olpc/nn-touchscreen.fth Wed Oct 31 23:38:29 2012 (r3403) +++ cpu/arm/olpc/nn-touchscreen.fth Thu Nov 1 00:32:08 2012 (r3404) @@ -17,7 +17,6 @@
create nn-os \ open short test create nn-fll \ forced LED levels test -create nn-version \ version display create nn-watch \ graphical signal tests
create nn-fss \ optional fixed signal strength test @@ -29,6 +28,17 @@ d# 15 value xleds d# 11 value yleds
+0. 2value version# +: get-version ( -- version.d ) version# ; + +: (.)' ( version-segment.w -- ) (.) type [char] . emit ; + +: .version ( version.d -- ) lwsplit (.)' (.)' lwsplit (.)' (.)' ; + +: show-version ( -- ) + ." Neonode zForce Touch Driver firmware version " version# .version cr +; + \ XXX these are really platform-related, not touchscreen-related : targets? ( -- flag ) final-test? ; : (.tsmsg) ( -- ) 0 d# 27 at-xy ." Touchscreen test. Type a key to exit" cr ; @@ -43,7 +53,9 @@ : 2u.x base @ >r hex 0 <# # # #> type r> base ! ; [then]
-: x>x' ( x -- x' ) screen-w swap - ; \ reverse x coordinate +defer x>x' ' noop to x>x' +: (x>x') ( x -- x' ) screen-w swap - ; \ reverse x coordinate +: set-reverse-x ['] (x>x') to x>x' ;
: set-gpios [ifdef] olpc-cl2 @@ -55,11 +67,7 @@ ;
\ Neonode requested 250 ms -\ we observe for 0.0.0.5 -\ less than 38 ms yields no response to reset, -\ 40 ms yields 100 ms overall version check, and -\ 45 ms yields 84 ms overall version check. -: reset ( -- ) touch-rst-gpio# dup gpio-clr gpio-set d# 50 ms ; +: reset ( -- ) touch-rst-gpio# dup gpio-clr gpio-set d# 250 ms ; : hold-reset ( -- ) touch-rst-gpio# gpio-clr ; : no-data? ( -- no-data? ) touch-int-gpio# gpio-pin@ ;
@@ -104,6 +112,13 @@
: read-boot-complete ( -- ) h# 07 d# 0 anticipate ;
+: read-version + h# 1e h# 01 h# ee 3 bytes-out h# 1e d# 100 anticipate + pbuf 2+ c@ h# 1e <> abort" bad response" + pbuf 9 + le-w@ pbuf 7 + le-w@ wljoin pbuf 5 + le-w@ pbuf 3 + le-w@ wljoin + to version# +; + : initialise ( -- ) h# 01 h# 01 h# ee 3 bytes-out h# 01 d# 20 anticipate ;
: set-resolution ( -- ) @@ -125,6 +140,8 @@
: configure ( -- ) configure? if + read-version + version# h# 6. d< if set-reverse-x then initialise set-resolution start @@ -202,42 +219,6 @@
-[ifdef] nn-version \ version display -: (.version) ( addr -- ) - dup c@ over 1+ c@ bwjoin ( addr version ) - (.) type -; - -: .version ( -- ) - pbuf 3 + 3 0 do ( addr ) - (.version) 2+ - [char] . emit - loop ( addr ) - (.version) drop ( ) -; - -: (version) ( -- ) - h# 1e h# 01 h# ee 3 bytes-out - h# 1e d# 30 anticipate - pbuf 2+ c@ h# 1e <> abort" bad response" -; - -: test-version ( -- ) - (version) - ." Neonode zForce Touch Driver firmware version " - .version - cr -; - -: get-version ( -- version.d ) - (version) - pbuf 9 + le-w@ pbuf 7 + le-w@ wljoin pbuf 5 + le-w@ pbuf 3 + le-w@ wljoin -; - -[then] - - - [ifdef] nn-os \ open short test
[ifdef] nn-components @@ -1003,7 +984,7 @@
: mb-smt ( -- error? ) open 0= if true exit then - test-version + show-version close false ; @@ -1034,7 +1015,7 @@
diagnostic-mode? if 0 to faults - [ifdef] nn-version test-version [then] + show-version [ifdef] nn-os test-os [then] [ifdef] nn-fss test-fss [then] [ifdef] nn-fll test-fll [then]
Modified: cpu/arm/olpc/nnflash.fth ============================================================================== --- cpu/arm/olpc/nnflash.fth Wed Oct 31 23:38:29 2012 (r3403) +++ cpu/arm/olpc/nnflash.fth Thu Nov 1 00:32:08 2012 (r3404) @@ -17,7 +17,7 @@ : 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 + get-touchscreen-version \ 20ms first time, 270ms subsequent d<= ;