xref: /linux/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml (revision 3264d9e5cf453fc9d392dfbaca3ba0afd1c54462)
1*3264d9e5SSerge Semin# SPDX-License-Identifier: GPL-2.0-only
2*3264d9e5SSerge Semin%YAML 1.2
3*3264d9e5SSerge Semin---
4*3264d9e5SSerge Semin$id: http://devicetree.org/schemas/i2c/snps,designware-i2c.yaml#
5*3264d9e5SSerge Semin$schema: http://devicetree.org/meta-schemas/core.yaml#
6*3264d9e5SSerge Semin
7*3264d9e5SSerge Semintitle: Synopsys DesignWare APB I2C Controller
8*3264d9e5SSerge Semin
9*3264d9e5SSerge Seminmaintainers:
10*3264d9e5SSerge Semin  - Jarkko Nikula <jarkko.nikula@linux.intel.com>
11*3264d9e5SSerge Semin
12*3264d9e5SSerge SeminallOf:
13*3264d9e5SSerge Semin  - $ref: /schemas/i2c/i2c-controller.yaml#
14*3264d9e5SSerge Semin  - if:
15*3264d9e5SSerge Semin      properties:
16*3264d9e5SSerge Semin        compatible:
17*3264d9e5SSerge Semin          not:
18*3264d9e5SSerge Semin            contains:
19*3264d9e5SSerge Semin              const: mscc,ocelot-i2c
20*3264d9e5SSerge Semin    then:
21*3264d9e5SSerge Semin      properties:
22*3264d9e5SSerge Semin        reg:
23*3264d9e5SSerge Semin          maxItems: 1
24*3264d9e5SSerge Semin
25*3264d9e5SSerge Seminproperties:
26*3264d9e5SSerge Semin  compatible:
27*3264d9e5SSerge Semin    oneOf:
28*3264d9e5SSerge Semin      - description: Generic Synopsys DesignWare I2C controller
29*3264d9e5SSerge Semin        const: snps,designware-i2c
30*3264d9e5SSerge Semin      - description: Microsemi Ocelot SoCs I2C controller
31*3264d9e5SSerge Semin        items:
32*3264d9e5SSerge Semin          - const: mscc,ocelot-i2c
33*3264d9e5SSerge Semin          - const: snps,designware-i2c
34*3264d9e5SSerge Semin
35*3264d9e5SSerge Semin  reg:
36*3264d9e5SSerge Semin    minItems: 1
37*3264d9e5SSerge Semin    items:
38*3264d9e5SSerge Semin      - description: DW APB I2C controller memory mapped registers
39*3264d9e5SSerge Semin      - description: |
40*3264d9e5SSerge Semin          ICPU_CFG:TWI_DELAY registers to setup the SDA hold time.
41*3264d9e5SSerge Semin          This registers are specific to the Ocelot I2C-controller.
42*3264d9e5SSerge Semin
43*3264d9e5SSerge Semin  interrupts:
44*3264d9e5SSerge Semin    maxItems: 1
45*3264d9e5SSerge Semin
46*3264d9e5SSerge Semin  clocks:
47*3264d9e5SSerge Semin    minItems: 1
48*3264d9e5SSerge Semin    items:
49*3264d9e5SSerge Semin      - description: I2C controller reference clock source
50*3264d9e5SSerge Semin      - description: APB interface clock source
51*3264d9e5SSerge Semin
52*3264d9e5SSerge Semin  clock-names:
53*3264d9e5SSerge Semin    minItems: 1
54*3264d9e5SSerge Semin    items:
55*3264d9e5SSerge Semin      - const: ref
56*3264d9e5SSerge Semin      - const: pclk
57*3264d9e5SSerge Semin
58*3264d9e5SSerge Semin  resets:
59*3264d9e5SSerge Semin    maxItems: 1
60*3264d9e5SSerge Semin
61*3264d9e5SSerge Semin  clock-frequency:
62*3264d9e5SSerge Semin    description: Desired I2C bus clock frequency in Hz
63*3264d9e5SSerge Semin    enum: [100000, 400000, 1000000, 3400000]
64*3264d9e5SSerge Semin    default: 400000
65*3264d9e5SSerge Semin
66*3264d9e5SSerge Semin  i2c-sda-hold-time-ns:
67*3264d9e5SSerge Semin    maxItems: 1
68*3264d9e5SSerge Semin    description: |
69*3264d9e5SSerge Semin      The property should contain the SDA hold time in nanoseconds. This option
70*3264d9e5SSerge Semin      is only supported in hardware blocks version 1.11a or newer or on
71*3264d9e5SSerge Semin      Microsemi SoCs.
72*3264d9e5SSerge Semin
73*3264d9e5SSerge Semin  i2c-scl-falling-time-ns:
74*3264d9e5SSerge Semin    maxItems: 1
75*3264d9e5SSerge Semin    description: |
76*3264d9e5SSerge Semin      The property should contain the SCL falling time in nanoseconds.
77*3264d9e5SSerge Semin      This value is used to compute the tLOW period.
78*3264d9e5SSerge Semin    default: 300
79*3264d9e5SSerge Semin
80*3264d9e5SSerge Semin  i2c-sda-falling-time-ns:
81*3264d9e5SSerge Semin    maxItems: 1
82*3264d9e5SSerge Semin    description: |
83*3264d9e5SSerge Semin      The property should contain the SDA falling time in nanoseconds.
84*3264d9e5SSerge Semin      This value is used to compute the tHIGH period.
85*3264d9e5SSerge Semin    default: 300
86*3264d9e5SSerge Semin
87*3264d9e5SSerge Semin  dmas:
88*3264d9e5SSerge Semin    items:
89*3264d9e5SSerge Semin      - description: TX DMA Channel
90*3264d9e5SSerge Semin      - description: RX DMA Channel
91*3264d9e5SSerge Semin
92*3264d9e5SSerge Semin  dma-names:
93*3264d9e5SSerge Semin    items:
94*3264d9e5SSerge Semin      - const: tx
95*3264d9e5SSerge Semin      - const: rx
96*3264d9e5SSerge Semin
97*3264d9e5SSerge SeminunevaluatedProperties: false
98*3264d9e5SSerge Semin
99*3264d9e5SSerge Seminrequired:
100*3264d9e5SSerge Semin  - compatible
101*3264d9e5SSerge Semin  - reg
102*3264d9e5SSerge Semin  - "#address-cells"
103*3264d9e5SSerge Semin  - "#size-cells"
104*3264d9e5SSerge Semin  - interrupts
105*3264d9e5SSerge Semin
106*3264d9e5SSerge Seminexamples:
107*3264d9e5SSerge Semin  - |
108*3264d9e5SSerge Semin    i2c@f0000 {
109*3264d9e5SSerge Semin      compatible = "snps,designware-i2c";
110*3264d9e5SSerge Semin      reg = <0xf0000 0x1000>;
111*3264d9e5SSerge Semin      #address-cells = <1>;
112*3264d9e5SSerge Semin      #size-cells = <0>;
113*3264d9e5SSerge Semin      interrupts = <11>;
114*3264d9e5SSerge Semin      clock-frequency = <400000>;
115*3264d9e5SSerge Semin    };
116*3264d9e5SSerge Semin  - |
117*3264d9e5SSerge Semin    i2c@1120000 {
118*3264d9e5SSerge Semin      compatible = "snps,designware-i2c";
119*3264d9e5SSerge Semin      reg = <0x1120000 0x1000>;
120*3264d9e5SSerge Semin      #address-cells = <1>;
121*3264d9e5SSerge Semin      #size-cells = <0>;
122*3264d9e5SSerge Semin      interrupts = <12 1>;
123*3264d9e5SSerge Semin      clock-frequency = <400000>;
124*3264d9e5SSerge Semin      i2c-sda-hold-time-ns = <300>;
125*3264d9e5SSerge Semin      i2c-sda-falling-time-ns = <300>;
126*3264d9e5SSerge Semin      i2c-scl-falling-time-ns = <300>;
127*3264d9e5SSerge Semin    };
128*3264d9e5SSerge Semin  - |
129*3264d9e5SSerge Semin    i2c@2000 {
130*3264d9e5SSerge Semin      compatible = "snps,designware-i2c";
131*3264d9e5SSerge Semin      reg = <0x2000 0x100>;
132*3264d9e5SSerge Semin      #address-cells = <1>;
133*3264d9e5SSerge Semin      #size-cells = <0>;
134*3264d9e5SSerge Semin      clock-frequency = <400000>;
135*3264d9e5SSerge Semin      clocks = <&i2cclk>;
136*3264d9e5SSerge Semin      interrupts = <0>;
137*3264d9e5SSerge Semin
138*3264d9e5SSerge Semin      eeprom@64 {
139*3264d9e5SSerge Semin        compatible = "linux,slave-24c02";
140*3264d9e5SSerge Semin        reg = <0x40000064>;
141*3264d9e5SSerge Semin      };
142*3264d9e5SSerge Semin    };
143*3264d9e5SSerge Semin  - |
144*3264d9e5SSerge Semin    i2c@100400 {
145*3264d9e5SSerge Semin      compatible = "mscc,ocelot-i2c", "snps,designware-i2c";
146*3264d9e5SSerge Semin      reg = <0x100400 0x100>, <0x198 0x8>;
147*3264d9e5SSerge Semin      pinctrl-0 = <&i2c_pins>;
148*3264d9e5SSerge Semin      pinctrl-names = "default";
149*3264d9e5SSerge Semin      #address-cells = <1>;
150*3264d9e5SSerge Semin      #size-cells = <0>;
151*3264d9e5SSerge Semin      interrupts = <8>;
152*3264d9e5SSerge Semin      clocks = <&ahb_clk>;
153*3264d9e5SSerge Semin    };
154*3264d9e5SSerge Semin...
155