xref: /linux/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1f10a9b72SThierry Reding# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2f10a9b72SThierry Reding%YAML 1.2
3f10a9b72SThierry Reding---
4f10a9b72SThierry Reding$id: http://devicetree.org/schemas/i2c/nvidia,tegra20-i2c.yaml#
5f10a9b72SThierry Reding$schema: http://devicetree.org/meta-schemas/core.yaml#
6f10a9b72SThierry Reding
7f10a9b72SThierry Redingmaintainers:
8f10a9b72SThierry Reding  - Thierry Reding <thierry.reding@gmail.com>
9f10a9b72SThierry Reding  - Jon Hunter <jonathanh@nvidia.com>
10f10a9b72SThierry Reding
11f10a9b72SThierry Redingtitle: NVIDIA Tegra I2C controller driver
12f10a9b72SThierry Reding
13f10a9b72SThierry Redingproperties:
14f10a9b72SThierry Reding  compatible:
15f10a9b72SThierry Reding    oneOf:
16f10a9b72SThierry Reding      - description: Tegra20 has 4 generic I2C controller. This can support
17f10a9b72SThierry Reding          master and slave mode of I2C communication. The i2c-tegra driver
18f10a9b72SThierry Reding          only support master mode of I2C communication. Driver of I2C
19f10a9b72SThierry Reding          controller is only compatible with "nvidia,tegra20-i2c".
20f10a9b72SThierry Reding        const: nvidia,tegra20-i2c
21f10a9b72SThierry Reding      - description: Tegra20 has specific I2C controller called as DVC I2C
22f10a9b72SThierry Reding          controller. This only support master mode of I2C communication.
23f10a9b72SThierry Reding          Register interface/offset and interrupts handling are different than
24f10a9b72SThierry Reding          generic I2C controller. Driver of DVC I2C controller is only
25f10a9b72SThierry Reding          compatible with "nvidia,tegra20-i2c-dvc".
26f10a9b72SThierry Reding        const: nvidia,tegra20-i2c-dvc
27f10a9b72SThierry Reding      - description: |
28f10a9b72SThierry Reding          Tegra30 has 5 generic I2C controller. This controller is very much
29f10a9b72SThierry Reding          similar to Tegra20 I2C controller with additional feature: Continue
30f10a9b72SThierry Reding          Transfer Support. This feature helps to implement M_NO_START as per
31f10a9b72SThierry Reding          I2C core API transfer flags. Driver of I2C controller is compatible
32f10a9b72SThierry Reding          with "nvidia,tegra30-i2c" to enable the continue transfer support.
33f10a9b72SThierry Reding          This is also compatible with "nvidia,tegra20-i2c" without continue
34f10a9b72SThierry Reding          transfer support.
35f10a9b72SThierry Reding        items:
36f10a9b72SThierry Reding          - const: nvidia,tegra30-i2c
37f10a9b72SThierry Reding          - const: nvidia,tegra20-i2c
38f10a9b72SThierry Reding      - description: |
39f10a9b72SThierry Reding          Tegra114 has 5 generic I2C controllers. This controller is very much
40f10a9b72SThierry Reding          similar to Tegra30 I2C controller with some hardware modification:
41f10a9b72SThierry Reding            - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk
42f10a9b72SThierry Reding              and fast-clk. Tegra114 has only one clock source called as
43f10a9b72SThierry Reding              div-clk and hence clock mechanism is changed in I2C controller.
44f10a9b72SThierry Reding            - Tegra30/Tegra20 I2C controller has enabled per packet transfer
45f10a9b72SThierry Reding              by default and there is no way to disable it. Tegra114 has this
46f10a9b72SThierry Reding              interrupt disable by default and SW need to enable explicitly.
47f10a9b72SThierry Reding          Due to above changes, Tegra114 I2C driver makes incompatible with
48f10a9b72SThierry Reding          previous hardware driver. Hence, Tegra114 I2C controller is
49f10a9b72SThierry Reding          compatible with "nvidia,tegra114-i2c".
50f10a9b72SThierry Reding        const: nvidia,tegra114-i2c
51f10a9b72SThierry Reding      - description: |
52f10a9b72SThierry Reding          Tegra124 has 6 generic I2C controllers. These controllers are very
53f10a9b72SThierry Reding          similar to those found on Tegra114 but also contain several hardware
54f10a9b72SThierry Reding          improvements and new registers.
55f10a9b72SThierry Reding        const: nvidia,tegra124-i2c
56f10a9b72SThierry Reding      - description: |
57f10a9b72SThierry Reding          Tegra210 has 6 generic I2C controllers. These controllers are very
58f10a9b72SThierry Reding          similar to those found on Tegra124.
59f10a9b72SThierry Reding        items:
60f10a9b72SThierry Reding          - const: nvidia,tegra210-i2c
61f10a9b72SThierry Reding          - const: nvidia,tegra124-i2c
62f10a9b72SThierry Reding      - description: |
63f10a9b72SThierry Reding          Tegra210 has one I2C controller that is on host1x bus and is part of
64f10a9b72SThierry Reding          the VE power domain and typically used for camera use-cases. This VI
65f10a9b72SThierry Reding          I2C controller is mostly compatible with the programming model of
66f10a9b72SThierry Reding          the regular I2C controllers with a few exceptions. The I2C registers
67f10a9b72SThierry Reding          start at an offset of 0xc00 (instead of 0), registers are 16 bytes
68f10a9b72SThierry Reding          apart (rather than 4) and the controller does not support slave
69f10a9b72SThierry Reding          mode.
70f10a9b72SThierry Reding        const: nvidia,tegra210-i2c-vi
71f10a9b72SThierry Reding      - description: |
72f10a9b72SThierry Reding          Tegra186 has 9 generic I2C controllers, two of which are in the AON
73f10a9b72SThierry Reding          (always-on) partition of the SoC. All of these controllers are very
74f10a9b72SThierry Reding          similar to those found on Tegra210.
75f10a9b72SThierry Reding        const: nvidia,tegra186-i2c
76f10a9b72SThierry Reding      - description: |
77f10a9b72SThierry Reding          Tegra194 has 8 generic I2C controllers, two of which are in the AON
78f10a9b72SThierry Reding          (always-on) partition of the SoC. All of these controllers are very
79f10a9b72SThierry Reding          similar to those found on Tegra186. However, these controllers have
80f10a9b72SThierry Reding          support for 64 KiB transactions whereas earlier chips supported no
81f10a9b72SThierry Reding          more than 4 KiB per transactions.
82f10a9b72SThierry Reding        const: nvidia,tegra194-i2c
83f10a9b72SThierry Reding
84f10a9b72SThierry Reding  reg:
85f10a9b72SThierry Reding    maxItems: 1
86f10a9b72SThierry Reding
87f10a9b72SThierry Reding  interrupts:
88f10a9b72SThierry Reding    maxItems: 1
89f10a9b72SThierry Reding
90f10a9b72SThierry Reding  clocks:
91f10a9b72SThierry Reding    minItems: 1
92f10a9b72SThierry Reding    maxItems: 2
93f10a9b72SThierry Reding
94f10a9b72SThierry Reding  clock-names:
95f10a9b72SThierry Reding    minItems: 1
96f10a9b72SThierry Reding    maxItems: 2
97f10a9b72SThierry Reding
98f10a9b72SThierry Reding  resets:
99f10a9b72SThierry Reding    items:
100f10a9b72SThierry Reding      - description: module reset
101f10a9b72SThierry Reding
102f10a9b72SThierry Reding  reset-names:
103f10a9b72SThierry Reding    items:
104f10a9b72SThierry Reding      - const: i2c
105f10a9b72SThierry Reding
106*3a04293bSKrzysztof Kozlowski  power-domains:
107*3a04293bSKrzysztof Kozlowski    maxItems: 1
108*3a04293bSKrzysztof Kozlowski
109f10a9b72SThierry Reding  dmas:
110f10a9b72SThierry Reding    items:
111f10a9b72SThierry Reding      - description: DMA channel for the reception FIFO
112f10a9b72SThierry Reding      - description: DMA channel for the transmission FIFO
113f10a9b72SThierry Reding
114f10a9b72SThierry Reding  dma-names:
115f10a9b72SThierry Reding    items:
116f10a9b72SThierry Reding      - const: rx
117f10a9b72SThierry Reding      - const: tx
118f10a9b72SThierry Reding
119f10a9b72SThierry RedingallOf:
120f10a9b72SThierry Reding  - $ref: /schemas/i2c/i2c-controller.yaml
121f10a9b72SThierry Reding  - if:
122f10a9b72SThierry Reding      properties:
123f10a9b72SThierry Reding        compatible:
124f10a9b72SThierry Reding          contains:
125f10a9b72SThierry Reding            enum:
126f10a9b72SThierry Reding              - nvidia,tegra20-i2c
127f10a9b72SThierry Reding              - nvidia,tegra30-i2c
128f10a9b72SThierry Reding    then:
129f10a9b72SThierry Reding      properties:
1306d88bb79SKrzysztof Kozlowski        clocks:
1316d88bb79SKrzysztof Kozlowski          minItems: 2
132f10a9b72SThierry Reding        clock-names:
133f10a9b72SThierry Reding          items:
134f10a9b72SThierry Reding            - const: div-clk
135f10a9b72SThierry Reding            - const: fast-clk
136f10a9b72SThierry Reding
137f10a9b72SThierry Reding  - if:
138f10a9b72SThierry Reding      properties:
139f10a9b72SThierry Reding        compatible:
140f10a9b72SThierry Reding          contains:
14113b09d0fSKrzysztof Kozlowski            enum:
14213b09d0fSKrzysztof Kozlowski              - nvidia,tegra114-i2c
14313b09d0fSKrzysztof Kozlowski              - nvidia,tegra210-i2c
144f10a9b72SThierry Reding    then:
145f10a9b72SThierry Reding      properties:
1466d88bb79SKrzysztof Kozlowski        clocks:
1476d88bb79SKrzysztof Kozlowski          maxItems: 1
148f10a9b72SThierry Reding        clock-names:
149f10a9b72SThierry Reding          items:
150f10a9b72SThierry Reding            - const: div-clk
151f10a9b72SThierry Reding
152f10a9b72SThierry Reding  - if:
153f10a9b72SThierry Reding      properties:
154f10a9b72SThierry Reding        compatible:
155f10a9b72SThierry Reding          contains:
156f10a9b72SThierry Reding            const: nvidia,tegra210-i2c-vi
157f10a9b72SThierry Reding    then:
158f10a9b72SThierry Reding      properties:
1596d88bb79SKrzysztof Kozlowski        clocks:
1606d88bb79SKrzysztof Kozlowski          minItems: 2
161f10a9b72SThierry Reding        clock-names:
162f10a9b72SThierry Reding          items:
163f10a9b72SThierry Reding            - const: div-clk
164f10a9b72SThierry Reding            - const: slow
165f10a9b72SThierry Reding        power-domains:
166f10a9b72SThierry Reding          items:
167f10a9b72SThierry Reding            - description: phandle to the VENC power domain
168*3a04293bSKrzysztof Kozlowski    else:
169*3a04293bSKrzysztof Kozlowski      properties:
170*3a04293bSKrzysztof Kozlowski        power-domains: false
171f10a9b72SThierry Reding
172f10a9b72SThierry RedingunevaluatedProperties: false
173f10a9b72SThierry Reding
174f10a9b72SThierry Redingexamples:
175f10a9b72SThierry Reding  - |
176f10a9b72SThierry Reding    i2c@7000c000 {
177f10a9b72SThierry Reding        compatible = "nvidia,tegra20-i2c";
178f10a9b72SThierry Reding        reg = <0x7000c000 0x100>;
179f10a9b72SThierry Reding        interrupts = <0 38 0x04>;
180f10a9b72SThierry Reding        clocks = <&tegra_car 12>, <&tegra_car 124>;
181f10a9b72SThierry Reding        clock-names = "div-clk", "fast-clk";
182f10a9b72SThierry Reding        resets = <&tegra_car 12>;
183f10a9b72SThierry Reding        reset-names = "i2c";
184f10a9b72SThierry Reding        dmas = <&apbdma 16>, <&apbdma 16>;
185f10a9b72SThierry Reding        dma-names = "rx", "tx";
186f10a9b72SThierry Reding
187f10a9b72SThierry Reding        #address-cells = <1>;
188f10a9b72SThierry Reding        #size-cells = <0>;
189f10a9b72SThierry Reding    };
190