Author: quozl Date: Wed Aug 8 09:36:09 2012 New Revision: 3132 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3132
Log: ARM - TWSI, twsi-write takes an address and length, twsi-out takes bytes on stack, but both achieve the same
Modified: cpu/arm/mmp2/boardtwsi.fth cpu/arm/mmp2/dsi.fth cpu/arm/mmp2/twsi.fth cpu/arm/mmp3/thunderstone/boardtwsi.fth
Modified: cpu/arm/mmp2/boardtwsi.fth ============================================================================== --- cpu/arm/mmp2/boardtwsi.fth Wed Aug 8 09:32:58 2012 (r3131) +++ cpu/arm/mmp2/boardtwsi.fth Wed Aug 8 09:36:09 2012 (r3132) @@ -68,13 +68,13 @@
: init-pals ( -- ) h# b0 4 set-twsi-target \ Set PS parameters address - 0 1 twsi-write \ clear interrupt settings + 0 1 twsi-out \ clear interrupt settings
h# 22 4 set-twsi-target \ Device init address - h# 10 1 twsi-write \ Init device + h# 10 1 twsi-out \ Init device
h# 20 4 set-twsi-target \ Ambient Light Sensor address - 2 1 twsi-write \ Enable ALS in most sensitive mode, 16-bit data + 2 1 twsi-out \ Enable ALS in most sensitive mode, 16-bit data ; : als@ ( -- n ) h# 22 4 set-twsi-target \ Ambient Light Sensor LSB address
Modified: cpu/arm/mmp2/dsi.fth ============================================================================== --- cpu/arm/mmp2/dsi.fth Wed Aug 8 09:32:58 2012 (r3131) +++ cpu/arm/mmp2/dsi.fth Wed Aug 8 09:36:09 2012 (r3132) @@ -6,10 +6,10 @@ : pmua! ( n offset -- ) pmua-pa + io! ;
: dsi-twsi! ( l reg# -- ) - >r lbsplit swap 2swap swap r> wbsplit 6 twsi-write + >r lbsplit swap 2swap swap r> wbsplit 6 twsi-out ; : dsi-twsi-w! ( w reg# -- ) - >r wbsplit swap r> wbsplit 4 twsi-write + >r wbsplit swap r> wbsplit 4 twsi-out ; : dsi-twsi@ ( reg# -- l ) wbsplit 2 4 twsi-get bljoin ; : dsi-twsi-w@ ( reg# -- w ) wbsplit 2 2 twsi-get bwjoin ;
Modified: cpu/arm/mmp2/twsi.fth ============================================================================== --- cpu/arm/mmp2/twsi.fth Wed Aug 8 09:32:58 2012 (r3131) +++ cpu/arm/mmp2/twsi.fth Wed Aug 8 09:36:09 2012 (r3132) @@ -145,7 +145,7 @@ bbu_ICR_STOP twsi-putbyte ( ) ; : twsi-write ( adr len -- ) - 0= if exit then ( adr len ) + dup 0= if 2drop exit then ( adr len ) slave-address twsi-start ( adr len )
1- 0 ?do dup c@ 0 twsi-putbyte 1+ loop ( adr' )
Modified: cpu/arm/mmp3/thunderstone/boardtwsi.fth ============================================================================== --- cpu/arm/mmp3/thunderstone/boardtwsi.fth Wed Aug 8 09:32:58 2012 (r3131) +++ cpu/arm/mmp3/thunderstone/boardtwsi.fth Wed Aug 8 09:36:09 2012 (r3132) @@ -68,13 +68,13 @@
: init-pals ( -- ) h# b0 4 set-twsi-target \ Set PS parameters address - 0 1 twsi-write \ clear interrupt settings + 0 1 twsi-out \ clear interrupt settings
h# 22 4 set-twsi-target \ Device init address - h# 10 1 twsi-write \ Init device + h# 10 1 twsi-out \ Init device
h# 20 4 set-twsi-target \ Ambient Light Sensor address - 2 1 twsi-write \ Enable ALS in most sensitive mode, 16-bit data + 2 1 twsi-out \ Enable ALS in most sensitive mode, 16-bit data ; : als@ ( -- n ) h# 22 4 set-twsi-target \ Ambient Light Sensor LSB address
openfirmware@openfirmware.info