[openfirmware] [commit] r2757 - cpu/arm/olpc/3.0
repository service
svn at openfirmware.info
Thu Dec 8 13:43:56 CET 2011
Author: wmb
Date: Thu Dec 8 13:43:55 2011
New Revision: 2757
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2757
Log:
OLPC XO-3 - Support new LCD power GPIOS.
Modified:
cpu/arm/olpc/3.0/lcdcfg.fth
Modified: cpu/arm/olpc/3.0/lcdcfg.fth
==============================================================================
--- cpu/arm/olpc/3.0/lcdcfg.fth Thu Dec 8 13:43:50 2011 (r2756)
+++ cpu/arm/olpc/3.0/lcdcfg.fth Thu Dec 8 13:43:55 2011 (r2757)
@@ -32,9 +32,21 @@
alias depth bpp
width >bytes constant /scanline
-: bright! ( level -- ) drop ;
-: backlight-on ( -- ) ;
-: backlight-off ( -- ) ;
+: bright! ( level -- ) d# 15 min h# 11 * h# 1a404 io! ;
+: backlight-on ( -- ) d# 15 bright! ;
+: backlight-off ( -- ) 0 bright! ;
+: setup-pwm2 ( -- )
+ 7 h# 1503c io! 3 h# 1503c io! \ Turn on the PWM1 clock and release reset - PWM2 depends on it
+ 7 h# 15040 io! 3 h# 15040 io! \ Turn on the PWM2 clock and release reset
+ h# 3f h# 1a400 io! \ Prescaler value 63, 26MHz / 64 = 406 kHz
+ h# 100 h# 1a408 io! \ Full period is 256 clocks
+\ backlight-off
+ d# 15 bright!
+ 3 sleep0 d# 49 af! \ Switch over to PWM control of the pin
+ d# 138 gpio-set
+ d# 138 gpio-dir-out
+;
+
: lcd-power-on ( -- )
d# 138 gpio-set \ LCDVCC_EN
d# 135 gpio-set \ STBY#
@@ -47,9 +59,10 @@
d# 130 gpio-set \ LCD_RESET# (end of pulse)
d# 120 ms
+ setup-pwm2
backlight-on
;
-: init-xo-display ; \ CForth has already turned it on
+: init-xo-display ( -- ) ; \ CForth has already turned it on
: set-source ( flag -- ) drop ; \ No DCON
true constant vga? \ No DCON, hence never frozen
More information about the openfirmware
mailing list