Changeset 3195
- Timestamp:
- Aug 17, 2012 7:29:15 PM (9 months ago)
- Files:
-
- 3 edited
-
cpu/arm/olpc/1.75/lcdcfg.fth (modified) (1 diff)
-
cpu/arm/olpc/lcd.fth (modified) (1 diff)
-
dev/olpc/dcon/mmp2dcon.fth (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/1.75/lcdcfg.fth
r3049 r3195 1 1 dev /display 2 new-device 3 " panel" device-name 4 " mrvl,dumb-panel" +compatible 5 6 " OLPC DCON panel" model 7 : +i encode-int encode+ ; 8 9 decimal 10 0 0 encode-bytes 11 \ xres, yres, refresh, clockhz, left, right, top, bottom, hsync, vsync, flags, widthmm, heightmm 12 1200 +i 900 +i 50 +i 56,930,000 +i 24 +i 26 +i 5 +i 4 +i 6 +i 3 +i 0 +i 152 +i 115 +i 13 hex 14 " linux,timing-modes" property 15 16 " 1200x900@50" " linux,mode-names" string-property 17 18 h# 2000000d " lcd-dumb-ctrl-regval" integer-property 19 h# 08001100 " lcd-pn-ctrl0-regval" integer-property 20 finish-device 21 device-end 2 22 3 23 [ifdef] has-dcon 4 fload ${BP}/dev/olpc/dcon/mmp2dcon.fth \ DCON control 24 fload ${BP}/dev/olpc/dcon/mmp2dcon.fth \ DCON control 25 26 dev /display/panel 27 " /dcon" encode-phandle " control-node" property 28 device-end 5 29 [then] 6 30 7 device-end -
cpu/arm/olpc/lcd.fth
r3179 r3195 320 320 321 321 defer init-panel ' noop to init-panel 322 defer bright! ' drop to bright! 323 defer backlight-off ' noop to backlight-off 324 defer backlight-on ' noop to backlight-on 322 323 \ XXX we really should bounce these through the panel node(s) 324 : bright! " bright!" $call-dcon ; 325 : backlight-off " backlight-off" $call-dcon ; 326 : backlight-on " backlight-on" $call-dcon ; 325 327 326 328 : display-on -
dev/olpc/dcon/mmp2dcon.fth
r3187 r3195 1 1 \ See license at end of file 2 \ " dcon" device-name 3 4 also forth definitions 2 5 3 : has-dcon-ram? ( -- flag ) 6 4 board-revision h# 1b18 = if true exit then … … 8 6 false 9 7 ; 10 previous definitions 11 12 new-device 13 " dcon" device-name 14 " mrvl,dumb-panel" +compatible 15 " olpc,xo1-dcon" +compatible 16 " olpc,xo1.75-dcon" +compatible 17 18 " OLPC DCON panel" model 19 : +i encode-int encode+ ; 20 21 0 0 encode-bytes 22 dcon-stat0-gpio# 0 encode-gpio 23 dcon-stat1-gpio# 0 encode-gpio 24 dcon-load-gpio# 0 encode-gpio 25 dcon-irq-gpio# 0 encode-gpio 26 " gpios" property 27 28 " stat0" encode-string 29 " stat1" encode-string encode+ 30 " load" encode-string encode+ 31 " irq" encode-string encode+ 32 " gpio-names" property 33 34 " /dcon-i2c" encode-phandle " i2c-parent" property 35 36 decimal 37 0 0 encode-bytes 38 \ xres, yres, refresh, clockhz, left, right, top, bottom, hsync, vsync, flags, widthmm, heightmm 39 1200 +i 900 +i 50 +i 56,930,000 +i 24 +i 26 +i 5 +i 4 +i 6 +i 3 +i 0 +i 152 +i 115 +i 40 hex 41 " linux,timing-modes" property 42 43 " 1200x900@50" " linux,mode-names" string-property 44 45 h# 2000000d " lcd-dumb-ctrl-regval" integer-property 46 h# 08001100 " lcd-pn-ctrl0-regval" integer-property 47 finish-device 48 49 stand-init: 50 has-dcon-ram? 0= if 51 " /dcon" find-device 52 0 0 " no-freeze" property 53 device-end 54 then 55 ; 8 9 0 0 " 1a" " /dcon-i2c" begin-package 10 11 " dcon" device-name 12 " olpc,xo1-dcon" +compatible 13 " olpc,xo1.75-dcon" +compatible 14 h# 1a 1 reg 15 16 0 0 encode-bytes 17 dcon-stat0-gpio# 0 encode-gpio 18 dcon-stat1-gpio# 0 encode-gpio 19 dcon-load-gpio# 0 encode-gpio 20 dcon-irq-gpio# 0 encode-gpio 21 " gpios" property 22 23 " stat0" encode-string 24 " stat1" encode-string encode+ 25 " load" encode-string encode+ 26 " irq" encode-string encode+ 27 " gpio-names" property 56 28 57 29 \ DCON internal registers, accessed via I2C … … 90 62 91 63 : smb-init ( -- ) set-dcon-slave smb-on smb-pulses ; 64 : smb-reset ( -- ) smb-stop 1 ms smb-off 1 ms smb-on ; 92 65 93 66 : dcon@ ( reg# -- word ) set-dcon-slave smb-word@ ; … … 162 135 163 136 : try-dcon! ( w reg# -- ) 164 ['] dcon! catch if 2drop smb- stop 1 ms smb-off 1 ms smb-onthen137 ['] dcon! catch if 2drop smb-reset then 165 138 ; 166 139 … … 175 148 : timeout! ( to -- ) 8 dcon! ; \ def: h# ffff 176 149 : scanint! ( si -- ) 9 dcon! ; \ def: h# 0000 150 [ifdef] old-way 177 151 : dcon-bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF 178 152 ' dcon-bright! to bright! 179 : bright@ ( -- level ) d# 10 dcon@ ;180 : brighter ( -- ) bright@ 1+ h# f min bright! ;181 : dimmer ( -- ) bright@ 1- 0 max bright! ;182 183 153 : dcon-backlight-off ( -- ) mode@ 8 invert and mode! ; 184 154 ' dcon-backlight-off to backlight-off 185 155 : dcon-backlight-on ( -- ) mode@ 8 or mode! ; 186 156 ' dcon-backlight-on to backlight-on 157 [else] 158 : bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF 159 : backlight-off ( -- ) mode@ 8 invert and mode! ; 160 : backlight-on ( -- ) mode@ 8 or mode! ; 161 [then] 162 163 : bright@ ( -- level ) d# 10 dcon@ ; 164 : brighter ( -- ) bright@ 1+ h# f min bright! ; 165 : dimmer ( -- ) bright@ 1- 0 max bright! ; 187 166 188 167 \ Color swizzle, AA, no passthrough, backlight … … 233 212 ; 234 213 235 : video-save236 0 set-source \ Freeze image237 ;238 239 : video-restore240 smb-init241 1 set-source \ Unfreeze image242 ;243 244 214 0 value dcon-found? 245 215 246 216 : maybe-set-cmos ( -- ) ; 247 217 218 [ifdef] old-way 248 219 : init-dcon ( -- ) 249 220 smb-init … … 254 225 ; 255 226 ' init-dcon to init-panel 227 [else] 228 : open ( -- flag ) 229 smb-init 230 \ Unnecessary because CForth has already done it 231 \ dcon-load dcon-enable ( maybe-set-cmos ) 232 \ dcon-enable leaves mode set to 69 - 40:antialias, 20:swizzle, 8:backlight on, 1:passthru off 233 true 234 ; 235 [then] 256 236 257 237 : dcon-power-on ( -- ) 1 h# 26 ec-cmd-b! ; … … 274 254 saved-dcon-mode mode! 275 255 saved-brightness bright! 256 ; 257 258 end-package 259 260 stand-init: 261 has-dcon-ram? 0= if 262 " /dcon" find-device 263 0 0 " no-freeze" property 264 device-end 265 then 276 266 ; 277 267
Note: See TracChangeset
for help on using the changeset viewer.
