Merge tag 'xfs-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / i3c / i3c.txt
1 Generic device tree bindings for I3C busses
2 ===========================================
3
4 This document describes generic bindings that should be used to describe I3C
5 busses in a device tree.
6
7 Required properties
8 -------------------
9
10 - #address-cells  - should be <3>. Read more about addresses below.
11 - #size-cells     - should be <0>.
12 - compatible      - name of the I3C master controller driving the I3C bus
13
14 For other required properties e.g. to describe register sets,
15 clocks, etc. check the binding documentation of the specific driver.
16 The node describing an I3C bus should be named i3c-master.
17
18 Optional properties
19 -------------------
20
21 These properties may not be supported by all I3C master drivers. Each I3C
22 master bindings should specify which of them are supported.
23
24 - i3c-scl-hz: frequency of the SCL signal used for I3C transfers.
25               When undefined the core sets it to 12.5MHz.
26
27 - i2c-scl-hz: frequency of the SCL signal used for I2C transfers.
28               When undefined, the core looks at LVR (Legacy Virtual Register)
29               values of I2C devices described in the device tree to determine
30               the maximum I2C frequency.
31
32 I2C devices
33 ===========
34
35 Each I2C device connected to the bus should be described in a subnode. All
36 properties described in Documentation/devicetree/bindings/i2c/i2c.txt are
37 valid here, but several new properties have been added.
38
39 New constraint on existing properties:
40 --------------------------------------
41 - reg: contains 3 cells
42   + first cell : still encoding the I2C address
43
44   + second cell: shall be 0
45
46   + third cell: shall encode the I3C LVR (Legacy Virtual Register)
47         bit[31:8]: unused/ignored
48         bit[7:5]: I2C device index. Possible values
49         * 0: I2C device has a 50 ns spike filter
50         * 1: I2C device does not have a 50 ns spike filter but supports high
51              frequency on SCL
52         * 2: I2C device does not have a 50 ns spike filter and is not tolerant
53              to high frequencies
54         * 3-7: reserved
55
56         bit[4]: tell whether the device operates in FM (Fast Mode) or FM+ mode
57         * 0: FM+ mode
58         * 1: FM mode
59
60         bit[3:0]: device type
61         * 0-15: reserved
62
63 The I2C node unit-address should always match the first cell of the reg
64 property: <device-type>@<i2c-address>.
65
66 I3C devices
67 ===========
68
69 All I3C devices are supposed to support DAA (Dynamic Address Assignment), and
70 are thus discoverable. So, by default, I3C devices do not have to be described
71 in the device tree.
72 This being said, one might want to attach extra resources to these devices,
73 and those resources may have to be described in the device tree, which in turn
74 means we have to describe I3C devices.
75
76 Another use case for describing an I3C device in the device tree is when this
77 I3C device has a static I2C address and we want to assign it a specific I3C
78 dynamic address before the DAA takes place (so that other devices on the bus
79 can't take this dynamic address).
80
81 The I3C device should be names <device-type>@<static-i2c-address>,<i3c-pid>,
82 where device-type is describing the type of device connected on the bus
83 (gpio-controller, sensor, ...).
84
85 Required properties
86 -------------------
87 - reg: contains 3 cells
88   + first cell : encodes the static I2C address. Should be 0 if the device does
89                  not have one (0 is not a valid I2C address).
90
91   + second and third cells: should encode the ProvisionalID. The second cell
92                             contains the manufacturer ID left-shifted by 1.
93                             The third cell contains ORing of the part ID
94                             left-shifted by 16, the instance ID left-shifted
95                             by 12 and the extra information. This encoding is
96                             following the PID definition provided by the I3C
97                             specification.
98
99 Optional properties
100 -------------------
101 - assigned-address: dynamic address to be assigned to this device. This
102                     property is only valid if the I3C device has a static
103                     address (first cell of the reg property != 0).
104
105
106 Example:
107
108         i3c-master@d040000 {
109                 compatible = "cdns,i3c-master";
110                 clocks = <&coreclock>, <&i3csysclock>;
111                 clock-names = "pclk", "sysclk";
112                 interrupts = <3 0>;
113                 reg = <0x0d040000 0x1000>;
114                 #address-cells = <3>;
115                 #size-cells = <0>;
116                 i2c-scl-hz = <100000>;
117
118                 /* I2C device. */
119                 nunchuk: nunchuk@52 {
120                         compatible = "nintendo,nunchuk";
121                         reg = <0x52 0x0 0x10>;
122                 };
123
124                 /* I3C device with a static I2C address. */
125                 thermal_sensor: sensor@68,39200144004 {
126                         reg = <0x68 0x392 0x144004>;
127                         assigned-address = <0xa>;
128                 };
129
130                 /*
131                  * I3C device without a static I2C address but requiring
132                  * resources described in the DT.
133                  */
134                 sensor@0,39200154004 {
135                         reg = <0x0 0x392 0x154004>;
136                         clocks = <&clock_provider 0>;
137                 };
138         };