1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only 2c66ec88fSEmmanuel Vadot# Copyright (C) 2020 Renesas Electronics Corp. 3c66ec88fSEmmanuel Vadot%YAML 1.2 4c66ec88fSEmmanuel Vadot--- 5c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/media/renesas,vin.yaml# 6c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7c66ec88fSEmmanuel Vadot 8c66ec88fSEmmanuel Vadottitle: Renesas R-Car Video Input (VIN) 9c66ec88fSEmmanuel Vadot 10c66ec88fSEmmanuel Vadotmaintainers: 11c66ec88fSEmmanuel Vadot - Niklas Söderlund <niklas.soderlund@ragnatech.se> 12c66ec88fSEmmanuel Vadot 13c66ec88fSEmmanuel Vadotdescription: 14c66ec88fSEmmanuel Vadot The R-Car Video Input (VIN) device provides video input capabilities for the 15c66ec88fSEmmanuel Vadot Renesas R-Car family of devices. 16c66ec88fSEmmanuel Vadot 17c66ec88fSEmmanuel Vadot Each VIN instance has a single parallel input that supports RGB and YUV video, 18c66ec88fSEmmanuel Vadot with both external synchronization and BT.656 synchronization for the latter. 19c66ec88fSEmmanuel Vadot Depending on the instance the VIN input is connected to external SoC pins, or 20c66ec88fSEmmanuel Vadot on Gen3 and RZ/G2 platforms to a CSI-2 receiver. 21c66ec88fSEmmanuel Vadot 22c66ec88fSEmmanuel Vadotproperties: 23c66ec88fSEmmanuel Vadot compatible: 24c66ec88fSEmmanuel Vadot oneOf: 25c66ec88fSEmmanuel Vadot - items: 26c66ec88fSEmmanuel Vadot - enum: 276be33864SEmmanuel Vadot - renesas,vin-r8a7742 # RZ/G1H 28c66ec88fSEmmanuel Vadot - renesas,vin-r8a7743 # RZ/G1M 29c66ec88fSEmmanuel Vadot - renesas,vin-r8a7744 # RZ/G1N 30c66ec88fSEmmanuel Vadot - renesas,vin-r8a7745 # RZ/G1E 31c66ec88fSEmmanuel Vadot - renesas,vin-r8a77470 # RZ/G1C 32c66ec88fSEmmanuel Vadot - renesas,vin-r8a7790 # R-Car H2 33c66ec88fSEmmanuel Vadot - renesas,vin-r8a7791 # R-Car M2-W 34c66ec88fSEmmanuel Vadot - renesas,vin-r8a7792 # R-Car V2H 35c66ec88fSEmmanuel Vadot - renesas,vin-r8a7793 # R-Car M2-N 36c66ec88fSEmmanuel Vadot - renesas,vin-r8a7794 # R-Car E2 37c66ec88fSEmmanuel Vadot - const: renesas,rcar-gen2-vin # Generic R-Car Gen2 or RZ/G1 38c66ec88fSEmmanuel Vadot 39c66ec88fSEmmanuel Vadot - items: 40c66ec88fSEmmanuel Vadot - enum: 41c66ec88fSEmmanuel Vadot - renesas,vin-r8a774a1 # RZ/G2M 42c66ec88fSEmmanuel Vadot - renesas,vin-r8a774b1 # RZ/G2N 43c66ec88fSEmmanuel Vadot - renesas,vin-r8a774c0 # RZ/G2E 446be33864SEmmanuel Vadot - renesas,vin-r8a774e1 # RZ/G2H 45c66ec88fSEmmanuel Vadot - renesas,vin-r8a7778 # R-Car M1 46c66ec88fSEmmanuel Vadot - renesas,vin-r8a7779 # R-Car H1 47c66ec88fSEmmanuel Vadot - renesas,vin-r8a7795 # R-Car H3 48c66ec88fSEmmanuel Vadot - renesas,vin-r8a7796 # R-Car M3-W 495956d97fSEmmanuel Vadot - renesas,vin-r8a77961 # R-Car M3-W+ 50c66ec88fSEmmanuel Vadot - renesas,vin-r8a77965 # R-Car M3-N 51c66ec88fSEmmanuel Vadot - renesas,vin-r8a77970 # R-Car V3M 52c66ec88fSEmmanuel Vadot - renesas,vin-r8a77980 # R-Car V3H 53c66ec88fSEmmanuel Vadot - renesas,vin-r8a77990 # R-Car E3 54c66ec88fSEmmanuel Vadot - renesas,vin-r8a77995 # R-Car D3 555956d97fSEmmanuel Vadot - renesas,vin-r8a779a0 # R-Car V3U 56fac71e4eSEmmanuel Vadot - renesas,vin-r8a779g0 # R-Car V4H 57c66ec88fSEmmanuel Vadot 58c66ec88fSEmmanuel Vadot reg: 59c66ec88fSEmmanuel Vadot maxItems: 1 60c66ec88fSEmmanuel Vadot 61c66ec88fSEmmanuel Vadot interrupts: 62c66ec88fSEmmanuel Vadot maxItems: 1 63c66ec88fSEmmanuel Vadot 64c66ec88fSEmmanuel Vadot clocks: 65c66ec88fSEmmanuel Vadot maxItems: 1 66c66ec88fSEmmanuel Vadot 67c66ec88fSEmmanuel Vadot power-domains: 68c66ec88fSEmmanuel Vadot maxItems: 1 69c66ec88fSEmmanuel Vadot 70c66ec88fSEmmanuel Vadot resets: 71c66ec88fSEmmanuel Vadot maxItems: 1 72c66ec88fSEmmanuel Vadot 73c66ec88fSEmmanuel Vadot # The per-board settings for Gen2 and RZ/G1 platforms: 74c66ec88fSEmmanuel Vadot port: 755def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/$defs/port-base 765def4c47SEmmanuel Vadot unevaluatedProperties: false 77c66ec88fSEmmanuel Vadot description: 785def4c47SEmmanuel Vadot A node containing a parallel input 79c66ec88fSEmmanuel Vadot 80c66ec88fSEmmanuel Vadot properties: 81c66ec88fSEmmanuel Vadot endpoint: 825def4c47SEmmanuel Vadot $ref: video-interfaces.yaml# 835def4c47SEmmanuel Vadot unevaluatedProperties: false 84c66ec88fSEmmanuel Vadot 85c66ec88fSEmmanuel Vadot properties: 86c66ec88fSEmmanuel Vadot hsync-active: 87c66ec88fSEmmanuel Vadot description: 88c66ec88fSEmmanuel Vadot If both HSYNC and VSYNC polarities are not specified, embedded 89c66ec88fSEmmanuel Vadot synchronization is selected. 90c66ec88fSEmmanuel Vadot default: 1 91c66ec88fSEmmanuel Vadot 92c66ec88fSEmmanuel Vadot vsync-active: 93c66ec88fSEmmanuel Vadot description: 94c66ec88fSEmmanuel Vadot If both HSYNC and VSYNC polarities are not specified, embedded 95c66ec88fSEmmanuel Vadot synchronization is selected. 96c66ec88fSEmmanuel Vadot default: 1 97c66ec88fSEmmanuel Vadot 98*aa1a8ff2SEmmanuel Vadot field-even-active: true 99c66ec88fSEmmanuel Vadot 100c66ec88fSEmmanuel Vadot bus-width: true 101c66ec88fSEmmanuel Vadot 102c66ec88fSEmmanuel Vadot data-shift: true 103c66ec88fSEmmanuel Vadot 104c66ec88fSEmmanuel Vadot data-enable-active: 105c66ec88fSEmmanuel Vadot description: Polarity of CLKENB signal 106c66ec88fSEmmanuel Vadot default: 1 107c66ec88fSEmmanuel Vadot 108c66ec88fSEmmanuel Vadot pclk-sample: true 109c66ec88fSEmmanuel Vadot 110c66ec88fSEmmanuel Vadot data-active: true 111c66ec88fSEmmanuel Vadot 112c66ec88fSEmmanuel Vadot # The per-board settings for Gen3 and RZ/G2 platforms: 113c66ec88fSEmmanuel Vadot renesas,id: 114c66ec88fSEmmanuel Vadot description: VIN channel number 115c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 116c66ec88fSEmmanuel Vadot minimum: 0 1175956d97fSEmmanuel Vadot maximum: 31 118c66ec88fSEmmanuel Vadot 119c66ec88fSEmmanuel Vadot ports: 1205def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/ports 121c66ec88fSEmmanuel Vadot 122c66ec88fSEmmanuel Vadot properties: 123c66ec88fSEmmanuel Vadot port@0: 1245956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/$defs/port-base 1255956d97fSEmmanuel Vadot unevaluatedProperties: false 126c66ec88fSEmmanuel Vadot description: 127c66ec88fSEmmanuel Vadot Input port node, single endpoint describing a parallel input source. 128c66ec88fSEmmanuel Vadot 129c66ec88fSEmmanuel Vadot properties: 130c66ec88fSEmmanuel Vadot endpoint: 1315def4c47SEmmanuel Vadot $ref: video-interfaces.yaml# 1325def4c47SEmmanuel Vadot unevaluatedProperties: false 133c66ec88fSEmmanuel Vadot 134c66ec88fSEmmanuel Vadot properties: 135c66ec88fSEmmanuel Vadot hsync-active: 136c66ec88fSEmmanuel Vadot description: 137c66ec88fSEmmanuel Vadot If both HSYNC and VSYNC polarities are not specified, embedded 138c66ec88fSEmmanuel Vadot synchronization is selected. 139c66ec88fSEmmanuel Vadot default: 1 140c66ec88fSEmmanuel Vadot 141c66ec88fSEmmanuel Vadot vsync-active: 142c66ec88fSEmmanuel Vadot description: 143c66ec88fSEmmanuel Vadot If both HSYNC and VSYNC polarities are not specified, embedded 144c66ec88fSEmmanuel Vadot synchronization is selected. 145c66ec88fSEmmanuel Vadot default: 1 146c66ec88fSEmmanuel Vadot 147*aa1a8ff2SEmmanuel Vadot field-even-active: true 148c66ec88fSEmmanuel Vadot 149c66ec88fSEmmanuel Vadot bus-width: true 150c66ec88fSEmmanuel Vadot 151c66ec88fSEmmanuel Vadot data-shift: true 152c66ec88fSEmmanuel Vadot 153c66ec88fSEmmanuel Vadot data-enable-active: 154c66ec88fSEmmanuel Vadot description: Polarity of CLKENB signal 155c66ec88fSEmmanuel Vadot default: 1 156c66ec88fSEmmanuel Vadot 157c66ec88fSEmmanuel Vadot pclk-sample: true 158c66ec88fSEmmanuel Vadot 159c66ec88fSEmmanuel Vadot data-active: true 160c66ec88fSEmmanuel Vadot 161c66ec88fSEmmanuel Vadot port@1: 1625def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 163c66ec88fSEmmanuel Vadot description: 164c66ec88fSEmmanuel Vadot Input port node, multiple endpoints describing all the R-Car CSI-2 165c66ec88fSEmmanuel Vadot modules connected the VIN. 166c66ec88fSEmmanuel Vadot 167c66ec88fSEmmanuel Vadot properties: 168c66ec88fSEmmanuel Vadot endpoint@0: 1695def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 170c66ec88fSEmmanuel Vadot description: Endpoint connected to CSI20. 171c66ec88fSEmmanuel Vadot 172c66ec88fSEmmanuel Vadot endpoint@1: 1735def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 174c66ec88fSEmmanuel Vadot description: Endpoint connected to CSI21. 175c66ec88fSEmmanuel Vadot 176c66ec88fSEmmanuel Vadot endpoint@2: 1775def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 178c66ec88fSEmmanuel Vadot description: Endpoint connected to CSI40. 179c66ec88fSEmmanuel Vadot 180c66ec88fSEmmanuel Vadot endpoint@3: 1815def4c47SEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 182c66ec88fSEmmanuel Vadot description: Endpoint connected to CSI41. 183c66ec88fSEmmanuel Vadot 184c66ec88fSEmmanuel Vadot anyOf: 185c66ec88fSEmmanuel Vadot - required: 186c66ec88fSEmmanuel Vadot - endpoint@0 187c66ec88fSEmmanuel Vadot - required: 188c66ec88fSEmmanuel Vadot - endpoint@1 189c66ec88fSEmmanuel Vadot - required: 190c66ec88fSEmmanuel Vadot - endpoint@2 191c66ec88fSEmmanuel Vadot - required: 192c66ec88fSEmmanuel Vadot - endpoint@3 193c66ec88fSEmmanuel Vadot 1945956d97fSEmmanuel Vadot port@2: 1955956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 1965956d97fSEmmanuel Vadot description: 1975956d97fSEmmanuel Vadot Input port node, multiple endpoints describing all the R-Car ISP 1985956d97fSEmmanuel Vadot modules connected the VIN. 1995956d97fSEmmanuel Vadot 2005956d97fSEmmanuel Vadot properties: 2015956d97fSEmmanuel Vadot endpoint@0: 2025956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 2035956d97fSEmmanuel Vadot description: Endpoint connected to ISP0. 2045956d97fSEmmanuel Vadot 2055956d97fSEmmanuel Vadot endpoint@1: 2065956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 2075956d97fSEmmanuel Vadot description: Endpoint connected to ISP1. 2085956d97fSEmmanuel Vadot 2095956d97fSEmmanuel Vadot endpoint@2: 2105956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 2115956d97fSEmmanuel Vadot description: Endpoint connected to ISP2. 2125956d97fSEmmanuel Vadot 2135956d97fSEmmanuel Vadot endpoint@3: 2145956d97fSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/endpoint 2155956d97fSEmmanuel Vadot description: Endpoint connected to ISP3. 2165956d97fSEmmanuel Vadot 217c66ec88fSEmmanuel Vadotrequired: 218c66ec88fSEmmanuel Vadot - compatible 219c66ec88fSEmmanuel Vadot - reg 220c66ec88fSEmmanuel Vadot - interrupts 221c66ec88fSEmmanuel Vadot - clocks 222c66ec88fSEmmanuel Vadot - power-domains 2232eb4d8dcSEmmanuel Vadot 2242eb4d8dcSEmmanuel VadotallOf: 2252eb4d8dcSEmmanuel Vadot - if: 2262eb4d8dcSEmmanuel Vadot not: 2272eb4d8dcSEmmanuel Vadot properties: 2282eb4d8dcSEmmanuel Vadot compatible: 2292eb4d8dcSEmmanuel Vadot contains: 2302eb4d8dcSEmmanuel Vadot enum: 2312eb4d8dcSEmmanuel Vadot - renesas,vin-r8a7778 2322eb4d8dcSEmmanuel Vadot - renesas,vin-r8a7779 2332eb4d8dcSEmmanuel Vadot then: 2342eb4d8dcSEmmanuel Vadot required: 235c66ec88fSEmmanuel Vadot - resets 236c66ec88fSEmmanuel Vadot 2372eb4d8dcSEmmanuel Vadot - if: 238c66ec88fSEmmanuel Vadot properties: 239c66ec88fSEmmanuel Vadot compatible: 240c66ec88fSEmmanuel Vadot contains: 241c66ec88fSEmmanuel Vadot enum: 242c66ec88fSEmmanuel Vadot - renesas,vin-r8a7778 243c66ec88fSEmmanuel Vadot - renesas,vin-r8a7779 244c66ec88fSEmmanuel Vadot - renesas,rcar-gen2-vin 245c66ec88fSEmmanuel Vadot then: 246c66ec88fSEmmanuel Vadot required: 247c66ec88fSEmmanuel Vadot - port 248c66ec88fSEmmanuel Vadot else: 249c66ec88fSEmmanuel Vadot required: 250c66ec88fSEmmanuel Vadot - renesas,id 251c66ec88fSEmmanuel Vadot - ports 252c66ec88fSEmmanuel Vadot 253c66ec88fSEmmanuel VadotadditionalProperties: false 254c66ec88fSEmmanuel Vadot 255c66ec88fSEmmanuel Vadotexamples: 256c66ec88fSEmmanuel Vadot # Device node example for Gen2 platform 257c66ec88fSEmmanuel Vadot - | 258c66ec88fSEmmanuel Vadot #include <dt-bindings/clock/r8a7790-cpg-mssr.h> 259c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 260c66ec88fSEmmanuel Vadot #include <dt-bindings/power/r8a7790-sysc.h> 261c66ec88fSEmmanuel Vadot 262c66ec88fSEmmanuel Vadot vin1: vin@e6ef1000 { 263c66ec88fSEmmanuel Vadot compatible = "renesas,vin-r8a7790", 264c66ec88fSEmmanuel Vadot "renesas,rcar-gen2-vin"; 265c66ec88fSEmmanuel Vadot reg = <0xe6ef1000 0x1000>; 266c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 267c66ec88fSEmmanuel Vadot clocks = <&cpg CPG_MOD 810>; 268c66ec88fSEmmanuel Vadot power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 269c66ec88fSEmmanuel Vadot resets = <&cpg 810>; 270c66ec88fSEmmanuel Vadot 271c66ec88fSEmmanuel Vadot port { 272c66ec88fSEmmanuel Vadot vin1ep0: endpoint { 273c66ec88fSEmmanuel Vadot remote-endpoint = <&adv7180>; 274c66ec88fSEmmanuel Vadot bus-width = <8>; 275c66ec88fSEmmanuel Vadot }; 276c66ec88fSEmmanuel Vadot }; 277c66ec88fSEmmanuel Vadot }; 278c66ec88fSEmmanuel Vadot 279c66ec88fSEmmanuel Vadot # Device node example for Gen3 platform with only CSI-2 280c66ec88fSEmmanuel Vadot - | 281c66ec88fSEmmanuel Vadot #include <dt-bindings/clock/r8a7795-cpg-mssr.h> 282c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 283c66ec88fSEmmanuel Vadot #include <dt-bindings/power/r8a7795-sysc.h> 284c66ec88fSEmmanuel Vadot 285c66ec88fSEmmanuel Vadot vin0: video@e6ef0000 { 286c66ec88fSEmmanuel Vadot compatible = "renesas,vin-r8a7795"; 287c66ec88fSEmmanuel Vadot reg = <0xe6ef0000 0x1000>; 288c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 289c66ec88fSEmmanuel Vadot clocks = <&cpg CPG_MOD 811>; 290c66ec88fSEmmanuel Vadot power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 291c66ec88fSEmmanuel Vadot resets = <&cpg 811>; 292c66ec88fSEmmanuel Vadot renesas,id = <0>; 293c66ec88fSEmmanuel Vadot 294c66ec88fSEmmanuel Vadot ports { 295c66ec88fSEmmanuel Vadot #address-cells = <1>; 296c66ec88fSEmmanuel Vadot #size-cells = <0>; 297c66ec88fSEmmanuel Vadot 298c66ec88fSEmmanuel Vadot port@1 { 299c66ec88fSEmmanuel Vadot #address-cells = <1>; 300c66ec88fSEmmanuel Vadot #size-cells = <0>; 301c66ec88fSEmmanuel Vadot 302c66ec88fSEmmanuel Vadot reg = <1>; 303c66ec88fSEmmanuel Vadot 304c66ec88fSEmmanuel Vadot vin0csi20: endpoint@0 { 305c66ec88fSEmmanuel Vadot reg = <0>; 306c66ec88fSEmmanuel Vadot remote-endpoint = <&csi20vin0>; 307c66ec88fSEmmanuel Vadot }; 308c66ec88fSEmmanuel Vadot vin0csi40: endpoint@2 { 309c66ec88fSEmmanuel Vadot reg = <2>; 310c66ec88fSEmmanuel Vadot remote-endpoint = <&csi40vin0>; 311c66ec88fSEmmanuel Vadot }; 312c66ec88fSEmmanuel Vadot }; 313c66ec88fSEmmanuel Vadot }; 314c66ec88fSEmmanuel Vadot }; 315c66ec88fSEmmanuel Vadot 316c66ec88fSEmmanuel Vadot # Device node example for Gen3 platform with CSI-2 and parallel 317c66ec88fSEmmanuel Vadot - | 318c66ec88fSEmmanuel Vadot #include <dt-bindings/clock/r8a77970-cpg-mssr.h> 319c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 320c66ec88fSEmmanuel Vadot #include <dt-bindings/power/r8a77970-sysc.h> 321c66ec88fSEmmanuel Vadot 322c66ec88fSEmmanuel Vadot vin2: video@e6ef2000 { 323c66ec88fSEmmanuel Vadot compatible = "renesas,vin-r8a77970"; 324c66ec88fSEmmanuel Vadot reg = <0xe6ef2000 0x1000>; 325c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>; 326c66ec88fSEmmanuel Vadot clocks = <&cpg CPG_MOD 809>; 327c66ec88fSEmmanuel Vadot power-domains = <&sysc R8A77970_PD_ALWAYS_ON>; 328c66ec88fSEmmanuel Vadot resets = <&cpg 809>; 329c66ec88fSEmmanuel Vadot renesas,id = <2>; 330c66ec88fSEmmanuel Vadot 331c66ec88fSEmmanuel Vadot ports { 332c66ec88fSEmmanuel Vadot #address-cells = <1>; 333c66ec88fSEmmanuel Vadot #size-cells = <0>; 334c66ec88fSEmmanuel Vadot 335c66ec88fSEmmanuel Vadot port@0 { 336c66ec88fSEmmanuel Vadot reg = <0>; 337c66ec88fSEmmanuel Vadot 338c66ec88fSEmmanuel Vadot vin2_in: endpoint { 339c66ec88fSEmmanuel Vadot remote-endpoint = <&adv7612_out>; 340c66ec88fSEmmanuel Vadot hsync-active = <0>; 341c66ec88fSEmmanuel Vadot vsync-active = <0>; 342c66ec88fSEmmanuel Vadot }; 343c66ec88fSEmmanuel Vadot }; 344c66ec88fSEmmanuel Vadot 345c66ec88fSEmmanuel Vadot port@1 { 346c66ec88fSEmmanuel Vadot #address-cells = <1>; 347c66ec88fSEmmanuel Vadot #size-cells = <0>; 348c66ec88fSEmmanuel Vadot 349c66ec88fSEmmanuel Vadot reg = <1>; 350c66ec88fSEmmanuel Vadot 351c66ec88fSEmmanuel Vadot vin2csi40: endpoint@2 { 352c66ec88fSEmmanuel Vadot reg = <2>; 353c66ec88fSEmmanuel Vadot remote-endpoint = <&csi40vin2>; 354c66ec88fSEmmanuel Vadot }; 355c66ec88fSEmmanuel Vadot }; 356c66ec88fSEmmanuel Vadot }; 357c66ec88fSEmmanuel Vadot }; 358