[openfirmware] [commit] r2518 - cpu/arm/mmp2 cpu/arm/olpc/1.75 dev/olpc/dcon

repository service svn at openfirmware.info
Fri Sep 16 23:35:08 CEST 2011


Author: wmb
Date: Fri Sep 16 23:35:08 2011
New Revision: 2518
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2518

Log:
OLPC XO-1.75 - Improvements to suspend code for better DCON handling.

Modified:
   cpu/arm/mmp2/dramrecal.fth
   cpu/arm/olpc/1.75/devices.fth
   cpu/arm/olpc/1.75/lcd.fth
   dev/olpc/dcon/mmp2dcon.fth

Modified: cpu/arm/mmp2/dramrecal.fth
==============================================================================
--- cpu/arm/mmp2/dramrecal.fth	Fri Sep 16 02:47:50 2011	(r2517)
+++ cpu/arm/mmp2/dramrecal.fth	Fri Sep 16 23:35:08 2011	(r2518)
@@ -327,9 +327,9 @@
 
    \ Security processor setup
    sleep-depth 4 >= if                        \ state at least POWER_MODE_CHIP_SLEEP (turn off most of SoC)
-\     h# fe08.6000 0 mpmu!                    \ In SP, set AXISD, resvd, SLPEN,  SPSD,   DDRCORSD, APBSD resvd, VCXOSD
+     h# fe08.6000 0 mpmu!                    \ In SP, set AXISD, resvd, SLPEN,  SPSD,   DDRCORSD, APBSD resvd, VCXOSD
      \ We keep PMUM_BBDP (bit 25) off because that saves 60 mW
-     h# fc08.6000 0 mpmu!                     \ In SP, set AXISD, resvd, SLPEN,  SPSD,   DDRCORSD, APBSD resvd, VCXOSD
+\    h# fc08.6000 0 mpmu!                     \ In SP, set AXISD, resvd, SLPEN,  SPSD,   DDRCORSD, APBSD resvd, VCXOSD
    then
 
    sleep-depth 3 =  if                        \ state at least POWER_MODE_APPS_SLEEP (turn off slow IO)
@@ -396,26 +396,28 @@
 : keyboard-power-off  ( -- )  d# 148 gpio-set  ;
 : wlan-power-on   ( -- )  d# 34 gpio-set  ;
 : wlan-power-off  ( -- )  d# 34 gpio-clr  ;
-: dcon-power-on   ( -- )  1 h# 26 ec-cmd-b!  ;
-: dcon-power-off  ( -- )  0 h# 26 ec-cmd-b!  ;
-h# ffff value sleep-mask
+0 value sleep-mask
 : screen-off
-  sleep-mask 1 and  if  h# 12 " mode!" $call-screen  then   \ DCON power down
-  0 h# 190 " lcd!" $call-screen
-  0 h# 4c pmua!    \ Kill the display clocks - saves 100 mW
-  \ 0 h# 54 pmua!  \ Kill the SDIO 0 clocks - insignificant savings
-  \ 0 h# 58 pmua!  \ Kill the SDIO 1 clocks - insignificant savings
-  sleep-mask 2 and  if  dcon-power-off      then  \ saves 80 mW
-  sleep-mask 4 and  if  keyboard-power-off  then  \ Should save about 17 mW
-  sleep-mask 8 and  if  wlan-power-off      then  \ saves 100 mW
+   sleep-mask 1 and  if            \ DCON power down
+      dcon-freeze
+   else
+      " dcon-suspend" $call-screen
+   then
+   " suspend" $call-screen
+   \ 0 h# 54 pmua!  \ Kill the SDIO 0 clocks - insignificant savings
+   \ 0 h# 58 pmua!  \ Kill the SDIO 1 clocks - insignificant savings
+   sleep-mask 2 and  0=  if  keyboard-power-off  then  \ Should save about 17 mW
+   sleep-mask 4 and  0=  if  wlan-power-off      then  \ saves 100 mW
 ;
 : screen-on  ( -- )
