DART-MX8M I2C: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use RELEASE_MORTY_V1.0_DART-MX8M as default
<!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.0_DART-MX8M as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release|RELEASE_SUMO_V1.0_DART-MX8M}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_MORTY_V1.0_DART-MX8M}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} I2C}} {{DocImage|category1=Yocto|category2=DART-MX8M}}[[Category:DART-MX8M-MINI]] __toc__
--> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} I2C}} {{DocImage|category1=Yocto|category2=Android}}[[Category:Debian]][[Category:{{#var:HARDWARE_NAME}}]]__toc__


= Available I2C buses =
= Available I2C buses =
List I2C available devices:
List I2C available devices:
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS |
<pre>
# ls -l /dev/i2c-*
crw------- 1 root root 89, 0 Jul  4 09:09 /dev/i2c-0
crw------- 1 root root 89, 1 Jul  4 09:09 /dev/i2c-1
crw------- 1 root root 89, 2 Jul  4 09:09 /dev/i2c-2
crw------- 1 root root 89, 3 Jul  4 09:09 /dev/i2c-3
crw------- 1 root root 89, 4 Jul  4 09:09 /dev/i2c-4
</pre>
System class:
<pre>
# ls /sys/class/i2c-dev/
i2c-0  i2c-1  i2c-2  i2c-3 i2c-4
</pre>
|
<pre>
<pre>
# ls -l /dev/i2c-*
# ls -l /dev/i2c-*
Line 18: Line 34:
i2c-0  i2c-1  i2c-2  i2c-3
i2c-0  i2c-1  i2c-2  i2c-3
</pre>
</pre>
}}


= I2C devices per bus =
= I2C devices per bus =
Line 73: Line 90:
70: -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
</pre>
</pre>
|
| {{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-MINI |
Scan bus 0:
Scan bus 0:
<pre>
<pre>
Line 126: Line 143:
70: -- -- -- -- -- -- -- --                         
70: -- -- -- -- -- -- -- --                         
</pre>
</pre>
}}
|{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO |
Scan bus 0:
<pre>
# i2cdetect -y -r 0
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
50: -- -- 52 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                     
</pre>
Scan bus 1:
<pre>
# i2cdetect -y -r 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU UU -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 2:
<pre>
# i2cdetect -y -r 2
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- 54 55 -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 3:
<pre>
# i2cdetect -y -r 3
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
|{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS |
Scan bus 0:
<pre>
# i2cdetect -y -r 0
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- 52 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 1:
<pre>
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- UU -- -- -- UU UU -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- 54 55 -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 2:
<pre>
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 3:
<pre>
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
Scan bus 4:
<pre>
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                       
</pre>
|}} }} }} }}
When the device is marked with "UU" it means that a driver is using it.<br>
When the device is marked with numbers it means that no driver is using it.<br>
                      
                      
= Reading / Writing from an I2C device=
= Reading / Writing from an I2C device=
Line 132: Line 266:
i2cdump - dump the content of an I2C device <br>
i2cdump - dump the content of an I2C device <br>
i2cset  - write a single character to an I2C device<br>
i2cset  - write a single character to an I2C device<br>
i2cget - read a single character to an I2C device.<br>
i2cget - read a single character to an I2C device<br>
<br>
<br>
In addition follow 'C' code example as describe in the linux kernel documentation : https://www.kernel.org/doc/Documentation/i2c/dev-interface
In addition follow 'C' code example as describe in the linux kernel documentation : https://www.kernel.org/doc/Documentation/i2c/dev-interface


