Author: wmb Date: Mon Aug 29 03:30:53 2011 New Revision: 2482 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2482
Log: OLPC XO-1.75 - regularized the naming of some words in the TWSI driver.
Modified: cpu/arm/mmp2/twsi.fth cpu/arm/olpc/1.75/sound.fth
Modified: cpu/arm/mmp2/twsi.fth ============================================================================== --- cpu/arm/mmp2/twsi.fth Mon Aug 29 03:29:08 2011 (r2481) +++ cpu/arm/mmp2/twsi.fth Mon Aug 29 03:30:53 2011 (r2482) @@ -129,15 +129,22 @@ then ;
-: twsi-write ( byte .. #bytes -- ) +: twsi-out ( byte .. #bytes -- ) slave-address twsi-start ( byte .. #bytes )
1- 0 ?do 0 twsi-putbyte loop ( byte ) bbu_ICR_STOP twsi-putbyte ( ) ; +: twsi-write ( adr len -- ) + 0= if exit then ( adr len ) + slave-address twsi-start ( adr len ) + + 1- 0 ?do dup c@ 0 twsi-putbyte 1+ loop ( adr' ) + c@ bbu_ICR_STOP twsi-putbyte ( ) +;
: twsi-b@ ( reg -- byte ) 1 1 twsi-get ; -: twsi-b! ( byte reg -- ) 2 twsi-write ; +: twsi-b! ( byte reg -- ) 2 twsi-out ;
[ifdef] begin-package 0 0 " " " /" begin-package @@ -157,6 +164,18 @@ child-address set-twsi-target twsi-get ; +: smbus-b@ ( -- ) + child-address set-twsi-target + twsi-b@ +; +: smbus-b! ( -- ) + child-address set-twsi-target + twsi-b! +; +: smbus-out ( byte .. #bytes -- ) + child-address set-twsi-target + twsi-out +;
d# 12,600,000 constant numerator : set-bus-speed ( hz -- ) \ Useful range is currently 25,000 .. 100,000
Modified: cpu/arm/olpc/1.75/sound.fth ============================================================================== --- cpu/arm/olpc/1.75/sound.fth Mon Aug 29 03:29:08 2011 (r2481) +++ cpu/arm/olpc/1.75/sound.fth Mon Aug 29 03:30:53 2011 (r2482) @@ -204,7 +204,7 @@ \ : audio-reset ( -- ) 8 gpio-clr ; \ : audio-unreset ( -- ) 8 gpio-set ; : codec@ ( reg# -- w ) choose-smbus 1 2 twsi-get swap bwjoin ; -: codec! ( w reg# -- ) choose-smbus >r wbsplit r> 3 twsi-write ; +: codec! ( w reg# -- ) choose-smbus >r wbsplit r> 3 twsi-out ; : codec-i@ ( index# -- w ) h# 6a codec! h# 6c codec@ ; : codec-i! ( w index# -- ) h# 6a codec! h# 6c codec! ;