Path: blob/main/sys/contrib/device-tree/Bindings/i3c/i3c.txt
48378 views
Generic device tree bindings for I3C busses1===========================================23This document describes generic bindings that should be used to describe I3C4busses in a device tree.56Required properties7-------------------89- #address-cells - should be <3>. Read more about addresses below.10- #size-cells - should be <0>.11- compatible - name of the I3C master controller driving the I3C bus1213For other required properties e.g. to describe register sets,14clocks, etc. check the binding documentation of the specific driver.15The node describing an I3C bus should be named i3c-master.1617Optional properties18-------------------1920These properties may not be supported by all I3C master drivers. Each I3C21master bindings should specify which of them are supported.2223- i3c-scl-hz: frequency of the SCL signal used for I3C transfers.24When undefined the core sets it to 12.5MHz.2526- i2c-scl-hz: frequency of the SCL signal used for I2C transfers.27When undefined, the core looks at LVR (Legacy Virtual Register)28values of I2C devices described in the device tree to determine29the maximum I2C frequency.3031I2C devices32===========3334Each I2C device connected to the bus should be described in a subnode. All35properties described in Documentation/devicetree/bindings/i2c/i2c.txt are36valid here, but several new properties have been added.3738New constraint on existing properties:39--------------------------------------40- reg: contains 3 cells41+ first cell : still encoding the I2C address. 10 bit addressing is not42supported. Devices with 10 bit address can't be properly passed through43DEFSLVS command.4445+ second cell: shall be 04647+ third cell: shall encode the I3C LVR (Legacy Virtual Register)48bit[31:8]: unused/ignored49bit[7:5]: I2C device index. Possible values50* 0: I2C device has a 50 ns spike filter51* 1: I2C device does not have a 50 ns spike filter but supports high52frequency on SCL53* 2: I2C device does not have a 50 ns spike filter and is not tolerant54to high frequencies55* 3-7: reserved5657bit[4]: tell whether the device operates in FM (Fast Mode) or FM+ mode58* 0: FM+ mode59* 1: FM mode6061bit[3:0]: device type62* 0-15: reserved6364The I2C node unit-address should always match the first cell of the reg65property: <device-type>@<i2c-address>.6667I3C devices68===========6970All I3C devices are supposed to support DAA (Dynamic Address Assignment), and71are thus discoverable. So, by default, I3C devices do not have to be described72in the device tree.73This being said, one might want to attach extra resources to these devices,74and those resources may have to be described in the device tree, which in turn75means we have to describe I3C devices.7677Another use case for describing an I3C device in the device tree is when this78I3C device has a static I2C address and we want to assign it a specific I3C79dynamic address before the DAA takes place (so that other devices on the bus80can't take this dynamic address).8182The I3C device should be names <device-type>@<static-i2c-address>,<i3c-pid>,83where device-type is describing the type of device connected on the bus84(gpio-controller, sensor, ...).8586Required properties87-------------------88- reg: contains 3 cells89+ first cell : encodes the static I2C address. Should be 0 if the device does90not have one (0 is not a valid I2C address).9192+ second and third cells: should encode the ProvisionalID. The second cell93contains the manufacturer ID left-shifted by 1.94The third cell contains ORing of the part ID95left-shifted by 16, the instance ID left-shifted96by 12 and the extra information. This encoding is97following the PID definition provided by the I3C98specification.99100Optional properties101-------------------102- assigned-address: dynamic address to be assigned to this device. This103property is only valid if the I3C device has a static104address (first cell of the reg property != 0).105106107Example:108109i3c-master@d040000 {110compatible = "cdns,i3c-master";111clocks = <&coreclock>, <&i3csysclock>;112clock-names = "pclk", "sysclk";113interrupts = <3 0>;114reg = <0x0d040000 0x1000>;115#address-cells = <3>;116#size-cells = <0>;117i2c-scl-hz = <100000>;118119/* I2C device. */120nunchuk: nunchuk@52 {121compatible = "nintendo,nunchuk";122reg = <0x52 0x0 0x10>;123};124125/* I3C device with a static I2C address. */126thermal_sensor: sensor@68,39200144004 {127reg = <0x68 0x392 0x144004>;128assigned-address = <0xa>;129};130131/*132* I3C device without a static I2C address but requiring133* resources described in the DT.134*/135sensor@0,39200154004 {136reg = <0x0 0x392 0x154004>;137clocks = <&clock_provider 0>;138};139};140141142