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