= Variscite's system integrated I2C devices =
= Variscite's system integrated I2C devices =
{{note|Note: Don't manipulate Variscite on-SOM EEPROM, or you will damage the SOM!|info}}
{{note|Note: Do not write to Variscite's on-SOM EEPROM or you will damage the SOM!|info}}
When the device is marked with "UU" it means that a driver is using it.
 
<br/>When the device is marked with numbers it means that no driver is using it.
<br/>Variscite devices:
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
Variscite devices:
<pre>
<pre>
I2C-0 0x08 – PMIC on SOM
I2C-0 0x08 – PMIC on SOM
Line 150: Line 283:
I2C-0 0x60 - i.MX8M ARM voltage regulator on SOM
I2C-0 0x60 - i.MX8M ARM voltage regulator on SOM


I2C-1 0x38 – Capacitive touch controller on carrier board
I2C-1 0x38 – Capacitive touch controller on kit display
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
I2C-1 0x3d – USB Type C controller on carrier board
Line 159: Line 292:
I2C-2 0x60 - i.MX8M SoC voltage regulator on SOM
I2C-2 0x60 - i.MX8M SoC voltage regulator on SOM


I2C-3 0x20 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x21 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x3c – MIPI-CSI camera on expansion board
I2C-3 0x3c – MIPI-CSI camera on expansion board
</pre>
|{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-MINI |
Variscite devices on DART-MX8M-MINI:
<pre>
I2C-0 0x2c - MIPI-LVDS bridge on SOM
I2C-0 0x4b – PMIC on SOM
I2C-0 0x52 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!


I2C-1 0x38 – Capacitive touch controller on kit display
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
I2C-1 0x54 - EEPROM on carrier board
I2C-1 0x55 - EEPROM on carrier board
I2C-1 0x68 – RTC on carrier board
I2C-2 0x1a - Audio codec on SOM
I2C-3 0x20 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x21 - TCA6408 GPIO expander on carrier board V2 only
</pre>
</pre>
|
 
Variscite devices on VAR-SOM-MX8M-MINI:
<pre>
I2C-0 0x2c - MIPI-LVDS bridge on SOM
I2C-0 0x4b – PMIC on SOM
I2C-0 0x52 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!
 
I2C-1 0x20 - PCA9534 GPIO expander on carrier board
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
 
I2C-2 0x1a - Audio codec on SOM
I2C-2 0x38 – Capacitive touch controller on kit display
I2C-2 0x54 - EEPROM on carrier board
I2C-2 0x55 - EEPROM on carrier board
I2C-2 0x68 – RTC on carrier board
</pre>
 
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO |
Variscite devices on VAR-SOM-MX8M-NANO:
<pre>
<pre>
I2C-0 0x1a - Audio codec on SOM
I2C-0 0x2c - MIPI-LVDS bridge on SOM
I2C-0 0x2c - MIPI-LVDS bridge on SOM
I2C-0 0x4b – PMIC on SOM
I2C-0 0x4b – PMIC on SOM
Line 170: Line 343:
I2C-0 0x53 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!


I2C-1 0x38 – Capacitive touch controller on carrier board
I2C-1 0x20 - PCA9534 GPIO expander on carrier board
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
 
I2C-2 0x1a - Audio codec on SOM
I2C-2 0x38 – Capacitive touch controller on kit display
I2C-2 0x54 - EEPROM on carrier board
I2C-2 0x55 - EEPROM on carrier board
I2C-2 0x68 – RTC on carrier board
</pre>
|{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS |
Variscite devices on DART-MX8M-PLUS:
<pre>
I2C-0 0x1a - Audio codec on SOM
I2C-0 0x25 – PMIC on SOM
I2C-0 0x52 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!
 
I2C-1 0x38 – Capacitive touch controller on kit display
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
I2C-1 0x3d – USB Type C controller on carrier board
Line 176: Line 367:
I2C-1 0x55 - EEPROM on carrier board
I2C-1 0x55 - EEPROM on carrier board
I2C-1 0x68 – RTC on carrier board
I2C-1 0x68 – RTC on carrier board
I2C-3 0x20 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x21 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x3c - MIPI-CSI camera on expansion board
</pre>
Variscite devices on VAR-SOM-MX8M-PLUS:
<pre>
I2C-0 0x1a - Audio codec on SOM
I2C-0 0x25 – PMIC on SOM
I2C-0 0x52 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!
I2C-2 0x20 - PCA9534 GPIO expander on carrier board
I2C-2 0x3c – MIPI-CSI camera on expansion board
I2C-2 0x3d – USB Type C controller on carrier board
I2C-3 0x38 – Capacitive touch controller on kit display
I2C-3 0x54 - EEPROM on carrier board
I2C-3 0x55 - EEPROM on carrier board
I2C-3 0x68 – RTC on carrier board
</pre>
</pre>
}}
|}} }} }} }}

Revision as of 19:44, 29 January 2022

DART-MX8M I2C

Available I2C buses

List I2C available devices:

# ls -l /dev/i2c-*
crw------- 1 root root 89, 0 Jul  4 09:09 /dev/i2c-0
crw------- 1 root root 89, 1 Jul  4 09:09 /dev/i2c-1
crw------- 1 root root 89, 2 Jul  4 09:09 /dev/i2c-2
crw------- 1 root root 89, 3 Jul  4 09:09 /dev/i2c-3

System class:

# ls /sys/class/i2c-dev/
i2c-0  i2c-1  i2c-2  i2c-3

I2C devices per bus

Scan bus 0:

# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- UU -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- 52 53 -- -- -- -- -- -- -- -- -- -- -- -- 
60: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Scan bus 1:

# i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- UU -- -- -- UU UU -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- 54 55 -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Scan bus 2:

# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Scan bus 3:

                     
# i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

When the device is marked with "UU" it means that a driver is using it.
When the device is marked with numbers it means that no driver is using it.

Reading / Writing from an I2C device

Variscite includes I2CTools as a part of the default file system build, examples of optional commands:
i2cdump - dump the content of an I2C device
i2cset - write a single character to an I2C device
i2cget - read a single character to an I2C device

In addition follow 'C' code example as describe in the linux kernel documentation : https://www.kernel.org/doc/Documentation/i2c/dev-interface

Variscite's system integrated I2C devices

Note: Do not write to Variscite's on-SOM EEPROM or you will damage the SOM!

Variscite devices:

I2C-0 0x08 – PMIC on SOM
I2C-0 0x1a - Audio codec on SOM
I2C-0 0x2c - MIPI-LVDS bridge on SOM
I2C-0 0x52 - EEPROM on SOM. Don't modify!
I2C-0 0x53 - EEPROM on SOM. Don't modify!
I2C-0 0x60 - i.MX8M ARM voltage regulator on SOM

I2C-1 0x38 – Capacitive touch controller on kit display
I2C-1 0x3c – MIPI-CSI camera on expansion board
I2C-1 0x3d – USB Type C controller on carrier board
I2C-1 0x54 - EEPROM on carrier board
I2C-1 0x55 - EEPROM on carrier board
I2C-1 0x68 – RTC on carrier board

I2C-2 0x60 - i.MX8M SoC voltage regulator on SOM

I2C-3 0x20 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x21 - TCA6408 GPIO expander on carrier board V2 only
I2C-3 0x3c – MIPI-CSI camera on expansion board