15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0+ OR MIT)
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/media/rockchip-isp1.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
75def4c47SEmmanuel Vadottitle: Rockchip SoC Image Signal Processing unit v1
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
105def4c47SEmmanuel Vadot  - Helen Koike <helen.koike@collabora.com>
115def4c47SEmmanuel Vadot
125def4c47SEmmanuel Vadotdescription: |
135def4c47SEmmanuel Vadot  Rockchip ISP1 is the Camera interface for the Rockchip series of SoCs
145def4c47SEmmanuel Vadot  which contains image processing, scaling, and compression functions.
155def4c47SEmmanuel Vadot
165def4c47SEmmanuel Vadotproperties:
175def4c47SEmmanuel Vadot  compatible:
188cc087a1SEmmanuel Vadot    enum:
198cc087a1SEmmanuel Vadot      - rockchip,px30-cif-isp
208cc087a1SEmmanuel Vadot      - rockchip,rk3399-cif-isp
215def4c47SEmmanuel Vadot
225def4c47SEmmanuel Vadot  reg:
235def4c47SEmmanuel Vadot    maxItems: 1
245def4c47SEmmanuel Vadot
255def4c47SEmmanuel Vadot  interrupts:
268cc087a1SEmmanuel Vadot    minItems: 1
278cc087a1SEmmanuel Vadot    maxItems: 3
288cc087a1SEmmanuel Vadot
298cc087a1SEmmanuel Vadot  interrupt-names:
308cc087a1SEmmanuel Vadot    items:
318cc087a1SEmmanuel Vadot      - const: isp
328cc087a1SEmmanuel Vadot      - const: mi
338cc087a1SEmmanuel Vadot      - const: mipi
345def4c47SEmmanuel Vadot
355def4c47SEmmanuel Vadot  clocks:
365def4c47SEmmanuel Vadot    minItems: 3
375def4c47SEmmanuel Vadot    items:
385def4c47SEmmanuel Vadot      # isp0 and isp1
395def4c47SEmmanuel Vadot      - description: ISP clock
405def4c47SEmmanuel Vadot      - description: ISP AXI clock
415def4c47SEmmanuel Vadot      - description: ISP AHB clock
425def4c47SEmmanuel Vadot      # only for isp1
435def4c47SEmmanuel Vadot      - description: ISP Pixel clock
445def4c47SEmmanuel Vadot
455def4c47SEmmanuel Vadot  clock-names:
465def4c47SEmmanuel Vadot    minItems: 3
475def4c47SEmmanuel Vadot    items:
485def4c47SEmmanuel Vadot      # isp0 and isp1
495def4c47SEmmanuel Vadot      - const: isp
505def4c47SEmmanuel Vadot      - const: aclk
515def4c47SEmmanuel Vadot      - const: hclk
525def4c47SEmmanuel Vadot      # only for isp1
538cc087a1SEmmanuel Vadot      - const: pclk
545def4c47SEmmanuel Vadot
555def4c47SEmmanuel Vadot  iommus:
565def4c47SEmmanuel Vadot    maxItems: 1
575def4c47SEmmanuel Vadot
585def4c47SEmmanuel Vadot  phys:
595def4c47SEmmanuel Vadot    maxItems: 1
605def4c47SEmmanuel Vadot    description: phandle for the PHY port
615def4c47SEmmanuel Vadot
625def4c47SEmmanuel Vadot  phy-names:
635def4c47SEmmanuel Vadot    const: dphy
645def4c47SEmmanuel Vadot
655def4c47SEmmanuel Vadot  power-domains:
665def4c47SEmmanuel Vadot    maxItems: 1
675def4c47SEmmanuel Vadot
685def4c47SEmmanuel Vadot  ports:
695def4c47SEmmanuel Vadot    $ref: /schemas/graph.yaml#/properties/ports
705def4c47SEmmanuel Vadot
715def4c47SEmmanuel Vadot    properties:
725def4c47SEmmanuel Vadot      port@0:
735def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
745def4c47SEmmanuel Vadot        unevaluatedProperties: false
755def4c47SEmmanuel Vadot        description: connection point for sensors at MIPI-DPHY RX0
765def4c47SEmmanuel Vadot
775def4c47SEmmanuel Vadot        properties:
785def4c47SEmmanuel Vadot          endpoint:
795def4c47SEmmanuel Vadot            $ref: video-interfaces.yaml#
805def4c47SEmmanuel Vadot            unevaluatedProperties: false
815def4c47SEmmanuel Vadot
825def4c47SEmmanuel Vadot            properties:
835def4c47SEmmanuel Vadot              data-lanes:
845def4c47SEmmanuel Vadot                minItems: 1
855def4c47SEmmanuel Vadot                maxItems: 4
865def4c47SEmmanuel Vadot
87b97ee269SEmmanuel Vadot      port@1:
88b97ee269SEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
89b97ee269SEmmanuel Vadot        unevaluatedProperties: false
90b97ee269SEmmanuel Vadot        description: connection point for input on the parallel interface
91b97ee269SEmmanuel Vadot
92b97ee269SEmmanuel Vadot        properties:
93b97ee269SEmmanuel Vadot          endpoint:
94b97ee269SEmmanuel Vadot            $ref: video-interfaces.yaml#
95b97ee269SEmmanuel Vadot            unevaluatedProperties: false
96b97ee269SEmmanuel Vadot
97*8d13bc63SEmmanuel Vadot            properties:
98*8d13bc63SEmmanuel Vadot              bus-type:
99*8d13bc63SEmmanuel Vadot                enum: [5, 6]
100*8d13bc63SEmmanuel Vadot
1015def4c47SEmmanuel Vadot            required:
102b97ee269SEmmanuel Vadot              - bus-type
103b97ee269SEmmanuel Vadot
104b97ee269SEmmanuel Vadot    anyOf:
105b97ee269SEmmanuel Vadot      - required:
1065def4c47SEmmanuel Vadot          - port@0
107b97ee269SEmmanuel Vadot      - required:
108b97ee269SEmmanuel Vadot          - port@1
1095def4c47SEmmanuel Vadot
1105def4c47SEmmanuel Vadotrequired:
1115def4c47SEmmanuel Vadot  - compatible
1125def4c47SEmmanuel Vadot  - reg
1135def4c47SEmmanuel Vadot  - interrupts
1145def4c47SEmmanuel Vadot  - clocks
1155def4c47SEmmanuel Vadot  - clock-names
1165def4c47SEmmanuel Vadot  - iommus
1175def4c47SEmmanuel Vadot  - phys
1185def4c47SEmmanuel Vadot  - phy-names
1195def4c47SEmmanuel Vadot  - power-domains
1205def4c47SEmmanuel Vadot  - ports
1215def4c47SEmmanuel Vadot
1228cc087a1SEmmanuel VadotallOf:
1238cc087a1SEmmanuel Vadot  - if:
1245def4c47SEmmanuel Vadot      properties:
1255def4c47SEmmanuel Vadot        compatible:
1265def4c47SEmmanuel Vadot          contains:
1275def4c47SEmmanuel Vadot            const: rockchip,rk3399-cif-isp
1285def4c47SEmmanuel Vadot    then:
1295def4c47SEmmanuel Vadot      properties:
1305def4c47SEmmanuel Vadot        clocks:
1315def4c47SEmmanuel Vadot          minItems: 3
1325def4c47SEmmanuel Vadot          maxItems: 4
1335def4c47SEmmanuel Vadot        clock-names:
1345def4c47SEmmanuel Vadot          minItems: 3
1355def4c47SEmmanuel Vadot          maxItems: 4
1365def4c47SEmmanuel Vadot
1378cc087a1SEmmanuel Vadot  - if:
1388cc087a1SEmmanuel Vadot      properties:
1398cc087a1SEmmanuel Vadot        compatible:
1408cc087a1SEmmanuel Vadot          contains:
1418cc087a1SEmmanuel Vadot            const: rockchip,px30-cif-isp
1428cc087a1SEmmanuel Vadot    then:
1438cc087a1SEmmanuel Vadot      required:
1448cc087a1SEmmanuel Vadot        - interrupt-names
1458cc087a1SEmmanuel Vadot
1465def4c47SEmmanuel VadotadditionalProperties: false
1475def4c47SEmmanuel Vadot
1485def4c47SEmmanuel Vadotexamples:
1495def4c47SEmmanuel Vadot  - |
1505def4c47SEmmanuel Vadot
1515def4c47SEmmanuel Vadot    #include <dt-bindings/clock/rk3399-cru.h>
1525def4c47SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1535def4c47SEmmanuel Vadot    #include <dt-bindings/power/rk3399-power.h>
1545def4c47SEmmanuel Vadot
1555def4c47SEmmanuel Vadot    parent0: parent {
1565def4c47SEmmanuel Vadot        #address-cells = <2>;
1575def4c47SEmmanuel Vadot        #size-cells = <2>;
1585def4c47SEmmanuel Vadot
1595def4c47SEmmanuel Vadot        isp0: isp0@ff910000 {
1605def4c47SEmmanuel Vadot            compatible = "rockchip,rk3399-cif-isp";
1615def4c47SEmmanuel Vadot            reg = <0x0 0xff910000 0x0 0x4000>;
1625def4c47SEmmanuel Vadot            interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH 0>;
1635def4c47SEmmanuel Vadot            clocks = <&cru SCLK_ISP0>,
1645def4c47SEmmanuel Vadot                     <&cru ACLK_ISP0_WRAPPER>,
1655def4c47SEmmanuel Vadot                     <&cru HCLK_ISP0_WRAPPER>;
1665def4c47SEmmanuel Vadot            clock-names = "isp", "aclk", "hclk";
1675def4c47SEmmanuel Vadot            iommus = <&isp0_mmu>;
1685def4c47SEmmanuel Vadot            phys = <&dphy>;
1695def4c47SEmmanuel Vadot            phy-names = "dphy";
1705def4c47SEmmanuel Vadot            power-domains = <&power RK3399_PD_ISP0>;
1715def4c47SEmmanuel Vadot
1725def4c47SEmmanuel Vadot            ports {
1735def4c47SEmmanuel Vadot                #address-cells = <1>;
1745def4c47SEmmanuel Vadot                #size-cells = <0>;
1755def4c47SEmmanuel Vadot
1765def4c47SEmmanuel Vadot                port@0 {
1775def4c47SEmmanuel Vadot                    reg = <0>;
1785def4c47SEmmanuel Vadot                    #address-cells = <1>;
1795def4c47SEmmanuel Vadot                    #size-cells = <0>;
1805def4c47SEmmanuel Vadot
1815def4c47SEmmanuel Vadot                    mipi_in_wcam: endpoint@0 {
1825def4c47SEmmanuel Vadot                        reg = <0>;
1835def4c47SEmmanuel Vadot                        remote-endpoint = <&wcam_out>;
1845def4c47SEmmanuel Vadot                        data-lanes = <1 2>;
1855def4c47SEmmanuel Vadot                    };
1865def4c47SEmmanuel Vadot
1875def4c47SEmmanuel Vadot                    mipi_in_ucam: endpoint@1 {
1885def4c47SEmmanuel Vadot                        reg = <1>;
1895def4c47SEmmanuel Vadot                        remote-endpoint = <&ucam_out>;
1905def4c47SEmmanuel Vadot                        data-lanes = <1>;
1915def4c47SEmmanuel Vadot                    };
1925def4c47SEmmanuel Vadot                };
1935def4c47SEmmanuel Vadot            };
1945def4c47SEmmanuel Vadot        };
1955def4c47SEmmanuel Vadot
1965def4c47SEmmanuel Vadot        i2c7: i2c {
1975def4c47SEmmanuel Vadot            #address-cells = <1>;
1985def4c47SEmmanuel Vadot            #size-cells = <0>;
1995def4c47SEmmanuel Vadot
2005def4c47SEmmanuel Vadot            wcam: camera@36 {
2015def4c47SEmmanuel Vadot                compatible = "ovti,ov5695";
2025def4c47SEmmanuel Vadot                reg = <0x36>;
203aa1a8ff2SEmmanuel Vadot                clocks = <&cru SCLK_TESTCLKOUT1>;
2045def4c47SEmmanuel Vadot
2055def4c47SEmmanuel Vadot                port {
2065def4c47SEmmanuel Vadot                    wcam_out: endpoint {
2075def4c47SEmmanuel Vadot                        remote-endpoint = <&mipi_in_wcam>;
2085def4c47SEmmanuel Vadot                        data-lanes = <1 2>;
2095def4c47SEmmanuel Vadot                    };
2105def4c47SEmmanuel Vadot                };
2115def4c47SEmmanuel Vadot            };
2125def4c47SEmmanuel Vadot
2135def4c47SEmmanuel Vadot            ucam: camera@3c {
2145def4c47SEmmanuel Vadot                compatible = "ovti,ov2685";
2155def4c47SEmmanuel Vadot                reg = <0x3c>;
2165def4c47SEmmanuel Vadot
217fac71e4eSEmmanuel Vadot                clocks = <&cru SCLK_TESTCLKOUT1>;
218fac71e4eSEmmanuel Vadot                clock-names = "xvclk";
219fac71e4eSEmmanuel Vadot
220fac71e4eSEmmanuel Vadot                avdd-supply = <&pp2800_cam>;
221fac71e4eSEmmanuel Vadot                dovdd-supply = <&pp1800>;
222fac71e4eSEmmanuel Vadot                dvdd-supply = <&pp1800>;
223fac71e4eSEmmanuel Vadot
2245def4c47SEmmanuel Vadot                port {
2255def4c47SEmmanuel Vadot                    ucam_out: endpoint {
2265def4c47SEmmanuel Vadot                        remote-endpoint = <&mipi_in_ucam>;
2275def4c47SEmmanuel Vadot                        data-lanes = <1>;
2285def4c47SEmmanuel Vadot                    };
2295def4c47SEmmanuel Vadot                };
2305def4c47SEmmanuel Vadot            };
2315def4c47SEmmanuel Vadot        };
2325def4c47SEmmanuel Vadot    };
2338cc087a1SEmmanuel Vadot
2348cc087a1SEmmanuel Vadot  - |
2358cc087a1SEmmanuel Vadot
2368cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
2378cc087a1SEmmanuel Vadot    #include <dt-bindings/power/px30-power.h>
2388cc087a1SEmmanuel Vadot
2398cc087a1SEmmanuel Vadot    parent1: parent {
2408cc087a1SEmmanuel Vadot        #address-cells = <2>;
2418cc087a1SEmmanuel Vadot        #size-cells = <2>;
2428cc087a1SEmmanuel Vadot
2438cc087a1SEmmanuel Vadot        isp: isp@ff4a0000 {
2448cc087a1SEmmanuel Vadot            compatible = "rockchip,px30-cif-isp";
2458cc087a1SEmmanuel Vadot            reg = <0x0 0xff4a0000 0x0 0x8000>;
2468cc087a1SEmmanuel Vadot            interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
2478cc087a1SEmmanuel Vadot                         <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
2488cc087a1SEmmanuel Vadot                         <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
2498cc087a1SEmmanuel Vadot            interrupt-names = "isp", "mi", "mipi";
2508cc087a1SEmmanuel Vadot            clocks = <&cru SCLK_ISP0>,
2518cc087a1SEmmanuel Vadot                     <&cru ACLK_ISP0_WRAPPER>,
2528cc087a1SEmmanuel Vadot                     <&cru HCLK_ISP0_WRAPPER>,
2538cc087a1SEmmanuel Vadot                     <&cru PCLK_ISP1_WRAPPER>;
2548cc087a1SEmmanuel Vadot            clock-names = "isp", "aclk", "hclk", "pclk";
2558cc087a1SEmmanuel Vadot            iommus = <&isp_mmu>;
2568cc087a1SEmmanuel Vadot            phys = <&csi_dphy>;
2578cc087a1SEmmanuel Vadot            phy-names = "dphy";
2588cc087a1SEmmanuel Vadot            power-domains = <&power PX30_PD_VI>;
2598cc087a1SEmmanuel Vadot
2608cc087a1SEmmanuel Vadot            ports {
2618cc087a1SEmmanuel Vadot                #address-cells = <1>;
2628cc087a1SEmmanuel Vadot                #size-cells = <0>;
2638cc087a1SEmmanuel Vadot
2648cc087a1SEmmanuel Vadot                port@0 {
2658cc087a1SEmmanuel Vadot                    reg = <0>;
2668cc087a1SEmmanuel Vadot                    #address-cells = <1>;
2678cc087a1SEmmanuel Vadot                    #size-cells = <0>;
2688cc087a1SEmmanuel Vadot
2698cc087a1SEmmanuel Vadot                    mipi_in_ucam1: endpoint@0 {
2708cc087a1SEmmanuel Vadot                        reg = <0>;
2718cc087a1SEmmanuel Vadot                        remote-endpoint = <&ucam1_out>;
2728cc087a1SEmmanuel Vadot                        data-lanes = <1 2>;
2738cc087a1SEmmanuel Vadot                    };
2748cc087a1SEmmanuel Vadot                };
2758cc087a1SEmmanuel Vadot            };
2768cc087a1SEmmanuel Vadot        };
2778cc087a1SEmmanuel Vadot
2788cc087a1SEmmanuel Vadot        i2c2: i2c {
2798cc087a1SEmmanuel Vadot            #address-cells = <1>;
2808cc087a1SEmmanuel Vadot            #size-cells = <0>;
2818cc087a1SEmmanuel Vadot
2828cc087a1SEmmanuel Vadot            ov5695: camera@36 {
2838cc087a1SEmmanuel Vadot                compatible = "ovti,ov5647";
2848cc087a1SEmmanuel Vadot                reg = <0x36>;
2858cc087a1SEmmanuel Vadot                clocks = <&cru SCLK_CIF_OUT>;
2868cc087a1SEmmanuel Vadot
2878cc087a1SEmmanuel Vadot                port {
2888cc087a1SEmmanuel Vadot                    ucam1_out: endpoint {
2898cc087a1SEmmanuel Vadot                        remote-endpoint = <&mipi_in_ucam1>;
2908cc087a1SEmmanuel Vadot                        data-lanes = <1 2>;
2918cc087a1SEmmanuel Vadot                    };
2928cc087a1SEmmanuel Vadot                };
2938cc087a1SEmmanuel Vadot            };
2948cc087a1SEmmanuel Vadot        };
2958cc087a1SEmmanuel Vadot    };
296