xref: /freebsd/sys/contrib/device-tree/Bindings/media/allwinner,sun6i-a31-mipi-csi2.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1b97ee269SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2b97ee269SEmmanuel Vadot%YAML 1.2
3b97ee269SEmmanuel Vadot---
4b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/media/allwinner,sun6i-a31-mipi-csi2.yaml#
5b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6b97ee269SEmmanuel Vadot
7*7ef62cebSEmmanuel Vadottitle: Allwinner A31 MIPI CSI-2
8b97ee269SEmmanuel Vadot
9b97ee269SEmmanuel Vadotmaintainers:
10b97ee269SEmmanuel Vadot  - Paul Kocialkowski <paul.kocialkowski@bootlin.com>
11b97ee269SEmmanuel Vadot
12b97ee269SEmmanuel Vadotproperties:
13b97ee269SEmmanuel Vadot  compatible:
14b97ee269SEmmanuel Vadot    oneOf:
15b97ee269SEmmanuel Vadot      - const: allwinner,sun6i-a31-mipi-csi2
16b97ee269SEmmanuel Vadot      - items:
17b97ee269SEmmanuel Vadot          - const: allwinner,sun8i-v3s-mipi-csi2
18b97ee269SEmmanuel Vadot          - const: allwinner,sun6i-a31-mipi-csi2
19b97ee269SEmmanuel Vadot
20b97ee269SEmmanuel Vadot  reg:
21b97ee269SEmmanuel Vadot    maxItems: 1
22b97ee269SEmmanuel Vadot
23b97ee269SEmmanuel Vadot  interrupts:
24b97ee269SEmmanuel Vadot    maxItems: 1
25b97ee269SEmmanuel Vadot
26b97ee269SEmmanuel Vadot  clocks:
27b97ee269SEmmanuel Vadot    items:
28b97ee269SEmmanuel Vadot      - description: Bus Clock
29b97ee269SEmmanuel Vadot      - description: Module Clock
30b97ee269SEmmanuel Vadot
31b97ee269SEmmanuel Vadot  clock-names:
32b97ee269SEmmanuel Vadot    items:
33b97ee269SEmmanuel Vadot      - const: bus
34b97ee269SEmmanuel Vadot      - const: mod
35b97ee269SEmmanuel Vadot
36b97ee269SEmmanuel Vadot  phys:
37b97ee269SEmmanuel Vadot    maxItems: 1
38b97ee269SEmmanuel Vadot    description: MIPI D-PHY
39b97ee269SEmmanuel Vadot
40b97ee269SEmmanuel Vadot  phy-names:
41b97ee269SEmmanuel Vadot    items:
42b97ee269SEmmanuel Vadot      - const: dphy
43b97ee269SEmmanuel Vadot
44b97ee269SEmmanuel Vadot  resets:
45b97ee269SEmmanuel Vadot    maxItems: 1
46b97ee269SEmmanuel Vadot
47b97ee269SEmmanuel Vadot  ports:
48b97ee269SEmmanuel Vadot    $ref: /schemas/graph.yaml#/properties/ports
49b97ee269SEmmanuel Vadot
50b97ee269SEmmanuel Vadot    properties:
51b97ee269SEmmanuel Vadot      port@0:
52b97ee269SEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
53b97ee269SEmmanuel Vadot        description: Input port, connect to a MIPI CSI-2 sensor
54b97ee269SEmmanuel Vadot
55b97ee269SEmmanuel Vadot        properties:
56b97ee269SEmmanuel Vadot          reg:
57b97ee269SEmmanuel Vadot            const: 0
58b97ee269SEmmanuel Vadot
59b97ee269SEmmanuel Vadot          endpoint:
60b97ee269SEmmanuel Vadot            $ref: video-interfaces.yaml#
61b97ee269SEmmanuel Vadot            unevaluatedProperties: false
62b97ee269SEmmanuel Vadot
63b97ee269SEmmanuel Vadot            properties:
64b97ee269SEmmanuel Vadot              data-lanes:
65b97ee269SEmmanuel Vadot                minItems: 1
66b97ee269SEmmanuel Vadot                maxItems: 4
67b97ee269SEmmanuel Vadot
68b97ee269SEmmanuel Vadot            required:
69b97ee269SEmmanuel Vadot              - data-lanes
70b97ee269SEmmanuel Vadot
71b97ee269SEmmanuel Vadot        unevaluatedProperties: false
72b97ee269SEmmanuel Vadot
73b97ee269SEmmanuel Vadot      port@1:
74b97ee269SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
75b97ee269SEmmanuel Vadot        description: Output port, connect to a CSI controller
76b97ee269SEmmanuel Vadot
77b97ee269SEmmanuel Vadot    required:
78b97ee269SEmmanuel Vadot      - port@0
79b97ee269SEmmanuel Vadot      - port@1
80b97ee269SEmmanuel Vadot
81b97ee269SEmmanuel Vadotrequired:
82b97ee269SEmmanuel Vadot  - compatible
83b97ee269SEmmanuel Vadot  - reg
84b97ee269SEmmanuel Vadot  - interrupts
85b97ee269SEmmanuel Vadot  - clocks
86b97ee269SEmmanuel Vadot  - clock-names
87b97ee269SEmmanuel Vadot  - phys
88b97ee269SEmmanuel Vadot  - phy-names
89b97ee269SEmmanuel Vadot  - resets
90b97ee269SEmmanuel Vadot  - ports
91b97ee269SEmmanuel Vadot
92b97ee269SEmmanuel VadotadditionalProperties: false
93b97ee269SEmmanuel Vadot
94b97ee269SEmmanuel Vadotexamples:
95b97ee269SEmmanuel Vadot  - |
96b97ee269SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
97b97ee269SEmmanuel Vadot    #include <dt-bindings/clock/sun8i-v3s-ccu.h>
98b97ee269SEmmanuel Vadot    #include <dt-bindings/reset/sun8i-v3s-ccu.h>
99b97ee269SEmmanuel Vadot
100b97ee269SEmmanuel Vadot    mipi_csi2: csi@1cb1000 {
101b97ee269SEmmanuel Vadot        compatible = "allwinner,sun8i-v3s-mipi-csi2",
102b97ee269SEmmanuel Vadot                     "allwinner,sun6i-a31-mipi-csi2";
103b97ee269SEmmanuel Vadot        reg = <0x01cb1000 0x1000>;
104b97ee269SEmmanuel Vadot        interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
105b97ee269SEmmanuel Vadot        clocks = <&ccu CLK_BUS_CSI>,
106b97ee269SEmmanuel Vadot                 <&ccu CLK_CSI1_SCLK>;
107b97ee269SEmmanuel Vadot        clock-names = "bus", "mod";
108b97ee269SEmmanuel Vadot        resets = <&ccu RST_BUS_CSI>;
109b97ee269SEmmanuel Vadot
110b97ee269SEmmanuel Vadot        phys = <&dphy>;
111b97ee269SEmmanuel Vadot        phy-names = "dphy";
112b97ee269SEmmanuel Vadot
113b97ee269SEmmanuel Vadot        ports {
114b97ee269SEmmanuel Vadot            #address-cells = <1>;
115b97ee269SEmmanuel Vadot            #size-cells = <0>;
116b97ee269SEmmanuel Vadot
117b97ee269SEmmanuel Vadot            mipi_csi2_in: port@0 {
118b97ee269SEmmanuel Vadot                reg = <0>;
119b97ee269SEmmanuel Vadot
120b97ee269SEmmanuel Vadot                mipi_csi2_in_ov5648: endpoint {
121b97ee269SEmmanuel Vadot                    data-lanes = <1 2 3 4>;
122b97ee269SEmmanuel Vadot
123b97ee269SEmmanuel Vadot                    remote-endpoint = <&ov5648_out_mipi_csi2>;
124b97ee269SEmmanuel Vadot                };
125b97ee269SEmmanuel Vadot            };
126b97ee269SEmmanuel Vadot
127b97ee269SEmmanuel Vadot            mipi_csi2_out: port@1 {
128b97ee269SEmmanuel Vadot                reg = <1>;
129b97ee269SEmmanuel Vadot
130b97ee269SEmmanuel Vadot                mipi_csi2_out_csi0: endpoint {
131b97ee269SEmmanuel Vadot                    remote-endpoint = <&csi0_in_mipi_csi2>;
132b97ee269SEmmanuel Vadot                };
133b97ee269SEmmanuel Vadot            };
134b97ee269SEmmanuel Vadot        };
135b97ee269SEmmanuel Vadot    };
136b97ee269SEmmanuel Vadot
137b97ee269SEmmanuel Vadot...
138