Changeset 2226
- Timestamp:
- May 26, 2011 1:56:39 AM (2 years ago)
- Location:
- cpu
- Files:
-
- 5 edited
-
arm/olpc/1.75/fw.bth (modified) (1 diff)
-
arm/olpc/1.75/sound.fth (modified) (6 diffs)
-
x86/pc/olpc/fw.bth (modified) (2 diffs)
-
x86/pc/olpc/sound.fth (modified) (1 diff)
-
x86/pc/olpc/via/fw.bth (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/1.75/fw.bth
r2225 r2226 232 232 ; 233 233 code halt ( -- ) wfi c; 234 235 : dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ; 236 : brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ; 237 234 238 fload ${BP}/cpu/x86/pc/olpc/sound.fth 235 239 fload ${BP}/cpu/x86/pc/olpc/guardrtc.fth -
cpu/arm/olpc/1.75/sound.fth
r2103 r2226 1 0 0 " d42a0 c00" " /" begin-package1 0 0 " d42a0800" " /" begin-package 2 2 " audio" name 3 my-space h# 40 reg4 5 h# d42a.0c00 constant sspa-base 6 h# d42a.0800 constant adma-base 3 my-space h# 800 reg 4 5 0 value sspa-base \ E.g. h# d42a.0c00 6 0 value adma-base \ E.g. h# d42a.0800 7 7 : sspa! ( n offset -- ) sspa-base + l! ; \ Write a register in SSPA1 8 8 : sspa@ ( offset -- n ) sspa-base + l@ ; \ Read a register in SSPA1 … … 171 171 ; 172 172 173 [ifdef] cl2-a1 174 : choose-smbus ( -- ) h# 30 1 set-twsi-target ; 175 [else] 176 : choose-smbus ( -- ) h# 34 1 set-twsi-target ; 177 [then] 178 173 179 \ Reset is unconnected on current boards 174 180 \ : audio-reset ( -- ) 8 gpio-clr ; 175 181 \ : audio-unreset ( -- ) 8 gpio-set ; 176 : codec@ ( reg# -- w ) 1 2 twsi-get swap bwjoin ;177 : codec! ( w reg# -- ) >r wbsplit r> 3 twsi-write ;182 : codec@ ( reg# -- w ) choose-smbus 1 2 twsi-get swap bwjoin ; 183 : codec! ( w reg# -- ) choose-smbus >r wbsplit r> 3 twsi-write ; 178 184 : codec-i@ ( index# -- w ) h# 6a codec! h# 6c codec@ ; 179 185 : codec-i! ( w index# -- ) h# 6a codec! h# 6c codec! ; … … 347 353 348 354 [ifdef] cl2-a1 349 : init-smbus ( -- ) h# 30 1 set-twsi-target ;350 351 355 fload ${BP}/cpu/arm/olpc/1.75/alc5624.fth \ Realtek ALC5624 CODEC 352 356 [else] 353 : init-smbus ( -- ) h# 34 1 set-twsi-target ;354 355 357 : headphones-inserted? ( -- flag ) d# 97 gpio-pin@ ; 356 358 : microphone-inserted? ( -- flag ) d# 96 gpio-pin@ ; … … 379 381 380 382 : init-codec ( -- ) 381 init-smbus382 383 codec-on 383 384 set-default-gains … … 386 387 0 value open-count 387 388 : open ( -- flag ) 388 open-count 0= if audio-clock-on init-codec then 389 open-count 0= if 390 my-space h# 800 " map-in" $call-parent to adma-base 391 adma-base h# 400 + to sspa-base 392 audio-clock-on init-codec 393 then 389 394 open-count 1+ to open-count 390 395 true … … 393 398 open-count 1 = if 394 399 uninstall-playback-alarm codec-off ( audio-clock-off ) 400 adma-base h# 800 " map-out" $call-parent 401 0 to adma-base 0 to sspa-base 395 402 then 396 403 open-count 1- 0 max to open-count -
cpu/x86/pc/olpc/fw.bth
r2196 r2226 360 360 fload ${BP}/cpu/x86/pc/olpc/biosresume.fth 361 361 362 : dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ; 363 : brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ; 364 362 365 fload ${BP}/cpu/x86/pc/olpc/setwp.fth 363 366 fload ${BP}/cpu/x86/pc/olpc/sound.fth … … 388 391 \needs ramdisk " " d# 128 config-string ramdisk 389 392 " " ' boot-file set-config-string-default \ Let the boot script set the cmdline 390 391 : dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ;392 : brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ;393 394 dev /8042/keyboard395 0 value waiting-up?396 : olpc-check-abort ( scan-code -- abort? ) \ Square pressed?397 last-scan over to last-scan ( scan-code old-scan-code )398 h# e0 <> if drop false exit then ( scan-code )399 400 check-abort? 0= if drop false exit then ( scan-code )401 402 dup h# 7f and h# 5d <> if drop false exit then ( scan-code )403 404 h# 80 and if \ Up405 false to waiting-up?406 false ( abort? )407 else408 secure? if false else waiting-up? 0= then ( abort? )409 true to waiting-up?410 then411 ;412 patch olpc-check-abort check-abort get-scan413 414 : handle-volume? ( scan-code -- scan-code flag )415 dup h# 43 = if dimmer true exit then416 dup h# 44 = if brighter true exit then417 dup h# 57 = if softer true exit then418 dup h# 58 = if louder true exit then419 false420 ;421 ' handle-volume? to scan-handled?422 dend423 393 424 394 \ Eliminate 4 second delay in install console for the case where -
cpu/x86/pc/olpc/sound.fth
r2072 r2226 55 55 ; 56 56 57 dev /keyboard 58 0 value waiting-up? 59 : olpc-check-abort ( scan-code -- abort? ) \ Square pressed? 60 last-scan over to last-scan ( scan-code old-scan-code ) 61 h# e0 <> if drop false exit then ( scan-code ) 62 63 check-abort? 0= if drop false exit then ( scan-code ) 64 65 dup h# 7f and h# 5d <> if drop false exit then ( scan-code ) 66 67 h# 80 and if \ Up 68 false to waiting-up? 69 false ( abort? ) 70 else 71 secure? if false else waiting-up? 0= then ( abort? ) 72 true to waiting-up? 73 then 74 ; 75 patch olpc-check-abort check-abort get-scan 76 77 : handle-volume? ( scan-code -- scan-code flag ) 78 dup h# 43 = if dimmer true exit then 79 dup h# 44 = if brighter true exit then 80 dup h# 57 = if softer true exit then 81 dup h# 58 = if louder true exit then 82 false 83 ; 84 ' handle-volume? to scan-handled? 85 dend 86 57 87 \ LICENSE_BEGIN 58 88 \ Copyright (c) 2006 FirmWorks -
cpu/x86/pc/olpc/via/fw.bth
r2196 r2226 404 404 [then] 405 405 406 : dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ; 407 : brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ; 408 406 409 fload ${BP}/cpu/x86/firfilter.fth 407 410 fload ${BP}/cpu/x86/pc/olpc/sound.fth … … 422 425 \needs ramdisk " " d# 128 config-string ramdisk 423 426 " " ' boot-file set-config-string-default \ Let the boot script set the cmdline 424 425 : dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ;426 : brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ;427 428 dev /8042/keyboard429 0 value waiting-up?430 : olpc-check-abort ( scan-code -- abort? ) \ Square pressed?431 last-scan over to last-scan ( scan-code old-scan-code )432 h# e0 <> if drop false exit then ( scan-code )433 434 check-abort? 0= if drop false exit then ( scan-code )435 436 dup h# 7f and h# 5d <> if drop false exit then ( scan-code )437 438 h# 80 and if \ Up439 false to waiting-up?440 false ( abort? )441 else442 secure? if false else waiting-up? 0= then ( abort? )443 true to waiting-up?444 then445 ;446 patch olpc-check-abort check-abort get-scan447 448 : handle-volume? ( scan-code -- scan-code flag )449 dup h# 43 = if dimmer true exit then450 dup h# 44 = if brighter true exit then451 dup h# 57 = if softer true exit then452 dup h# 58 = if louder true exit then453 false454 ;455 ' handle-volume? to scan-handled?456 dend457 427 458 428 \ Eliminate 4 second delay in install console for the case where
Note: See TracChangeset
for help on using the changeset viewer.
