xref: /freebsd/sys/contrib/device-tree/Bindings/media/nxp,imx7-mipi-csi2.yaml (revision e67e85659c0de33e617e5fbf1028c6e8b49eee53)
15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/media/nxp,imx7-mipi-csi2.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: NXP i.MX7 and i.MX8 MIPI CSI-2 receiver
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
105def4c47SEmmanuel Vadot  - Rui Miguel Silva <rmfrfs@gmail.com>
115956d97fSEmmanuel Vadot  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
125def4c47SEmmanuel Vadot
132eb4d8dcSEmmanuel Vadotdescription: |-
145956d97fSEmmanuel Vadot  The NXP i.MX7 and i.MX8 families contain SoCs that include a MIPI CSI-2
155956d97fSEmmanuel Vadot  receiver IP core named CSIS. The IP core originates from Samsung, and may be
165956d97fSEmmanuel Vadot  compatible with some of the Exynos4 and S5P SoCs. i.MX7 SoCs use CSIS version
175956d97fSEmmanuel Vadot  3.3, and i.MX8 SoCs use CSIS version 3.6.3.
182eb4d8dcSEmmanuel Vadot
192eb4d8dcSEmmanuel Vadot  While the CSI-2 receiver is separate from the MIPI D-PHY IP core, the PHY is
202eb4d8dcSEmmanuel Vadot  completely wrapped by the CSIS and doesn't expose a control interface of its
212eb4d8dcSEmmanuel Vadot  own. This binding thus covers both IP cores.
225def4c47SEmmanuel Vadot
235def4c47SEmmanuel Vadotproperties:
245def4c47SEmmanuel Vadot  compatible:
255956d97fSEmmanuel Vadot    enum:
265956d97fSEmmanuel Vadot      - fsl,imx7-mipi-csi2
275956d97fSEmmanuel Vadot      - fsl,imx8mm-mipi-csi2
285def4c47SEmmanuel Vadot
295def4c47SEmmanuel Vadot  reg:
305def4c47SEmmanuel Vadot    maxItems: 1
315def4c47SEmmanuel Vadot
325def4c47SEmmanuel Vadot  interrupts:
335def4c47SEmmanuel Vadot    maxItems: 1
345def4c47SEmmanuel Vadot
355def4c47SEmmanuel Vadot  clocks:
365956d97fSEmmanuel Vadot    minItems: 3
372eb4d8dcSEmmanuel Vadot    items:
382eb4d8dcSEmmanuel Vadot      - description: The peripheral clock (a.k.a. APB clock)
392eb4d8dcSEmmanuel Vadot      - description: The external clock (optionally used as the pixel clock)
402eb4d8dcSEmmanuel Vadot      - description: The MIPI D-PHY clock
415956d97fSEmmanuel Vadot      - description: The AXI clock
425def4c47SEmmanuel Vadot
435def4c47SEmmanuel Vadot  clock-names:
445956d97fSEmmanuel Vadot    minItems: 3
455def4c47SEmmanuel Vadot    items:
465def4c47SEmmanuel Vadot      - const: pclk
475def4c47SEmmanuel Vadot      - const: wrap
485def4c47SEmmanuel Vadot      - const: phy
495956d97fSEmmanuel Vadot      - const: axi
505def4c47SEmmanuel Vadot
515def4c47SEmmanuel Vadot  power-domains:
525def4c47SEmmanuel Vadot    maxItems: 1
535def4c47SEmmanuel Vadot
545def4c47SEmmanuel Vadot  phy-supply:
552eb4d8dcSEmmanuel Vadot    description: The MIPI D-PHY digital power supply
565def4c47SEmmanuel Vadot
575def4c47SEmmanuel Vadot  resets:
582eb4d8dcSEmmanuel Vadot    items:
592eb4d8dcSEmmanuel Vadot      - description: MIPI D-PHY slave reset
605def4c47SEmmanuel Vadot
615def4c47SEmmanuel Vadot  clock-frequency:
622eb4d8dcSEmmanuel Vadot    description: The desired external clock ("wrap") frequency, in Hz
635def4c47SEmmanuel Vadot    default: 166000000
645def4c47SEmmanuel Vadot
655def4c47SEmmanuel Vadot  ports:
665def4c47SEmmanuel Vadot    $ref: /schemas/graph.yaml#/properties/ports
675def4c47SEmmanuel Vadot
685def4c47SEmmanuel Vadot    properties:
695def4c47SEmmanuel Vadot      port@0:
705def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
715def4c47SEmmanuel Vadot        unevaluatedProperties: false
725def4c47SEmmanuel Vadot        description:
735def4c47SEmmanuel Vadot          Input port node, single endpoint describing the CSI-2 transmitter.
745def4c47SEmmanuel Vadot
755def4c47SEmmanuel Vadot        properties:
765def4c47SEmmanuel Vadot          endpoint:
775def4c47SEmmanuel Vadot            $ref: video-interfaces.yaml#
785def4c47SEmmanuel Vadot            unevaluatedProperties: false
795def4c47SEmmanuel Vadot
805def4c47SEmmanuel Vadot            properties:
815def4c47SEmmanuel Vadot              data-lanes:
82*8cc087a1SEmmanuel Vadot                description:
83*8cc087a1SEmmanuel Vadot                  Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
845956d97fSEmmanuel Vadot                minItems: 1
855956d97fSEmmanuel Vadot                items:
865def4c47SEmmanuel Vadot                  - const: 1
875def4c47SEmmanuel Vadot                  - const: 2
885956d97fSEmmanuel Vadot                  - const: 3
895956d97fSEmmanuel Vadot                  - const: 4
905def4c47SEmmanuel Vadot
915def4c47SEmmanuel Vadot            required:
925def4c47SEmmanuel Vadot              - data-lanes
935def4c47SEmmanuel Vadot
945def4c47SEmmanuel Vadot      port@1:
955def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
965def4c47SEmmanuel Vadot        description:
975def4c47SEmmanuel Vadot          Output port node
985def4c47SEmmanuel Vadot
995def4c47SEmmanuel Vadotrequired:
1005def4c47SEmmanuel Vadot  - compatible
1015def4c47SEmmanuel Vadot  - reg
1025def4c47SEmmanuel Vadot  - interrupts
1035def4c47SEmmanuel Vadot  - clocks
1045def4c47SEmmanuel Vadot  - clock-names
1055def4c47SEmmanuel Vadot  - power-domains
1065def4c47SEmmanuel Vadot  - ports
1075def4c47SEmmanuel Vadot
1085def4c47SEmmanuel VadotadditionalProperties: false
1095def4c47SEmmanuel Vadot
1105956d97fSEmmanuel VadotallOf:
1115956d97fSEmmanuel Vadot  - if:
1125956d97fSEmmanuel Vadot      properties:
1135956d97fSEmmanuel Vadot        compatible:
1145956d97fSEmmanuel Vadot          contains:
1155956d97fSEmmanuel Vadot            const: fsl,imx7-mipi-csi2
1165956d97fSEmmanuel Vadot    then:
1175956d97fSEmmanuel Vadot      required:
1185956d97fSEmmanuel Vadot        - phy-supply
1195956d97fSEmmanuel Vadot        - resets
1205956d97fSEmmanuel Vadot    else:
1215956d97fSEmmanuel Vadot      properties:
1225956d97fSEmmanuel Vadot        clocks:
1235956d97fSEmmanuel Vadot          minItems: 4
1245956d97fSEmmanuel Vadot        clock-names:
1255956d97fSEmmanuel Vadot          minItems: 4
1265956d97fSEmmanuel Vadot        phy-supply: false
1275956d97fSEmmanuel Vadot        resets: false
1285956d97fSEmmanuel Vadot
1295def4c47SEmmanuel Vadotexamples:
1305def4c47SEmmanuel Vadot  - |
1315def4c47SEmmanuel Vadot    #include <dt-bindings/clock/imx7d-clock.h>
1325def4c47SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1335def4c47SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
1345def4c47SEmmanuel Vadot    #include <dt-bindings/reset/imx7-reset.h>
1355def4c47SEmmanuel Vadot
1365956d97fSEmmanuel Vadot    mipi-csi@30750000 {
1375def4c47SEmmanuel Vadot        compatible = "fsl,imx7-mipi-csi2";
1385def4c47SEmmanuel Vadot        reg = <0x30750000 0x10000>;
1395def4c47SEmmanuel Vadot        interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
1405def4c47SEmmanuel Vadot
1415def4c47SEmmanuel Vadot        clocks = <&clks IMX7D_IPG_ROOT_CLK>,
1425def4c47SEmmanuel Vadot                 <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
1435def4c47SEmmanuel Vadot                 <&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
1445def4c47SEmmanuel Vadot        clock-names = "pclk", "wrap", "phy";
1455def4c47SEmmanuel Vadot        clock-frequency = <166000000>;
1465def4c47SEmmanuel Vadot
1475def4c47SEmmanuel Vadot        power-domains = <&pgc_mipi_phy>;
1485def4c47SEmmanuel Vadot        phy-supply = <&reg_1p0d>;
1495def4c47SEmmanuel Vadot        resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
1505def4c47SEmmanuel Vadot
1515def4c47SEmmanuel Vadot        ports {
1525def4c47SEmmanuel Vadot            #address-cells = <1>;
1535def4c47SEmmanuel Vadot            #size-cells = <0>;
1545def4c47SEmmanuel Vadot
1555def4c47SEmmanuel Vadot            port@0 {
1565def4c47SEmmanuel Vadot                reg = <0>;
1575def4c47SEmmanuel Vadot
1585def4c47SEmmanuel Vadot                mipi_from_sensor: endpoint {
1595def4c47SEmmanuel Vadot                    remote-endpoint = <&ov2680_to_mipi>;
1605def4c47SEmmanuel Vadot                    data-lanes = <1>;
1615def4c47SEmmanuel Vadot                };
1625def4c47SEmmanuel Vadot            };
1635def4c47SEmmanuel Vadot
1645def4c47SEmmanuel Vadot            port@1 {
1655def4c47SEmmanuel Vadot                reg = <1>;
1665def4c47SEmmanuel Vadot
1675def4c47SEmmanuel Vadot                mipi_vc0_to_csi_mux: endpoint {
1685def4c47SEmmanuel Vadot                    remote-endpoint = <&csi_mux_from_mipi_vc0>;
1695def4c47SEmmanuel Vadot                };
1705def4c47SEmmanuel Vadot            };
1715def4c47SEmmanuel Vadot        };
1725def4c47SEmmanuel Vadot    };
1735def4c47SEmmanuel Vadot
1745956d97fSEmmanuel Vadot  - |
1755956d97fSEmmanuel Vadot    #include <dt-bindings/clock/imx8mm-clock.h>
1765956d97fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1775956d97fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
1785956d97fSEmmanuel Vadot
1795956d97fSEmmanuel Vadot    mipi-csi@32e30000 {
1805956d97fSEmmanuel Vadot        compatible = "fsl,imx8mm-mipi-csi2";
1815956d97fSEmmanuel Vadot        reg = <0x32e30000 0x1000>;
1825956d97fSEmmanuel Vadot        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
1835956d97fSEmmanuel Vadot        clock-frequency = <333000000>;
1845956d97fSEmmanuel Vadot        clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>,
1855956d97fSEmmanuel Vadot                 <&clk IMX8MM_CLK_CSI1_ROOT>,
1865956d97fSEmmanuel Vadot                 <&clk IMX8MM_CLK_CSI1_PHY_REF>,
1875956d97fSEmmanuel Vadot                 <&clk IMX8MM_CLK_DISP_AXI_ROOT>;
1885956d97fSEmmanuel Vadot        clock-names = "pclk", "wrap", "phy", "axi";
1895956d97fSEmmanuel Vadot        power-domains = <&mipi_pd>;
1905956d97fSEmmanuel Vadot
1915956d97fSEmmanuel Vadot        ports {
1925956d97fSEmmanuel Vadot            #address-cells = <1>;
1935956d97fSEmmanuel Vadot            #size-cells = <0>;
1945956d97fSEmmanuel Vadot
1955956d97fSEmmanuel Vadot            port@0 {
1965956d97fSEmmanuel Vadot                reg = <0>;
1975956d97fSEmmanuel Vadot
1985956d97fSEmmanuel Vadot                imx8mm_mipi_csi_in: endpoint {
1995956d97fSEmmanuel Vadot                    remote-endpoint = <&imx477_out>;
2005956d97fSEmmanuel Vadot                    data-lanes = <1 2 3 4>;
2015956d97fSEmmanuel Vadot                };
2025956d97fSEmmanuel Vadot            };
2035956d97fSEmmanuel Vadot
2045956d97fSEmmanuel Vadot            port@1 {
2055956d97fSEmmanuel Vadot                reg = <1>;
2065956d97fSEmmanuel Vadot
2075956d97fSEmmanuel Vadot                imx8mm_mipi_csi_out: endpoint {
2085956d97fSEmmanuel Vadot                    remote-endpoint = <&csi_in>;
2095956d97fSEmmanuel Vadot                };
2105956d97fSEmmanuel Vadot            };
2115956d97fSEmmanuel Vadot        };
2125956d97fSEmmanuel Vadot    };
2135956d97fSEmmanuel Vadot
2145def4c47SEmmanuel Vadot...
215