xref: /linux/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml (revision b1809ee932101dbf1b29e860b06d1c26310f2f91)
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:
10f4eedebdSPatrice Chotard  - Pierre-Yves MORDRET <pierre-yves.mordret@foss.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
20d074684aSAlain 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
28*b1809ee9SRob Herring    else:
29*b1809ee9SRob Herring      properties:
30*b1809ee9SRob Herring        st,syscfg-fmp: false
31f33dabf5SAlain Volmat
32f33dabf5SAlain Volmat  - if:
33f33dabf5SAlain Volmat      properties:
34f33dabf5SAlain Volmat        compatible:
35f33dabf5SAlain Volmat          contains:
36f33dabf5SAlain Volmat            enum:
37f33dabf5SAlain Volmat              - st,stm32f4-i2c
38f33dabf5SAlain Volmat    then:
39f33dabf5SAlain Volmat      properties:
40f33dabf5SAlain Volmat        clock-frequency:
41f33dabf5SAlain Volmat          enum: [100000, 400000]
42f33dabf5SAlain Volmat
43f33dabf5SAlain Volmatproperties:
44f33dabf5SAlain Volmat  compatible:
45f33dabf5SAlain Volmat    enum:
46f33dabf5SAlain Volmat      - st,stm32f4-i2c
47f33dabf5SAlain Volmat      - st,stm32f7-i2c
48d074684aSAlain Volmat      - st,stm32mp15-i2c
49f33dabf5SAlain Volmat
50f33dabf5SAlain Volmat  reg:
51f33dabf5SAlain Volmat    maxItems: 1
52f33dabf5SAlain Volmat
53f33dabf5SAlain Volmat  interrupts:
54f33dabf5SAlain Volmat    items:
55f33dabf5SAlain Volmat      - description: interrupt ID for I2C event
56f33dabf5SAlain Volmat      - description: interrupt ID for I2C error
57f33dabf5SAlain Volmat
58f33dabf5SAlain Volmat  resets:
59f33dabf5SAlain Volmat    maxItems: 1
60f33dabf5SAlain Volmat
61f33dabf5SAlain Volmat  clocks:
62f33dabf5SAlain Volmat    maxItems: 1
63f33dabf5SAlain Volmat
64f33dabf5SAlain Volmat  dmas:
65f33dabf5SAlain Volmat    items:
66f33dabf5SAlain Volmat      - description: RX DMA Channel phandle
67f33dabf5SAlain Volmat      - description: TX DMA Channel phandle
68f33dabf5SAlain Volmat
69f33dabf5SAlain Volmat  dma-names:
70f33dabf5SAlain Volmat    items:
71f33dabf5SAlain Volmat      - const: rx
72f33dabf5SAlain Volmat      - const: tx
73f33dabf5SAlain Volmat
74f33dabf5SAlain Volmat  clock-frequency:
75f33dabf5SAlain Volmat    description: Desired I2C bus clock frequency in Hz. If not specified,
76f33dabf5SAlain Volmat                 the default 100 kHz frequency will be used.
77dd16163eSAlain Volmat                 For STM32F7, STM32H7 and STM32MP1 SoCs, if timing parameters
78dd16163eSAlain Volmat                 match, the bus clock frequency can be from 1Hz to 1MHz.
79f33dabf5SAlain Volmat    default: 100000
80dd16163eSAlain Volmat    minimum: 1
81dd16163eSAlain Volmat    maximum: 1000000
82f33dabf5SAlain Volmat
83*b1809ee9SRob Herring  st,syscfg-fmp:
84*b1809ee9SRob Herring    description: Use to set Fast Mode Plus bit within SYSCFG when Fast Mode
85*b1809ee9SRob Herring      Plus speed is selected by slave.
86*b1809ee9SRob Herring    $ref: "/schemas/types.yaml#/definitions/phandle-array"
87*b1809ee9SRob Herring    items:
88*b1809ee9SRob Herring      - items:
89*b1809ee9SRob Herring          - description: phandle to syscfg
90*b1809ee9SRob Herring          - description: register offset within syscfg
91*b1809ee9SRob Herring          - description: register bitmask for FMP bit
92*b1809ee9SRob Herring
93f33dabf5SAlain Volmatrequired:
94f33dabf5SAlain Volmat  - compatible
95f33dabf5SAlain Volmat  - reg
96f33dabf5SAlain Volmat  - interrupts
97f33dabf5SAlain Volmat  - resets
98f33dabf5SAlain Volmat  - clocks
99f33dabf5SAlain Volmat
1006fdc6e23SRob HerringunevaluatedProperties: false
1016fdc6e23SRob Herring
102f33dabf5SAlain Volmatexamples:
103f33dabf5SAlain Volmat  - |
104f33dabf5SAlain Volmat    #include <dt-bindings/mfd/stm32f7-rcc.h>
105f33dabf5SAlain Volmat    #include <dt-bindings/clock/stm32fx-clock.h>
106f33dabf5SAlain Volmat    //Example 1 (with st,stm32f4-i2c compatible)
107f33dabf5SAlain Volmat      i2c@40005400 {
108f33dabf5SAlain Volmat          compatible = "st,stm32f4-i2c";
109f33dabf5SAlain Volmat          #address-cells = <1>;
110f33dabf5SAlain Volmat          #size-cells = <0>;
111f33dabf5SAlain Volmat          reg = <0x40005400 0x400>;
112f33dabf5SAlain Volmat          interrupts = <31>,
113f33dabf5SAlain Volmat                       <32>;
114f33dabf5SAlain Volmat          resets = <&rcc 277>;
115f33dabf5SAlain Volmat          clocks = <&rcc 0 149>;
116f33dabf5SAlain Volmat      };
117f33dabf5SAlain Volmat
118f364d2c6SRob Herring  - |
119f364d2c6SRob Herring    #include <dt-bindings/mfd/stm32f7-rcc.h>
120f364d2c6SRob Herring    #include <dt-bindings/clock/stm32fx-clock.h>
121f33dabf5SAlain Volmat    //Example 2 (with st,stm32f7-i2c compatible)
122f33dabf5SAlain Volmat      i2c@40005800 {
123f33dabf5SAlain Volmat          compatible = "st,stm32f7-i2c";
124f33dabf5SAlain Volmat          #address-cells = <1>;
125f33dabf5SAlain Volmat          #size-cells = <0>;
126f33dabf5SAlain Volmat          reg = <0x40005800 0x400>;
127f33dabf5SAlain Volmat          interrupts = <31>,
128f33dabf5SAlain Volmat                       <32>;
129f33dabf5SAlain Volmat          resets = <&rcc STM32F7_APB1_RESET(I2C1)>;
130f33dabf5SAlain Volmat          clocks = <&rcc 1 CLK_I2C1>;
131f33dabf5SAlain Volmat      };
132f33dabf5SAlain Volmat
133f364d2c6SRob Herring  - |
134f364d2c6SRob Herring    #include <dt-bindings/mfd/stm32f7-rcc.h>
135f364d2c6SRob Herring    #include <dt-bindings/clock/stm32fx-clock.h>
136d074684aSAlain Volmat    //Example 3 (with st,stm32mp15-i2c compatible on stm32mp)
137f33dabf5SAlain Volmat    #include <dt-bindings/interrupt-controller/arm-gic.h>
138f33dabf5SAlain Volmat    #include <dt-bindings/clock/stm32mp1-clks.h>
139f33dabf5SAlain Volmat    #include <dt-bindings/reset/stm32mp1-resets.h>
140f33dabf5SAlain Volmat      i2c@40013000 {
141d074684aSAlain Volmat          compatible = "st,stm32mp15-i2c";
142f33dabf5SAlain Volmat          #address-cells = <1>;
143f33dabf5SAlain Volmat          #size-cells = <0>;
144f33dabf5SAlain Volmat          reg = <0x40013000 0x400>;
145f33dabf5SAlain Volmat          interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
146f33dabf5SAlain Volmat                       <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
147f33dabf5SAlain Volmat          clocks = <&rcc I2C2_K>;
148f33dabf5SAlain Volmat          resets = <&rcc I2C2_R>;
149f33dabf5SAlain Volmat          i2c-scl-rising-time-ns = <185>;
150f33dabf5SAlain Volmat          i2c-scl-falling-time-ns = <20>;
151f33dabf5SAlain Volmat          st,syscfg-fmp = <&syscfg 0x4 0x2>;
152f33dabf5SAlain Volmat      };
153