i3c.yaml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. title: I3C bus
  7. maintainers:
  8. - Alexandre Belloni <alexandre.belloni@bootlin.com>
  9. - Miquel Raynal <miquel.raynal@bootlin.com>
  10. description: |
  11. I3C busses can be described with a node for the primary I3C controller device
  12. and a set of child nodes for each I2C or I3C slave on the bus. Each of them
  13. may, during the life of the bus, request mastership.
  14. properties:
  15. $nodename:
  16. pattern: "^i3c@[0-9a-f]+$"
  17. "#address-cells":
  18. const: 3
  19. description: |
  20. Each I2C device connected to the bus should be described in a subnode.
  21. All I3C devices are supposed to support DAA (Dynamic Address Assignment),
  22. and are thus discoverable. So, by default, I3C devices do not have to be
  23. described in the device tree. This being said, one might want to attach
  24. extra resources to these devices, and those resources may have to be
  25. described in the device tree, which in turn means we have to describe
  26. I3C devices.
  27. Another use case for describing an I3C device in the device tree is when
  28. this I3C device has a static I2C address and we want to assign it a
  29. specific I3C dynamic address before the DAA takes place (so that other
  30. devices on the bus can't take this dynamic address).
  31. "#size-cells":
  32. const: 0
  33. i3c-scl-hz:
  34. description: |
  35. Frequency of the SCL signal used for I3C transfers. When undefined, the
  36. default value should be 12.5MHz.
  37. May not be supported by all controllers.
  38. i2c-scl-hz:
  39. description: |
  40. Frequency of the SCL signal used for I2C transfers. When undefined, the
  41. default should be to look at LVR (Legacy Virtual Register) values of
  42. I2C devices described in the device tree to determine the maximum I2C
  43. frequency.
  44. May not be supported by all controllers.
  45. mctp-controller:
  46. type: boolean
  47. description: |
  48. Indicates that the system is accessible via this bus as an endpoint for
  49. MCTP over I3C transport.
  50. required:
  51. - "#address-cells"
  52. - "#size-cells"
  53. patternProperties:
  54. "@[0-9a-f]+$":
  55. type: object
  56. description: |
  57. I2C child, should be named: <device-type>@<i2c-address>
  58. All properties described in dtschema schemas/i2c/i2c-controller.yaml
  59. are valid here, except the reg property whose content is changed.
  60. properties:
  61. compatible:
  62. description:
  63. Compatible of the I2C device.
  64. reg:
  65. items:
  66. - items:
  67. - description: |
  68. I2C address. 10 bit addressing is not supported. Devices with
  69. 10-bit address can't be properly passed through DEFSLVS
  70. command.
  71. minimum: 0
  72. maximum: 0x7f
  73. - const: 0
  74. - description: |
  75. Shall encode the I3C LVR (Legacy Virtual Register):
  76. See include/dt-bindings/i3c/i3c.h
  77. bit[31:8]: unused/ignored
  78. bit[7:5]: I2C device index. Possible values:
  79. * 0: I2C device has a 50 ns spike filter
  80. * 1: I2C device does not have a 50 ns spike filter but
  81. supports high frequency on SCL
  82. * 2: I2C device does not have a 50 ns spike filter and is
  83. not tolerant to high frequencies
  84. * 3-7: reserved
  85. bit[4]: tell whether the device operates in FM (Fast Mode)
  86. or FM+ mode:
  87. * 0: FM+ mode
  88. * 1: FM mode
  89. bit[3:0]: device type
  90. * 0-15: reserved
  91. required:
  92. - compatible
  93. - reg
  94. "@[0-9a-f]+,[0-9a-f]+$":
  95. type: object
  96. description: |
  97. I3C child, should be named: <device-type>@<static-i2c-address>,<i3c-pid>
  98. properties:
  99. reg:
  100. items:
  101. - items:
  102. - description: |
  103. Encodes the static I2C address. Should be 0 if the device does
  104. not have one (0 is not a valid I2C address).
  105. minimum: 0
  106. maximum: 0x7f
  107. - description: |
  108. First half of the Provisioned ID (following the PID
  109. definition provided by the I3C specification).
  110. Contains the manufacturer ID left-shifted by 1.
  111. - description: |
  112. Second half of the Provisioned ID (following the PID
  113. definition provided by the I3C specification).
  114. Contains the ORing of the part ID left-shifted by 16,
  115. the instance ID left-shifted by 12 and extra information.
  116. assigned-address:
  117. $ref: /schemas/types.yaml#/definitions/uint32
  118. minimum: 0x1
  119. maximum: 0xff
  120. description: |
  121. Dynamic address to be assigned to this device. In case static address is
  122. present (first cell of the reg property != 0), this address is assigned
  123. through SETDASA. If static address is not present, this address is assigned
  124. through SETNEWDA after assigning a temporary address via ENTDAA.
  125. required:
  126. - reg
  127. additionalProperties: true
  128. examples:
  129. - |
  130. #include <dt-bindings/i3c/i3c.h>
  131. i3c@d040000 {
  132. compatible = "cdns,i3c-master";
  133. clocks = <&coreclock>, <&i3csysclock>;
  134. clock-names = "pclk", "sysclk";
  135. interrupts = <3 0>;
  136. reg = <0x0d040000 0x1000>;
  137. #address-cells = <3>;
  138. #size-cells = <0>;
  139. i2c-scl-hz = <100000>;
  140. /* I2C device. */
  141. eeprom@57 {
  142. compatible = "atmel,24c01";
  143. reg = <0x57 0x0 (I2C_FM | I2C_FILTER)>;
  144. pagesize = <0x8>;
  145. };
  146. /* I3C device with a static I2C address and assigned address. */
  147. thermal_sensor: sensor@68,39200144004 {
  148. reg = <0x68 0x392 0x144004>;
  149. assigned-address = <0xa>;
  150. };
  151. /* I3C device with only assigned address. */
  152. pressure_sensor: sensor@0,39200124004 {
  153. reg = <0x0 0x392 0x124000>;
  154. assigned-address = <0xc>;
  155. };
  156. /*
  157. * I3C device without a static I2C address but requiring
  158. * resources described in the DT.
  159. */
  160. sensor@0,39200154004 {
  161. reg = <0x0 0x392 0x154004>;
  162. clocks = <&clock_provider 0>;
  163. };
  164. };