Changeset 3183


Ignore:
Timestamp:
Aug 16, 2012, 8:15:40 PM (3 years ago)
Author:
wmb
Message:

OLPC ARM - Change all uses of I2C addresses for TWSI-connected devices to use the unshifted address form.

Location:
cpu/arm
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/mmp2/boardtwsi.fth

    r3132 r3183  
    99\ 6 HDMI DDC EDID a0
    1010
    11 : select-touch-panel  ( -- )  h# 40 5 set-twsi-target  ;
     11: select-touch-panel  ( -- )  h# 20 5 set-twsi-target  ;
    1212: touch-panel-type  ( -- n )  select-touch-panel  h# bd twsi-b@  ;
    1313: get-tm1414-data  ( -- x y finger-mask )
     
    3030
    3131: compass@  ( -- x y z temp id )
    32    h# 3c 4 set-twsi-target
     32   h# 1e 4 set-twsi-target
    3333   0 0 twsi-b!      \ Config register A
    3434   h# 50 1 twsi-b!  \ Config register B
     
    4141;
    4242
    43 : select-pmic  ( -- )  h# 78 1 set-twsi-target  ;
     43: select-pmic  ( -- )  h# 3c 1 set-twsi-target  ;
    4444
    4545: accel-power-on  ( -- )  \ LDO8 - vout is 36, ctl is 34
     
    5353;
    5454: accel@  ( -- x y z temp id )
    55    h# 70 4 set-twsi-target
     55   h# 38 4 set-twsi-target
    5656
    5757   2 twsi-b@ 6 rshift     ( x-low )
     
    6868
    6969: init-pals  ( -- )
    70    h# b0 4 set-twsi-target  \ Set PS parameters address
     70   h# 58 4 set-twsi-target  \ Set PS parameters address
    7171   0 1 twsi-out             \ clear interrupt settings
    7272
    73    h# 22 4 set-twsi-target  \ Device init address
     73   h# 11 4 set-twsi-target  \ Device init address
    7474   h# 10 1 twsi-out         \ Init device
    7575
    76    h# 20 4 set-twsi-target  \ Ambient Light Sensor address
     76   h# 10 4 set-twsi-target  \ Ambient Light Sensor address
    7777   2 1 twsi-out             \ Enable ALS in most sensitive mode, 16-bit data
    7878;
    7979: als@  ( -- n )
    80    h# 22 4 set-twsi-target  \ Ambient Light Sensor LSB address
     80   h# 11 4 set-twsi-target  \ Ambient Light Sensor LSB address
    8181   0 1 twsi-get            ( low )
    82    h# 20 4 set-twsi-target  \ Ambient Light Sensor MSB address
     82   h# 10 4 set-twsi-target  \ Ambient Light Sensor MSB address
    8383   0 1 twsi-get  bwjoin   ( n )
    8484;
    8585
    8686: proximity@  ( -- byte )
    87    h# b0 4 set-twsi-target  \ Proximity Sensor address
     87   h# 58 4 set-twsi-target  \ Proximity Sensor address
    8888   0 1 twsi-get            ( byte )
    8989;
     
    129129: twsi-bcd@   ( reg# -- binary )  twsi-b@ bcd>  ;
    130130: get-rtc  ( -- )
    131    h# d0 1 set-twsi-target
     131   h# 68 1 set-twsi-target
    132132
    133133\   3 twsi-b@   ( dow )
     
    143143
    144144: core-voltage!  ( mv -- )
    145    h# c0 1 set-twsi-target  \ MAX8649 power management IC
     145   h# 60 1 set-twsi-target  \ MAX8649 power management IC
    146146
    147147   d# 750 umax  d# 1350 umin   \ Clipped voltage
     
    151151;
    152152: core-voltage@  ( -- mv )
    153    h# c0 1 set-twsi-target  \ MAX8649 power management IC
     153   h# 60 1 set-twsi-target  \ MAX8649 power management IC
    154154   2 twsi-b@     ( code )
    155155   h# 7f and     ( offset-mv/10 )
  • cpu/arm/mmp2/dsi.fth

    r3132 r3183  
    4646   d# 83 gpio-clr  1 ms  d# 83 gpio-set  1 ms  \ LCD_RST_N line resets DSI bridge
    4747   
    48    h# 16 5 set-twsi-target    \ TWSI address of TC358762 MIPI DSI bridge
     48   h# 0b 5 set-twsi-target    \ TWSI address of TC358762 MIPI DSI bridge
    4949   \ Data   Reg#.......
    5050   0  h# 047c dsi-twsi!  \ Turn off sleep mode
     
    143143: .dsiw  ( index -- )  dup 3 u.r space dsi-twsi-w@ 8 u.r cr  ;
    144144: dump-dsi  ( -- )
    145    16 5 set-twsi-target
     145   0b 5 set-twsi-target
    146146   47c .dsi
    147147   210 .dsi
  • cpu/arm/mmp2/twsi.fth

    r3174 r3183  
    4343: set-twsi-target  ( slave channel -- )  \ Channel numbers range from 1 to 6
    4444   set-twsi-channel
    45    to slave-address
     45   2* to slave-address
    4646;
    4747
     
    196196
    197197
    198 0 0  " 34" " /i2c@d4011000" begin-package  \ TWSI1
     1980 0  " 1a" " /i2c@d4011000" begin-package  \ TWSI1
    199199   " audio-codec" name
    200200   " realtek,alc5631" +compatible
  • cpu/arm/mmp3/thunderstone/boardtwsi.fth

    r3132 r3183  
    99\ 6 HDMI DDC EDID a0
    1010
    11 : select-touch-panel  ( -- )  h# 40 5 set-twsi-target  ;
     11: select-touch-panel  ( -- )  h# 20 5 set-twsi-target  ;
    1212: touch-panel-type  ( -- n )  select-touch-panel  h# bd twsi-b@  ;
    1313: get-tm1414-data  ( -- x y finger-mask )
     
    3030
    3131: compass@  ( -- x y z temp id )
    32    h# 3c 4 set-twsi-target
     32   h# 1e 4 set-twsi-target
    3333   0 0 twsi-b!      \ Config register A
    3434   h# 50 1 twsi-b!  \ Config register B
     
    4141;
    4242
    43 : select-pmic  ( -- )  h# 78 1 set-twsi-target  ;
     43: select-pmic  ( -- )  h# 3c 1 set-twsi-target  ;
    4444
    4545: accel-power-on  ( -- )  \ LDO8 - vout is 36, ctl is 34
     
    5353;
    5454: accel@  ( -- x y z temp id )
    55    h# 70 4 set-twsi-target
     55   h# 38 4 set-twsi-target
    5656
    5757   2 twsi-b@ 6 rshift     ( x-low )
     
    6868
    6969: init-pals  ( -- )
    70    h# b0 4 set-twsi-target  \ Set PS parameters address
     70   h# 58 4 set-twsi-target  \ Set PS parameters address
    7171   0 1 twsi-out             \ clear interrupt settings
    7272
    73    h# 22 4 set-twsi-target  \ Device init address
     73   h# 11 4 set-twsi-target  \ Device init address
    7474   h# 10 1 twsi-out         \ Init device
    7575
    76    h# 20 4 set-twsi-target  \ Ambient Light Sensor address
     76   h# 10 4 set-twsi-target  \ Ambient Light Sensor address
    7777   2 1 twsi-out             \ Enable ALS in most sensitive mode, 16-bit data
    7878;
    7979: als@  ( -- n )
    80    h# 22 4 set-twsi-target  \ Ambient Light Sensor LSB address
     80   h# 11 4 set-twsi-target  \ Ambient Light Sensor LSB address
    8181   0 1 twsi-get            ( low )
    82    h# 20 4 set-twsi-target  \ Ambient Light Sensor MSB address
     82   h# 10 4 set-twsi-target  \ Ambient Light Sensor MSB address
    8383   0 1 twsi-get  bwjoin   ( n )
    8484;
    8585
    8686: proximity@  ( -- byte )
    87    h# b0 4 set-twsi-target  \ Proximity Sensor address
     87   h# 58 4 set-twsi-target  \ Proximity Sensor address
    8888   0 1 twsi-get            ( byte )
    8989;
     
    129129: twsi-bcd@   ( reg# -- binary )  twsi-b@ bcd>  ;
    130130: get-rtc  ( -- )
    131    h# d0 1 set-twsi-target
     131   h# 68 1 set-twsi-target
    132132
    133133\   3 twsi-b@   ( dow )
     
    143143
    144144: core-voltage!  ( mv -- )
    145    h# c0 1 set-twsi-target  \ MAX8649 power management IC
     145   h# 60 1 set-twsi-target  \ MAX8649 power management IC
    146146
    147147   d# 750 umax  d# 1350 umin   \ Clipped voltage
     
    151151;
    152152: core-voltage@  ( -- mv )
    153    h# c0 1 set-twsi-target  \ MAX8649 power management IC
     153   h# 60 1 set-twsi-target  \ MAX8649 power management IC
    154154   2 twsi-b@     ( code )
    155155   h# 7f and     ( offset-mv/10 )
  • cpu/arm/olpc/1.75/compass.fth

    r3049 r3183  
    55   compass-scl-gpio# to smb-clock-gpio#
    66   compass-sda-gpio# to smb-data-gpio#
    7    h# 3c to smb-slave
     7   h# 1e to smb-slave
    88   smb-data-gpio# gpio-dir-out
    99;
     
    3636" combo-accelerometer" name
    3737
    38 \ : set-sensor-slave  ( -- )  h# 30 6 set-twsi-target  ;
     38\ : set-sensor-slave  ( -- )  h# 18 6 set-twsi-target  ;
    3939: set-sensor-slave  ( -- )
    4040   4 to smb-clock-gpio#
    4141   5 to smb-data-gpio#
    42    h# 30 to smb-slave
     42   h# 18 to smb-slave
    4343   smb-data-gpio# gpio-dir-out
    4444;
  • cpu/arm/olpc/accelerometer.fth

    r2726 r3183  
    33" accelerometer" name
    44
     5\ reg is set dynamically by probing to find which chip is present
    56\ my-address my-space encode-phys  " reg" property
    67
     
    150151      d#  50 to min-x  d#  50 to min-y  d#  50 to min-z
    151152      d# 150 to max-x  d# 150 to max-y  d# 450 to max-z
    152       h# 32 6 encode-phys " reg" property
     153      h# 19 6 encode-phys " reg" property
    153154      ['] lis3dhtr-selftest to lis-selftest
    154155   else
     
    159160      d#  20 to min-x  d#  20 to min-y  d#  20 to min-z
    160161      d# 400 to max-x  d# 400 to max-y  d# 400 to max-z
    161       h# 3a 6 encode-phys " reg" property
     162      h# 1d 6 encode-phys " reg" property
    162163      ['] lis33de-selftest to lis-selftest
    163164   then
  • cpu/arm/olpc/nn-touchscreen.fth

    r3170 r3183  
    22purpose: Driver and diagnostic for Neonode zForce MultiSensing I2C Touchscreen
    33
    4 0 0  " 4,a0"  " /twsi" begin-package
     40 0  " 4,50"  " /twsi" begin-package
    55my-space encode-int  my-address encode-int encode+  " reg" property
    66
  • cpu/arm/olpc/rtc.fth

    r3049 r3183  
    2323: rtc!  ( byte reg# -- )  set-address  smb-byte!  ;
    2424[else]
    25 : set-address  ( -- )   h# d0 2 set-twsi-target  ;
     25: set-address  ( -- )   h# 68 2 set-twsi-target  ;
    2626: rtc@  ( reg# -- byte )  set-address  twsi-b@  ;
    2727: rtc!  ( byte reg# -- )  set-address  twsi-b!  ;
  • cpu/arm/olpc/sound.fth

    r3125 r3183  
    265265
    266266[ifdef] cl2-a1
    267 : choose-smbus  ( -- )  h# 30 1 set-twsi-target  ;
     267: choose-smbus  ( -- )  h# 18 1 set-twsi-target  ;
    268268[else]
    269 : choose-smbus  ( -- )  h# 34 1 set-twsi-target  ;
     269: choose-smbus  ( -- )  h# 1a 1 set-twsi-target  ;
    270270[then]
    271271
Note: See TracChangeset for help on using the changeset viewer.