xref: /linux/Documentation/devicetree/bindings/i3c/i3c.yaml (revision 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/i3c/i3c.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: I3C bus
8
9maintainers:
10  - Alexandre Belloni <alexandre.belloni@bootlin.com>
11  - Miquel Raynal <miquel.raynal@bootlin.com>
12
13description: |
14  I3C busses can be described with a node for the primary I3C controller device
15  and a set of child nodes for each I2C or I3C slave on the bus. Each of them
16  may, during the life of the bus, request mastership.
17
18properties:
19  $nodename:
20    pattern: "^i3c@[0-9a-f]+$"
21
22  "#address-cells":
23    const: 3
24    description: |
25      Each I2C device connected to the bus should be described in a subnode.
26
27      All I3C devices are supposed to support DAA (Dynamic Address Assignment),
28      and are thus discoverable. So, by default, I3C devices do not have to be
29      described in the device tree. This being said, one might want to attach
30      extra resources to these devices, and those resources may have to be
31      described in the device tree, which in turn means we have to describe
32      I3C devices.
33
34      Other use-cases for describing an I3C device in the device tree are:
35      - When the I3C device has a static I2C address and we want to assign
36        it a specific I3C dynamic address before the DAA takes place (so
37        that other devices on the bus can't take this dynamic address).
38      - When the I3C device requires SETAASA for its discovery and uses a
39        pre-defined static address.
40
41  "#size-cells":
42    const: 0
43
44  i3c-scl-hz:
45    description: |
46      Frequency of the SCL signal used for I3C transfers. When undefined, the
47      default value should be 12.5MHz.
48
49      May not be supported by all controllers.
50
51  i2c-scl-hz:
52    description: |
53      Frequency of the SCL signal used for I2C transfers. When undefined, the
54      default should be to look at LVR (Legacy Virtual Register) values of
55      I2C devices described in the device tree to determine the maximum I2C
56      frequency.
57
58      May not be supported by all controllers.
59
60  mctp-controller:
61    type: boolean
62    description: |
63      Indicates that the system is accessible via this bus as an endpoint for
64      MCTP over I3C transport.
65
66required:
67  - "#address-cells"
68  - "#size-cells"
69
70patternProperties:
71  "@[0-9a-f]+$":
72    type: object
73    description: |
74      I2C child, should be named: <device-type>@<i2c-address>
75
76      All properties described in dtschema schemas/i2c/i2c-controller.yaml
77      are valid here, except the reg property whose content is changed.
78
79    properties:
80      compatible:
81        description:
82          Compatible of the I2C device.
83
84      reg:
85        items:
86          - items:
87              - description: |
88                  I2C address. 10 bit addressing is not supported. Devices with
89                  10-bit address can't be properly passed through DEFSLVS
90                  command.
91                minimum: 0
92                maximum: 0x7f
93              - const: 0
94              - description: |
95                  Shall encode the I3C LVR (Legacy Virtual Register):
96                  See include/dt-bindings/i3c/i3c.h
97                    bit[31:8]: unused/ignored
98                    bit[7:5]: I2C device index. Possible values:
99                      * 0: I2C device has a 50 ns spike filter
100                      * 1: I2C device does not have a 50 ns spike filter but
101                           supports high frequency on SCL
102                      * 2: I2C device does not have a 50 ns spike filter and is
103                           not tolerant to high frequencies
104                      * 3-7: reserved
105                    bit[4]: tell whether the device operates in FM (Fast Mode)
106                            or FM+ mode:
107                      * 0: FM+ mode
108                      * 1: FM mode
109                    bit[3:0]: device type
110                      * 0-15: reserved
111
112    required:
113      - compatible
114      - reg
115
116  "@[0-9a-f]+,[0-9a-f]+$":
117    type: object
118    description: |
119      I3C child, should be named: <device-type>@<static-i2c-address>,<i3c-pid>
120
121    properties:
122      reg:
123        items:
124          - items:
125              - description: |
126                  Encodes the static I2C address. Should be 0 if the device does
127                  not have one (0 is not a valid I2C address).
128                minimum: 0
129                maximum: 0x7f
130              - description: |
131                  First half of the Provisioned ID (following the PID
132                  definition provided by the I3C specification).
133
134                  Contains the manufacturer ID left-shifted by 1.
135              - description: |
136                  Second half of the Provisioned ID (following the PID
137                  definition provided by the I3C specification).
138
139                  Contains the ORing of the part ID left-shifted by 16,
140                  the instance ID left-shifted by 12 and extra information.
141
142      assigned-address:
143        $ref: /schemas/types.yaml#/definitions/uint32
144        minimum: 0x1
145        maximum: 0xff
146        description: |
147          Dynamic address to be assigned to this device. In case static address is
148          present (first cell of the reg property != 0), this address is assigned
149          through SETDASA. If static address is not present, this address is assigned
150          through SETNEWDA after assigning a temporary address via ENTDAA. If
151          SETAASA is used, this property is not used, and the static address itself
152          becomes the dynamic address.
153
154      mipi-i3c-static-method:
155        $ref: /schemas/types.yaml#/definitions/uint32
156        minimum: 0x1
157        maximum: 0x7
158        default: 1
159        description: |
160          Bitmap describing which methods of Dynamic Address Assignment from a
161          static address are supported by this I3C Target. For each defined bit
162          position, a set bit indicates support for that method and a cleared
163          bit indicates lack of support.
164
165            Bit 0: SETDASA CCC (Direct)
166            Bit 1: SETAASA CCC (Broadcast)
167            Bit 2: Other CCC (vendor / standards extension)
168            All other bits are reserved.
169
170          This property follows the MIPI I3C specification. The primary use
171          of this property is to indicate support for SETAASA, i.e Bit 1, but
172          will allow other values mentioned in the specification so that it
173          mirrors the specification. SETDASA will remain as the default method
174          even if this property is not present.
175
176    required:
177      - reg
178
179additionalProperties: true
180
181examples:
182  - |
183    #include <dt-bindings/i3c/i3c.h>
184
185    i3c@d040000 {
186        compatible = "cdns,i3c-master";
187        clocks = <&coreclock>, <&i3csysclock>;
188        clock-names = "pclk", "sysclk";
189        interrupts = <3 0>;
190        reg = <0x0d040000 0x1000>;
191        #address-cells = <3>;
192        #size-cells = <0>;
193        i2c-scl-hz = <100000>;
194
195        /* I2C device. */
196        eeprom@57 {
197            compatible = "atmel,24c01";
198            reg = <0x57 0x0 (I2C_FM | I2C_FILTER)>;
199            pagesize = <0x8>;
200        };
201
202        /* I3C device with a static I2C address and assigned address. */
203        thermal_sensor: sensor@68,39200144004 {
204            reg = <0x68 0x392 0x144004>;
205            assigned-address = <0xa>;
206        };
207
208        /* I3C device with only assigned address. */
209        pressure_sensor: sensor@0,39200124004 {
210            reg = <0x0 0x392 0x124000>;
211            assigned-address = <0xc>;
212        };
213
214        /*
215         * I3C device without a static I2C address but requiring
216         * resources described in the DT.
217         */
218        sensor@0,39200154004 {
219            reg = <0x0 0x392 0x154004>;
220            clocks = <&clock_provider 0>;
221        };
222    };
223