Using I3C on SAMA7D65

Last modified by Microchip on 2026/05/27 08:01

Introduction

MIPI I3C Host Controller

SAMA7D6 has a dedicated one I3C controller. The MIPI I3C Controller (I3CC) implements the protocol functions related to the I3C bus host as defined in the MIPI I3C Specification. The I3CC provides an interface, as specified in MIPI I3C HCI 1.0 Specification, between the system (application) and the I3C bus, allowing communication between I3C devices and legacy I2C devices, with limitations as specified in MIPI I3C Specification. The I3C system ensures reliable transmission and reception of data. The I3C interface is intended to improve upon the features of the I2C interface, while preserving backward compatibility, with some features not supported, such as clock stretching, clock synchronization, High-Speed mode, and 10-bit addressing.

  • Supports I3C HCI 1.0 PIO Mode
  • Supports Data Transfer to Legacy I2C Devices
  • Supports Various Data Rates (FM, FM+, SDR, HDR-DDR)
  • 8 Addressable Devices
  • Command Queue Comprised of 16 Entries of 32 Bits
  • Response Queue Comprised of 8 Entries
  • Transmit Data Queue Comprised of 64 Entries of 32 Bits
  • Receive Data Queue Comprised of 64 Entries

I/O Lines and Description

Pin NamePin DescriptionType
I3CC_SCLI3C Serial ClockI/O 
I3CC_SDAI3C Serial DataI/O 
I3CC_SDASPUEI3C Serial Data Pull-up EnableO

Defining a I3C Sensor node

The I3C nodes are defined in the DT as per the I3C DT binding Document

- reg: contains 3 cells
  + first cell : encodes the static I2C address. Should be 0 if the device does
         not have one (0 is not a valid I2C address).

  + second and third cells: should encode the ProvisionalID. The second cell
                contains the manufacturer ID left-shifted by 1.
                The third cell contains ORing of the part ID
                left-shifted by 16, the instance ID left-shifted
                by 12 and the extra information. This encoding is
                following the PID definition provided by the I3C
                specification.

Reference:

// I3C device without a static I2C address
sensor@0,208006c100b {
        reg = <0x0 0x208 0x6c100b>;
};

// I3C device with a static I2C address
sensor@68,39200144004 {
        reg = <0x68 0x392 0x144004>;
};

Interfacing with STEVAL MKI239A

The STEVAL-MKI239A is an adaptor board designed to facilitate the evaluation of MEMS devices in the LSM6DSV product family. LSM6DSV is a 6-axis inertial measurement unit (IMU) with embedded sensor fusion, I3C, OIS/EIS for smart applications. SPI / I²C & MIPI I3C® v1.1 serial interface with main processor data synchronization.The LSM6DSV offers flexibility to connect the pins in order to have two different mode connections and functionalities.

STEVAL-MKI239A DataSheet

lsm6dsv_mode_diagram.png

I3C Adaptor board

The LSM6DSV slave is interfaced to the Ourasi curiosity using the in-house I3C adaptor board which fits on the J25 Mikrobus connector. The schematic for the adaptor board is attached below for reference.

Screenshot from 2026-04-08 11-45-21.png

Hardware Setup: Sensor to board

Adapor.jpeg

Adapor_interface.jpeg

Software Support

From Linux4Microchip-2026.04 Release, DT-overlay file sama7d65_curiosity_i3c_lsm6dsv.dtso supports LSM6DSV sensor

Warning

To ensure the MIPI I3C controller probes correctly on the official SAMA7D65-Curiosity Linux4Microchip-2025.10 Release, apply the following vendor prefix fix:

