xref: /linux/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml (revision d074684a268dd4ffeb7b1e8ff497a30bdfc0867f)
1f33dabf5SAlain Volmat# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2f33dabf5SAlain Volmat%YAML 1.2
3f33dabf5SAlain Volmat---
4f33dabf5SAlain Volmat$id: http://devicetree.org/schemas/i2c/st,stm32-i2c.yaml#
5f33dabf5SAlain Volmat$schema: http://devicetree.org/meta-schemas/core.yaml#
6f33dabf5SAlain Volmat
7f33dabf5SAlain Volmattitle: I2C controller embedded in STMicroelectronics STM32 I2C platform
8f33dabf5SAlain Volmat
9f33dabf5SAlain Volmatmaintainers:
10f33dabf5SAlain Volmat  - Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
11f33dabf5SAlain Volmat
12f33dabf5SAlain VolmatallOf:
13f33dabf5SAlain Volmat  - $ref: /schemas/i2c/i2c-controller.yaml#
14f33dabf5SAlain Volmat  - if:
15f33dabf5SAlain Volmat      properties:
16f33dabf5SAlain Volmat        compatible:
17f33dabf5SAlain Volmat          contains:
18f33dabf5SAlain Volmat            enum:
19f33dabf5SAlain Volmat              - st,stm32f7-i2c
20*d074684aSAlain Volmat              - st,stm32mp15-i2c
21f33dabf5SAlain Volmat    then:
22f33dabf5SAlain Volmat      properties:
23f33dabf5SAlain Volmat        i2c-scl-rising-time-ns:
24f33dabf5SAlain Volmat          default: 25
25f33dabf5SAlain Volmat
26f33dabf5SAlain Volmat        i2c-scl-falling-time-ns:
27f33dabf5SAlain Volmat          default: 10
28f33dabf5SAlain Volmat
29f33dabf5SAlain Volmat        st,syscfg-fmp:
30f33dabf5SAlain Volmat          description: Use to set Fast Mode Plus bit within SYSCFG when
31f33dabf5SAlain Volmat                       Fast Mode Plus speed is selected by slave.
32f33dabf5SAlain Volmat                       Format is phandle to syscfg / register offset within
33f33dabf5SAlain Volmat                       syscfg / register bitmask for FMP bit.
34f33dabf5SAlain Volmat          allOf:
35f33dabf5SAlain Volmat            - $ref: "/schemas/types.yaml#/definitions/phandle-array"
36f33dabf5SAlain Volmat            - items:
37f33dabf5SAlain Volmat                minItems: 3
38f33dabf5SAlain Volmat                maxItems: 3
39f33dabf5SAlain Volmat
40f33dabf5SAlain Volmat  - if:
41f33dabf5SAlain Volmat      properties:
42f33dabf5SAlain Volmat        compatible:
43f33dabf5SAlain Volmat          contains:
44f33dabf5SAlain Volmat            enum:
45f33dabf5SAlain Volmat              - st,stm32f4-i2c
46f33dabf5SAlain Volmat    then:
47f33dabf5SAlain Volmat      properties:
48f33dabf5SAlain Volmat        clock-frequency:
49f33dabf5SAlain Volmat          enum: [100000, 400000]
50f33dabf5SAlain Volmat
51f33dabf5SAlain Volmatproperties:
52f33dabf5SAlain Volmat  compatible:
53f33dabf5SAlain Volmat    enum:
54f33dabf5SAlain Volmat      - st,stm32f4-i2c
55f33dabf5SAlain Volmat      - st,stm32f7-i2c
56*d074684aSAlain Volmat      - st,stm32mp15-i2c
57f33dabf5SAlain Volmat
58f33dabf5SAlain Volmat  reg:
59f33dabf5SAlain Volmat    maxItems: 1
60f33dabf5SAlain Volmat
61f33dabf5SAlain Volmat  interrupts:
62f33dabf5SAlain Volmat    items:
63f33dabf5SAlain Volmat      - description: interrupt ID for I2C event
64f33dabf5SAlain Volmat      - description: interrupt ID for I2C error
65f33dabf5SAlain Volmat
66f33dabf5SAlain Volmat  resets:
67f33dabf5SAlain Volmat    maxItems: 1
68f33dabf5SAlain Volmat
69f33dabf5SAlain Volmat  clocks:
70f33dabf5SAlain Volmat    maxItems: 1
71f33dabf5SAlain Volmat
72f33dabf5SAlain Volmat  dmas:
73f33dabf5SAlain Volmat    items:
74f33dabf5SAlain Volmat      - description: RX DMA Channel phandle
75f33dabf5SAlain Volmat      - description: TX DMA Channel phandle
76f33dabf5SAlain Volmat
77f33dabf5SAlain Volmat  dma-names:
78f33dabf5SAlain Volmat    items:
79f33dabf5SAlain Volmat      - const: rx
80f33dabf5SAlain Volmat      - const: tx
81f33dabf5SAlain Volmat
82f33dabf5SAlain Volmat  clock-frequency:
83f33dabf5SAlain Volmat    description: Desired I2C bus clock frequency in Hz. If not specified,
84f33dabf5SAlain Volmat                 the default 100 kHz frequency will be used.
85f33dabf5SAlain Volmat                 For STM32F7, STM32H7 and STM32MP1 SoCs, Standard-mode,
86f33dabf5SAlain Volmat                 Fast-mode and Fast-mode Plus are supported, possible
87f33dabf5SAlain Volmat                 values are 100000, 400000 and 1000000.
88f33dabf5SAlain Volmat    default: 100000
89f33dabf5SAlain Volmat    enum: [100000, 400000, 1000000]
90f33dabf5SAlain Volmat
91f33dabf5SAlain Volmatrequired:
92f33dabf5SAlain Volmat  - compatible
93f33dabf5SAlain Volmat  - reg
94f33dabf5SAlain Volmat  - interrupts
95f33dabf5SAlain Volmat  - resets
96f33dabf5SAlain Volmat  - clocks
97f33dabf5SAlain Volmat
98f33dabf5SAlain Volmatexamples:
99f33dabf5SAlain Volmat  - |
100f33dabf5SAlain Volmat    #include <dt-bindings/mfd/stm32f7-rcc.h>
101f33dabf5SAlain Volmat    #include <dt-bindings/clock/stm32fx-clock.h>
102f33dabf5SAlain Volmat    //Example 1 (with st,stm32f4-i2c compatible)
103f33dabf5SAlain Volmat      i2c@40005400 {
104f33dabf5SAlain Volmat          compatible = "st,stm32f4-i2c";
105f33dabf5SAlain Volmat          #address-cells = <1>;
106f33dabf5SAlain Volmat          #size-cells = <0>;
107f33dabf5SAlain Volmat          reg = <0x40005400 0x400>;
108f33dabf5SAlain Volmat          interrupts = <31>,
109f33dabf5SAlain Volmat                       <32>;
110f33dabf5SAlain Volmat          resets = <&rcc 277>;
111f33dabf5SAlain Volmat          clocks = <&rcc 0 149>;
112f33dabf5SAlain Volmat      };
113f33dabf5SAlain Volmat
114f33dabf5SAlain Volmat    //Example 2 (with st,stm32f7-i2c compatible)
115f33dabf5SAlain Volmat      i2c@40005800 {
116f33dabf5SAlain Volmat          compatible = "st,stm32f7-i2c";
117f33dabf5SAlain Volmat          #address-cells = <1>;
118f33dabf5SAlain Volmat          #size-cells = <0>;
119f33dabf5SAlain Volmat          reg = <0x40005800 0x400>;
120f33dabf5SAlain Volmat          interrupts = <31>,
121f33dabf5SAlain Volmat                       <32>;
122f33dabf5SAlain Volmat          resets = <&rcc STM32F7_APB1_RESET(I2C1)>;
123f33dabf5SAlain Volmat          clocks = <&rcc 1 CLK_I2C1>;
124f33dabf5SAlain Volmat      };
125f33dabf5SAlain Volmat
126*d074684aSAlain Volmat    //Example 3 (with st,stm32mp15-i2c compatible on stm32mp)
127f33dabf5SAlain Volmat    #include <dt-bindings/interrupt-controller/arm-gic.h>
128f33dabf5SAlain Volmat    #include <dt-bindings/clock/stm32mp1-clks.h>
129f33dabf5SAlain Volmat    #include <dt-bindings/reset/stm32mp1-resets.h>
130f33dabf5SAlain Volmat      i2c@40013000 {
131*d074684aSAlain Volmat          compatible = "st,stm32mp15-i2c";
132f33dabf5SAlain Volmat          #address-cells = <1>;
133f33dabf5SAlain Volmat          #size-cells = <0>;
134f33dabf5SAlain Volmat          reg = <0x40013000 0x400>;
135f33dabf5SAlain Volmat          interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
136f33dabf5SAlain Volmat                       <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
137f33dabf5SAlain Volmat          clocks = <&rcc I2C2_K>;
138f33dabf5SAlain Volmat          resets = <&rcc I2C2_R>;
139f33dabf5SAlain Volmat          i2c-scl-rising-time-ns = <185>;
140f33dabf5SAlain Volmat          i2c-scl-falling-time-ns = <20>;
141f33dabf5SAlain Volmat          st,syscfg-fmp = <&syscfg 0x4 0x2>;
142f33dabf5SAlain Volmat      };
143f33dabf5SAlain Volmat...
144