-  sleep-mask 8 and  if  wlan-power-on       then
-  sleep-mask 4 and  if  keyboard-power-on   then 
-  sleep-mask 2 and  if  dcon-power-on  d# 50 ms     then  \ saves 80 mW
-  h# 71b h# 4c pmua!
-  h# 8001100 h# 190 " lcd!" $call-screen
-  sleep-mask 1 and  if  h# 69 " mode!" $call-screen  then   \ DCON power up
+   sleep-mask 4 and  0=  if  wlan-power-on       then
+   sleep-mask 2 and  0=  if  keyboard-power-on   then 
+   " resume" $call-screen
+   sleep-mask 1 and  if            \ DCON power up
+      dcon-unfreeze
+   else
+      " dcon-resume" $call-screen
+   then
 ;
 
 : stdin-idle-on   ['] safe-idle to stdin-idle  d# 15 enable-interrupt  ;

Modified: cpu/arm/olpc/1.75/devices.fth
==============================================================================
--- cpu/arm/olpc/1.75/devices.fth	Fri Sep 16 02:47:50 2011	(r2517)
+++ cpu/arm/olpc/1.75/devices.fth	Fri Sep 16 23:35:08 2011	(r2518)
@@ -396,9 +396,6 @@
 
 fload ${BP}/cpu/arm/mmp2/thermal.fth
 
-fload ${BP}/cpu/arm/mmp2/dramrecal.fth
-fload ${BP}/cpu/arm/mmp2/rtc.fth       \ Internal RTC, used for wakeups
-
 \ LICENSE_BEGIN
 \ Copyright (c) 2010 FirmWorks
 \ 

Modified: cpu/arm/olpc/1.75/lcd.fth
==============================================================================
--- cpu/arm/olpc/1.75/lcd.fth	Fri Sep 16 02:47:50 2011	(r2517)
+++ cpu/arm/olpc/1.75/lcd.fth	Fri Sep 16 23:35:08 2011	(r2518)
@@ -2,12 +2,18 @@
 : lcd@  ( offset -- l )  lcd-pa + io@  ;
 : lcd!  ( l offset -- )  lcd-pa + io!  ;
 
-: init-lcd  ( -- )
+: lcd-clock!  ( n -- )  pmua-disp-clk-sel + h# 4c pmua!  ;
+: lcd-clocks-on  ( -- )
    \ Turn on clocks
-   h# 08 pmua-disp-clk-sel + h# 28284c io!
-   h# 09 pmua-disp-clk-sel + h# 28284c io!
-   h# 19 pmua-disp-clk-sel + h# 28284c io!
-   h# 1b pmua-disp-clk-sel + h# 28284c io!
+   h# 08 lcd-clock!
+   h# 09 lcd-clock!
+   h# 19 lcd-clock!
+   h# 1b lcd-clock!
+;
+: lcd-clocks-off  ( -- )  0 lcd-clock!  ;
+
+: init-lcd  ( -- )
+   lcd-clocks-on
 
    0                  h# 190 lcd!  \ Disable LCD DMA controller
    fb-mem-pa           h# f4 lcd!  \ Frame buffer area 0
@@ -205,3 +211,13 @@
    2drop                           ( )
    flush-cursor-bits               ( )
 ;
+0 value saved-mode
+: suspend  ( -- )
+   h# 190 lcd@ to saved-mode
+   0 h# 190 lcd!
+   lcd-clocks-off
+;
+: resume  ( -- )
+   lcd-clocks-on
+   saved-mode h# 190 lcd!
+;

Modified: dev/olpc/dcon/mmp2dcon.fth
==============================================================================
--- dev/olpc/dcon/mmp2dcon.fth	Fri Sep 16 02:47:50 2011	(r2517)
+++ dev/olpc/dcon/mmp2dcon.fth	Fri Sep 16 23:35:08 2011	(r2518)
@@ -223,6 +223,22 @@
    dcon-enable  ( maybe-set-cmos )
    \ dcon-enable leaves mode set to 69 - 40:antialias, 20:swizzle, 8:backlight on, 1:passthru off
 ;
+: dcon-power-on   ( -- )  1 h# 26 ec-cmd-b!  ;
+: dcon-power-off  ( -- )  0 h# 26 ec-cmd-b!  ;
+0 value saved-dcon-mode
+0 value saved-brightness
+: dcon-suspend  ( -- )
+   bright@ to saved-brightness
+   mode@ to saved-dcon-mode
+   h# 12 mode!
+   dcon-power-off
+;
+: dcon-resume  ( -- )
+   dcon-power-on  d# 50 ms   
+   dcon-setup
+   saved-dcon-mode  mode!
+   saved-brightness bright!
+;
 
 \ LICENSE_BEGIN
 \ Copyright (c) 2010 FirmWorks



More information about the openfirmware mailing list