Author: quozl Date: Tue Jan 8 03:44:19 2013 New Revision: 3514 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3514
Log: OLPC XO-4 - rework DCON freeze and unfreeze screen synchronisation, make wait-output global as requested by John.
Modified: cpu/arm/olpc/suspend.fth cpu/x86/pc/olpc/disptest.fth cpu/x86/pc/olpc/gui.fth dev/olpc/dcon/mmp2dcon.fth
Modified: cpu/arm/olpc/suspend.fth ============================================================================== --- cpu/arm/olpc/suspend.fth Mon Jan 7 08:05:08 2013 (r3513) +++ cpu/arm/olpc/suspend.fth Tue Jan 8 03:44:19 2013 (r3514) @@ -132,11 +132,11 @@ 0 value sleep-mask : screen-sleep sleep-mask 1 and if \ DCON power down - dcon-freeze + dcon-screen-freeze else " dcon-suspend" $call-dcon + " sleep" $call-screen then - " sleep" $call-screen " set-ack" $call-ec
\ 0 h# 54 pmua! \ Kill the SDIO 0 clocks - insignificant savings @@ -156,10 +156,10 @@ then sleep-mask 2 and 0= if keyboard-power-on then " clr-ack" $call-ec - " wake" $call-screen sleep-mask 1 and if \ DCON power up - dcon-unfreeze + dcon-screen-unfreeze else + " wake" $call-screen " dcon-resume" $call-dcon then ;
Modified: cpu/x86/pc/olpc/disptest.fth ============================================================================== --- cpu/x86/pc/olpc/disptest.fth Mon Jan 7 08:05:08 2013 (r3513) +++ cpu/x86/pc/olpc/disptest.fth Tue Jan 8 03:44:19 2013 (r3514) @@ -173,9 +173,9 @@ ; : wait ( -- ) hold-time - dcon-freeze + dcon-screen-freeze hold-time - dcon-unfreeze + dcon-screen-unfreeze hold-time2 ;
Modified: cpu/x86/pc/olpc/gui.fth ============================================================================== --- cpu/x86/pc/olpc/gui.fth Mon Jan 7 08:05:08 2013 (r3513) +++ cpu/x86/pc/olpc/gui.fth Tue Jan 8 03:44:19 2013 (r3514) @@ -355,9 +355,12 @@ $show ( ) ;
-: frozen? ( -- flag ) " vga?" $call-dcon 0= ; -: dcon-freeze ( -- ) " dcon-freeze" $call-dcon d# 30 ms ; -: dcon-unfreeze ( -- ) " dcon-unfreeze" $call-dcon d# 30 ms ; +: frozen? ( -- flag ) " vga?" $call-dcon 0= ; +: dcon-freeze ( -- ) " dcon-freeze" $call-dcon ; +: dcon-unfreeze ( -- ) " dcon-unfreeze" $call-dcon ; +: wait-output ( -- ) " wait-output" $call-dcon ; +: dcon-screen-freeze ( -- ) " screen-freeze" $call-dcon ; +: dcon-screen-unfreeze ( -- ) " screen-unfreeze" $call-dcon ;
\ === Stuff moved from security.fth ===
Modified: dev/olpc/dcon/mmp2dcon.fth ============================================================================== --- dev/olpc/dcon/mmp2dcon.fth Mon Jan 7 08:05:08 2013 (r3513) +++ dev/olpc/dcon/mmp2dcon.fth Tue Jan 8 03:44:19 2013 (r3514) @@ -136,9 +136,6 @@ dup vga? = if drop exit then ( source ) dup to vga? ( source ) if - wait-output \ Wait for the DCON to reach the scan line - " wake" $call-screen \ Enable video signal from SoC - d# 25 ms dcon-load \ Put the DCON in VGA-refreshed mode d# 25 ms \ Ensure that that DCON sees the DCONLOAD high else @@ -151,13 +148,25 @@ \ We got a false ack from the DCON so start over from LOAD state dcon-load d# 25 ms ( ) repeat ( ) - " sleep" $call-screen + d# 25 ms then then ; : dcon-freeze ( -- ) 0 set-source ; : dcon-unfreeze ( -- ) 1 set-source ;
+: screen-freeze ( -- ) + dcon-freeze + " sleep" $call-screen +; + +: screen-unfreeze ( -- ) + wait-output \ Wait for the DCON to reach the scan line + " wake" $call-screen \ Enable video signal from SoC + d# 42 ms \ Synchronisation delay determined empirically + dcon-unfreeze +; + \ gx_configure_tft(info);
: try-dcon! ( w reg# -- ) @@ -285,15 +294,20 @@ then ;
-[ifdef] notdef +\ [ifdef] notdef : test-dcon-freeze-glitch - screen-ih remove-output + invisible " gvsr" $call-screen - begin dcon-freeze dcon-unfreeze key? until key drop - screen-ih add-output + begin + " screen-freeze" $call-dcon + d# 25 ms + " screen-unfreeze" $call-dcon + key? + until key drop + visible page ; -[then] +\ [then]
\ LICENSE_BEGIN \ Copyright (c) 2010 FirmWorks