diff ~-~-git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
--i--ndex 15b02159a924..9d48a9de643b 100644
~-~-- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -866,7 +866,7 @@ static void i3c_hci_remove(struct platform_device *pdev)
static const maybe_unused struct of_device_id i3c_hci_of_match[] = {
        { .compatible = "mipi-i3c-hci", },
-       { .compatible = "mchp,sama7d65-i3c-hci",
+       { .compatible = "microchip,sama7d65-i3c-hci",
         .data = (void *)(MCHP_HCI_QUIRK_PIO_MODE | MCHP_HCI_QUIRK_OD_PP_TIMING |
                           MCHP_HCI_QUIRK_RESP_BUF_THLD | MCHP_HCI_QUIRK_SAMA7D65) },
        {},
Warning

Linux4Microchip-2025.10 Release only supports LSM6DSO. To support the LSM6DSV sensor, modify the following.

Modify the sensor reg property in the DT-overlay file sama7d65_curiosity_i3c_lsm6dso.dtso to support LSM6DSV sensor

Ourasi-LSM6DSV

diff --git a/sama7d65_curiosity/sama7d65_curiosity_i3c_lsm6dso.dtso b/sama7d65_curiosity/sama7d65_curiosity_i3c_lsm6dso.dtso
index 62386a4..d9bdb6f 100644
--- a/sama7d65_curiosity/sama7d65_curiosity_i3c_lsm6dso.dtso
+++ b/sama7d65_curiosity/sama7d65_curiosity_i3c_lsm6dso.dtso
@@ -42,8 +42,8 @@
        pinctrl-0 = <&pinctrl_i3c0_default>;
        status = "okay";

-       sensor@0,208006c100b {
-               compatible = "st,lsm6dso";
-               reg = <0x0 0x208 0x6c100b>;
+       sensor@6b,2080070920b{
+               reg = <0x6b 0x208 0x70920b>;
+               assigned-address = <0x6b>;
       };
 };
Add I3C device entry for LSM6DSV

st_lsm6dsx_i3c driver changes

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c
index 3b0c8b19c448..eb4c2583ecaf 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c
@@ -18,6 +18,7 @@
static const struct i3c_device_id st_lsm6dsx_i3c_ids[] = {
        I3C_DEVICE(0x0104, 0x006C, (void *)ST_LSM6DSO_ID),
        I3C_DEVICE(0x0104, 0x006B, (void *)ST_LSM6DSR_ID),
+       I3C_DEVICE(0x0104, 0x0070, (void *)ST_LSM6DSV_ID),
       { /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(i3c, st_lsm6dsx_i3c_ids);

Steps to Test LSM6DSV

To load LSM6DSV from Linux4Microchip-2026.04 release, follow the below steps in the u-boot prompt,

=> editenv bootcmd_boot
edit: fatload mmc 0:1 0x63000000 sama7d65_curiosity.itb; bootm 0x63000000#kernel_dtb${at91_overlays_config}#lsm6dsv
=> saveenv
Saving Environment to FAT... OK
Warning

To load LSM6DSV in Linux4Microchip-2025.10 release by modifying the LSM6DSO overlay file, follow the below steps in the u-boot prompt,

=> editenv bootcmd_boot
edit: fatload mmc 0:1 0x63000000 sama7d65_curiosity.itb; bootm 0x63000000#kernel_dtb${at91_overlays_config}#lsm6dso
=> saveenv
Saving Environment to FAT... OK

In contrast to I2C, there is currently no dedicated Linux utility for testing I3C peripheral devices. However, because I3C devices support Dynamic Address Assignment (DAA), they are inherently discoverable and typically do not require entries in the Device Tree. Once discovered under /sys/bus/i3c, a device can be verified by reading its raw angular velocity data (X, Y, and Z axes) from the corresponding sysfs entries to confirm the sensor is functional.

root@sama7d65-curiosity-sd:# ls /sys/bus/i3c/devices/0-2080070920b/
bcr                             dynamic_address                 iio:device1/                    pid                             supplier:regulator:regulator.0/
dcr                             hdrcap                          modalias                        power/                          uevent
driver/                         iio:device0/                    of_node/                        subsystem/
root@sama7d65-curiosity-sd:# ls /sys/bus/i3c/devices/0-2080070920b/iio\:device
iio:device0/ iio:device1/
root@sama7d65-curiosity-sd:# ls /sys/bus/i3c/devices/0-2080070920b/iio\:device0/
buffer/                       in_anglvel_scale              in_anglvel_z_raw              power/                        subsystem/
buffer0/                      in_anglvel_scale_available    mount_matrix                  sampling_frequency            trigger/
current_timestamp_clock       in_anglvel_x_raw              name                          sampling_frequency_available  uevent
dev                           in_anglvel_y_raw              of_node/                      scan_elements/                waiting_for_supplier
root@sama7d65-curiosity-sd:#  cat /sys/bus/i3c/devices/0-2080070920b/dynamic_address
6b
root@sama7d65-curiosity-sd:# cat /sys/bus/i3c/devices/0-2080070920b/iio\:device0/in_anglvel_x_raw
213
root@sama7d65-curiosity-sd:# cat /sys/bus/i3c/devices/0-2080070920b/iio\:device0/in_anglvel_x_raw
-8170