1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/media/nxp,imx8mq-mipi-csi2.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: NXP i.MX8MQ MIPI CSI-2 receiver
8
9maintainers:
10  - Martin Kepplinger <martin.kepplinger@puri.sm>
11
12description: |-
13  This binding covers the CSI-2 RX PHY and host controller included in the
14  NXP i.MX8MQ SoC. It handles the sensor/image input and process for all the
15  input imaging devices.
16
17properties:
18  compatible:
19    enum:
20      - fsl,imx8mq-mipi-csi2
21
22  reg:
23    maxItems: 1
24
25  clocks:
26    items:
27      - description: core is the RX Controller Core Clock input. This clock
28                     must be exactly equal to or faster than the receive
29                     byteclock from the RX DPHY.
30      - description: esc is the Rx Escape Clock. This must be the same escape
31                     clock that the RX DPHY receives.
32      - description: ui is the pixel clock (phy_ref up to 333Mhz).
33                     See the reference manual for details.
34
35  clock-names:
36    items:
37      - const: core
38      - const: esc
39      - const: ui
40
41  power-domains:
42    maxItems: 1
43
44  resets:
45    items:
46      - description: CORE_RESET reset register bit definition
47      - description: PHY_REF_RESET reset register bit definition
48      - description: ESC_RESET reset register bit definition
49
50  fsl,mipi-phy-gpr:
51    description: |
52      The phandle to the imx8mq syscon iomux-gpr with the register
53      for setting RX_ENABLE for the mipi receiver.
54
55      The format should be as follows:
56      <gpr req_gpr>
57      gpr is the phandle to general purpose register node.
58      req_gpr is the gpr register offset of RX_ENABLE for the mipi phy.
59    $ref: /schemas/types.yaml#/definitions/phandle-array
60    items:
61      items:
62        - description: The 'gpr' is the phandle to general purpose register node.
63        - description: The 'req_gpr' is the gpr register offset containing
64                       CSI2_1_RX_ENABLE or CSI2_2_RX_ENABLE respectively.
65          maximum: 0xff
66
67  interconnects:
68    maxItems: 1
69
70  interconnect-names:
71    const: dram
72
73  ports:
74    $ref: /schemas/graph.yaml#/properties/ports
75
76    properties:
77      port@0:
78        $ref: /schemas/graph.yaml#/$defs/port-base
79        unevaluatedProperties: false
80        description:
81          Input port node, single endpoint describing the CSI-2 transmitter.
82
83        properties:
84          endpoint:
85            $ref: video-interfaces.yaml#
86            unevaluatedProperties: false
87
88            properties:
89              data-lanes:
90                items:
91                  minItems: 1
92                  maxItems: 4
93                  items:
94                    - const: 1
95                    - const: 2
96                    - const: 3
97                    - const: 4
98
99            required:
100              - data-lanes
101
102      port@1:
103        $ref: /schemas/graph.yaml#/properties/port
104        description:
105          Output port node
106
107    required:
108      - port@0
109      - port@1
110
111required:
112  - compatible
113  - reg
114  - clocks
115  - clock-names
116  - power-domains
117  - resets
118  - fsl,mipi-phy-gpr
119  - ports
120
121additionalProperties: false
122
123examples:
124  - |
125    #include <dt-bindings/clock/imx8mq-clock.h>
126    #include <dt-bindings/interconnect/imx8mq.h>
127    #include <dt-bindings/reset/imx8mq-reset.h>
128
129    csi@30a70000 {
130        compatible = "fsl,imx8mq-mipi-csi2";
131        reg = <0x30a70000 0x1000>;
132        clocks = <&clk IMX8MQ_CLK_CSI1_CORE>,
133                 <&clk IMX8MQ_CLK_CSI1_ESC>,
134                 <&clk IMX8MQ_CLK_CSI1_PHY_REF>;
135        clock-names = "core", "esc", "ui";
136        assigned-clocks = <&clk IMX8MQ_CLK_CSI1_CORE>,
137                          <&clk IMX8MQ_CLK_CSI1_PHY_REF>,
138                          <&clk IMX8MQ_CLK_CSI1_ESC>;
139        assigned-clock-rates = <266000000>, <200000000>, <66000000>;
140        assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_266M>,
141                                 <&clk IMX8MQ_SYS2_PLL_1000M>,
142                                 <&clk IMX8MQ_SYS1_PLL_800M>;
143        power-domains = <&pgc_mipi_csi1>;
144        resets = <&src IMX8MQ_RESET_MIPI_CSI1_CORE_RESET>,
145                 <&src IMX8MQ_RESET_MIPI_CSI1_PHY_REF_RESET>,
146                 <&src IMX8MQ_RESET_MIPI_CSI1_ESC_RESET>;
147        fsl,mipi-phy-gpr = <&iomuxc_gpr 0x88>;
148        interconnects = <&noc IMX8MQ_ICM_CSI1 &noc IMX8MQ_ICS_DRAM>;
149        interconnect-names = "dram";
150
151        ports {
152            #address-cells = <1>;
153            #size-cells = <0>;
154
155            port@0 {
156                reg = <0>;
157
158                imx8mm_mipi_csi_in: endpoint {
159                    remote-endpoint = <&imx477_out>;
160                    data-lanes = <1 2 3 4>;
161                };
162            };
163
164            port@1 {
165                reg = <1>;
166
167                imx8mm_mipi_csi_out: endpoint {
168                    remote-endpoint = <&csi_in>;
169                };
170            };
171        };
172    };
173
174...
175