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