1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2c9ccf3a3SEmmanuel Vadot%YAML 1.2 3c9ccf3a3SEmmanuel Vadot--- 4c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/media/microchip,csi2dc.yaml# 5c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c9ccf3a3SEmmanuel Vadot 7c9ccf3a3SEmmanuel Vadottitle: Microchip CSI2 Demux Controller (CSI2DC) 8c9ccf3a3SEmmanuel Vadot 9c9ccf3a3SEmmanuel Vadotmaintainers: 10c9ccf3a3SEmmanuel Vadot - Eugen Hristev <eugen.hristev@microchip.com> 11c9ccf3a3SEmmanuel Vadot 12c9ccf3a3SEmmanuel Vadotdescription: 13c9ccf3a3SEmmanuel Vadot CSI2DC - Camera Serial Interface 2 Demux Controller 14c9ccf3a3SEmmanuel Vadot 15c9ccf3a3SEmmanuel Vadot CSI2DC is a hardware block that receives incoming data from either from an 16c9ccf3a3SEmmanuel Vadot IDI interface or from a parallel bus interface. 17c9ccf3a3SEmmanuel Vadot It filters IDI packets based on their data type and virtual channel 18c9ccf3a3SEmmanuel Vadot identifier, then converts the byte stream to a pixel stream into a cross 19c9ccf3a3SEmmanuel Vadot clock domain towards a parallel interface that can be read by a sensor 20c9ccf3a3SEmmanuel Vadot controller. 21c9ccf3a3SEmmanuel Vadot IDI interface is Synopsys proprietary. 22c9ccf3a3SEmmanuel Vadot CSI2DC can act a simple bypass bridge if the incoming data is coming from 23c9ccf3a3SEmmanuel Vadot a parallel interface. 24c9ccf3a3SEmmanuel Vadot 25c9ccf3a3SEmmanuel Vadot CSI2DC provides two pipes, one video pipe and one data pipe. Video pipe 26c9ccf3a3SEmmanuel Vadot is connected at the output to a sensor controller and the data pipe is 27c9ccf3a3SEmmanuel Vadot accessible as a DMA slave port to a DMA controller. 28c9ccf3a3SEmmanuel Vadot 29c9ccf3a3SEmmanuel Vadot CSI2DC supports a single 'port' node as a sink port with either Synopsys 30c9ccf3a3SEmmanuel Vadot 32-bit IDI interface or a parallel interface. 31c9ccf3a3SEmmanuel Vadot 32c9ccf3a3SEmmanuel Vadot CSI2DC supports one 'port' node as source port with parallel interface. 33c9ccf3a3SEmmanuel Vadot This is called video pipe. 34c9ccf3a3SEmmanuel Vadot This port has an 'endpoint' that can be connected to a sink port of another 35c9ccf3a3SEmmanuel Vadot controller (next in pipeline). 36c9ccf3a3SEmmanuel Vadot 37c9ccf3a3SEmmanuel Vadot CSI2DC also supports direct access to the data through AHB, via DMA channel, 38c9ccf3a3SEmmanuel Vadot called data pipe. 39c9ccf3a3SEmmanuel Vadot For data pipe to be available, a dma controller and a dma channel must be 40c9ccf3a3SEmmanuel Vadot referenced. 41c9ccf3a3SEmmanuel Vadot 42c9ccf3a3SEmmanuel Vadotproperties: 43c9ccf3a3SEmmanuel Vadot compatible: 44c9ccf3a3SEmmanuel Vadot const: microchip,sama7g5-csi2dc 45c9ccf3a3SEmmanuel Vadot 46c9ccf3a3SEmmanuel Vadot reg: 47c9ccf3a3SEmmanuel Vadot maxItems: 1 48c9ccf3a3SEmmanuel Vadot 49c9ccf3a3SEmmanuel Vadot clocks: 50c9ccf3a3SEmmanuel Vadot minItems: 2 51c9ccf3a3SEmmanuel Vadot maxItems: 2 52c9ccf3a3SEmmanuel Vadot 53c9ccf3a3SEmmanuel Vadot clock-names: 54c9ccf3a3SEmmanuel Vadot description: 55c9ccf3a3SEmmanuel Vadot CSI2DC must have two clocks to function correctly. One clock is the 56c9ccf3a3SEmmanuel Vadot peripheral clock for the inside functionality of the hardware block. 57c9ccf3a3SEmmanuel Vadot This is named 'pclk'. The second clock must be the cross domain clock, 58c9ccf3a3SEmmanuel Vadot in which CSI2DC will perform clock crossing. This clock must be fed 59c9ccf3a3SEmmanuel Vadot by the next controller in pipeline, which usually is a sensor controller. 60c9ccf3a3SEmmanuel Vadot Normally this clock should be given by this sensor controller who 61c9ccf3a3SEmmanuel Vadot is also a clock source. This clock is named 'scck', sensor controller clock. 62c9ccf3a3SEmmanuel Vadot items: 63c9ccf3a3SEmmanuel Vadot - const: pclk 64c9ccf3a3SEmmanuel Vadot - const: scck 65c9ccf3a3SEmmanuel Vadot 66c9ccf3a3SEmmanuel Vadot dmas: 67c9ccf3a3SEmmanuel Vadot maxItems: 1 68c9ccf3a3SEmmanuel Vadot 69c9ccf3a3SEmmanuel Vadot dma-names: 70c9ccf3a3SEmmanuel Vadot const: rx 71c9ccf3a3SEmmanuel Vadot 72c9ccf3a3SEmmanuel Vadot ports: 73c9ccf3a3SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/ports 74c9ccf3a3SEmmanuel Vadot 75c9ccf3a3SEmmanuel Vadot properties: 76c9ccf3a3SEmmanuel Vadot port@0: 77c9ccf3a3SEmmanuel Vadot $ref: /schemas/graph.yaml#/$defs/port-base 78*7ef62cebSEmmanuel Vadot unevaluatedProperties: false 79c9ccf3a3SEmmanuel Vadot description: 80c9ccf3a3SEmmanuel Vadot Input port node, single endpoint describing the input port. 81c9ccf3a3SEmmanuel Vadot 82c9ccf3a3SEmmanuel Vadot properties: 83c9ccf3a3SEmmanuel Vadot endpoint: 84c9ccf3a3SEmmanuel Vadot $ref: video-interfaces.yaml# 85c9ccf3a3SEmmanuel Vadot unevaluatedProperties: false 86c9ccf3a3SEmmanuel Vadot description: Endpoint connected to input device 87c9ccf3a3SEmmanuel Vadot 88c9ccf3a3SEmmanuel Vadot properties: 89c9ccf3a3SEmmanuel Vadot bus-type: 90c9ccf3a3SEmmanuel Vadot enum: [4, 5, 6] 91c9ccf3a3SEmmanuel Vadot default: 4 92c9ccf3a3SEmmanuel Vadot 93c9ccf3a3SEmmanuel Vadot bus-width: 94c9ccf3a3SEmmanuel Vadot enum: [8, 9, 10, 11, 12, 13, 14] 95c9ccf3a3SEmmanuel Vadot default: 14 96c9ccf3a3SEmmanuel Vadot 97c9ccf3a3SEmmanuel Vadot clock-noncontinuous: 98c9ccf3a3SEmmanuel Vadot type: boolean 99c9ccf3a3SEmmanuel Vadot description: 100c9ccf3a3SEmmanuel Vadot Presence of this boolean property decides whether clock is 101c9ccf3a3SEmmanuel Vadot continuous or noncontinuous. 102c9ccf3a3SEmmanuel Vadot 103c9ccf3a3SEmmanuel Vadot remote-endpoint: true 104c9ccf3a3SEmmanuel Vadot 105c9ccf3a3SEmmanuel Vadot port@1: 106c9ccf3a3SEmmanuel Vadot $ref: /schemas/graph.yaml#/$defs/port-base 107*7ef62cebSEmmanuel Vadot unevaluatedProperties: false 108c9ccf3a3SEmmanuel Vadot description: 109c9ccf3a3SEmmanuel Vadot Output port node, single endpoint describing the output port. 110c9ccf3a3SEmmanuel Vadot 111c9ccf3a3SEmmanuel Vadot properties: 112c9ccf3a3SEmmanuel Vadot endpoint: 113c9ccf3a3SEmmanuel Vadot unevaluatedProperties: false 114c9ccf3a3SEmmanuel Vadot $ref: video-interfaces.yaml# 115c9ccf3a3SEmmanuel Vadot description: Endpoint connected to output device 116c9ccf3a3SEmmanuel Vadot 117c9ccf3a3SEmmanuel Vadot properties: 118c9ccf3a3SEmmanuel Vadot bus-type: 119c9ccf3a3SEmmanuel Vadot enum: [5, 6] 120c9ccf3a3SEmmanuel Vadot default: 5 121c9ccf3a3SEmmanuel Vadot 122c9ccf3a3SEmmanuel Vadot bus-width: 123c9ccf3a3SEmmanuel Vadot enum: [8, 9, 10, 11, 12, 13, 14] 124c9ccf3a3SEmmanuel Vadot default: 14 125c9ccf3a3SEmmanuel Vadot 126c9ccf3a3SEmmanuel Vadot remote-endpoint: true 127c9ccf3a3SEmmanuel Vadot 128c9ccf3a3SEmmanuel Vadot required: 129c9ccf3a3SEmmanuel Vadot - port@0 130c9ccf3a3SEmmanuel Vadot - port@1 131c9ccf3a3SEmmanuel Vadot 132c9ccf3a3SEmmanuel VadotadditionalProperties: false 133c9ccf3a3SEmmanuel Vadot 134c9ccf3a3SEmmanuel Vadotrequired: 135c9ccf3a3SEmmanuel Vadot - compatible 136c9ccf3a3SEmmanuel Vadot - reg 137c9ccf3a3SEmmanuel Vadot - clocks 138c9ccf3a3SEmmanuel Vadot - clock-names 139c9ccf3a3SEmmanuel Vadot - ports 140c9ccf3a3SEmmanuel Vadot 141c9ccf3a3SEmmanuel Vadotexamples: 142c9ccf3a3SEmmanuel Vadot # Example for connecting to a parallel sensor controller block (video pipe) 143c9ccf3a3SEmmanuel Vadot # and the input is received from Synopsys IDI interface 144c9ccf3a3SEmmanuel Vadot - | 145c9ccf3a3SEmmanuel Vadot csi2dc@e1404000 { 146c9ccf3a3SEmmanuel Vadot compatible = "microchip,sama7g5-csi2dc"; 147c9ccf3a3SEmmanuel Vadot reg = <0xe1404000 0x500>; 148c9ccf3a3SEmmanuel Vadot clocks = <&pclk>, <&scck>; 149c9ccf3a3SEmmanuel Vadot clock-names = "pclk", "scck"; 150c9ccf3a3SEmmanuel Vadot 151c9ccf3a3SEmmanuel Vadot ports { 152c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 153c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 154c9ccf3a3SEmmanuel Vadot port@0 { 155c9ccf3a3SEmmanuel Vadot reg = <0>; /* must be 0, first child port */ 156c9ccf3a3SEmmanuel Vadot csi2dc_in: endpoint { /* input from IDI interface */ 157c9ccf3a3SEmmanuel Vadot bus-type = <4>; /* MIPI CSI2 D-PHY */ 158c9ccf3a3SEmmanuel Vadot remote-endpoint = <&csi2host_out>; 159c9ccf3a3SEmmanuel Vadot }; 160c9ccf3a3SEmmanuel Vadot }; 161c9ccf3a3SEmmanuel Vadot 162c9ccf3a3SEmmanuel Vadot port@1 { 163c9ccf3a3SEmmanuel Vadot reg = <1>; /* must be 1, second child port */ 164c9ccf3a3SEmmanuel Vadot csi2dc_out: endpoint { 165c9ccf3a3SEmmanuel Vadot remote-endpoint = <&xisc_in>; /* output to sensor controller */ 166c9ccf3a3SEmmanuel Vadot }; 167c9ccf3a3SEmmanuel Vadot }; 168c9ccf3a3SEmmanuel Vadot }; 169c9ccf3a3SEmmanuel Vadot }; 170c9ccf3a3SEmmanuel Vadot 171c9ccf3a3SEmmanuel Vadot # Example for connecting to a DMA master as an AHB slave 172c9ccf3a3SEmmanuel Vadot # and the input is received from Synopsys IDI interface 173c9ccf3a3SEmmanuel Vadot - | 174c9ccf3a3SEmmanuel Vadot #include <dt-bindings/dma/at91.h> 175c9ccf3a3SEmmanuel Vadot csi2dc@e1404000 { 176c9ccf3a3SEmmanuel Vadot compatible = "microchip,sama7g5-csi2dc"; 177c9ccf3a3SEmmanuel Vadot reg = <0xe1404000 0x500>; 178c9ccf3a3SEmmanuel Vadot clocks = <&pclk>, <&scck>; 179c9ccf3a3SEmmanuel Vadot clock-names = "pclk", "scck"; 180c9ccf3a3SEmmanuel Vadot dmas = <&dma0 AT91_XDMAC_DT_PERID(34)>; 181c9ccf3a3SEmmanuel Vadot dma-names = "rx"; 182c9ccf3a3SEmmanuel Vadot 183c9ccf3a3SEmmanuel Vadot ports { 184c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 185c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 186c9ccf3a3SEmmanuel Vadot port@0 { 187c9ccf3a3SEmmanuel Vadot reg = <0>; /* must be 0, first child port */ 188c9ccf3a3SEmmanuel Vadot csi2dc_input: endpoint { /* input from IDI interface */ 189c9ccf3a3SEmmanuel Vadot remote-endpoint = <&csi2host_out>; 190c9ccf3a3SEmmanuel Vadot }; 191c9ccf3a3SEmmanuel Vadot }; 192c9ccf3a3SEmmanuel Vadot 193c9ccf3a3SEmmanuel Vadot port@1 { 194c9ccf3a3SEmmanuel Vadot reg = <1>; 195c9ccf3a3SEmmanuel Vadot }; 196c9ccf3a3SEmmanuel Vadot }; 197c9ccf3a3SEmmanuel Vadot }; 198c9ccf3a3SEmmanuel Vadot 199c9ccf3a3SEmmanuel Vadot... 200