rcar_vin.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. Renesas R-Car Video Input driver (rcar_vin)
  2. -------------------------------------------
  3. The rcar_vin device provides video input capabilities for the Renesas R-Car
  4. family of devices.
  5. Each VIN instance has a single parallel input that supports RGB and YUV video,
  6. with both external synchronization and BT.656 synchronization for the latter.
  7. Depending on the instance the VIN input is connected to external SoC pins, or
  8. on Gen3 platforms to a CSI-2 receiver.
  9. - compatible: Must be one or more of the following
  10. - "renesas,vin-r8a7743" for the R8A7743 device
  11. - "renesas,vin-r8a7745" for the R8A7745 device
  12. - "renesas,vin-r8a7778" for the R8A7778 device
  13. - "renesas,vin-r8a7779" for the R8A7779 device
  14. - "renesas,vin-r8a7790" for the R8A7790 device
  15. - "renesas,vin-r8a7791" for the R8A7791 device
  16. - "renesas,vin-r8a7792" for the R8A7792 device
  17. - "renesas,vin-r8a7793" for the R8A7793 device
  18. - "renesas,vin-r8a7794" for the R8A7794 device
  19. - "renesas,vin-r8a7795" for the R8A7795 device
  20. - "renesas,vin-r8a7796" for the R8A7796 device
  21. - "renesas,vin-r8a77965" for the R8A77965 device
  22. - "renesas,vin-r8a77970" for the R8A77970 device
  23. - "renesas,vin-r8a77995" for the R8A77995 device
  24. - "renesas,rcar-gen2-vin" for a generic R-Car Gen2 or RZ/G1 compatible
  25. device.
  26. When compatible with the generic version nodes must list the
  27. SoC-specific version corresponding to the platform first
  28. followed by the generic version.
  29. - reg: the register base and size for the device registers
  30. - interrupts: the interrupt for the device
  31. - clocks: Reference to the parent clock
  32. Additionally, an alias named vinX will need to be created to specify
  33. which video input device this is.
  34. The per-board settings Gen2 platforms:
  35. - port - sub-node describing a single endpoint connected to the VIN
  36. from external SoC pins as described in video-interfaces.txt[1].
  37. Only the first one will be considered as each vin interface has one
  38. input port.
  39. - Optional properties for endpoint nodes:
  40. - hsync-active: see [1] for description. Default is active high.
  41. - vsync-active: see [1] for description. Default is active high.
  42. If both HSYNC and VSYNC polarities are not specified, embedded
  43. synchronization is selected.
  44. - field-active-even: see [1] for description. Default is active high.
  45. - bus-width: see [1] for description. The selected bus width depends on
  46. the SoC type and selected input image format.
  47. Valid values are: 8, 10, 12, 16, 24 and 32.
  48. - data-shift: see [1] for description. Valid values are 0 and 8.
  49. - data-enable-active: polarity of CLKENB signal, see [1] for
  50. description. Default is active high.
  51. The per-board settings Gen3 platforms:
  52. Gen3 platforms can support both a single connected parallel input source
  53. from external SoC pins (port@0) and/or multiple parallel input sources
  54. from local SoC CSI-2 receivers (port@1) depending on SoC.
  55. - renesas,id - ID number of the VIN, VINx in the documentation.
  56. - ports
  57. - port@0 - sub-node describing a single endpoint connected to the VIN
  58. from external SoC pins as described in video-interfaces.txt[1].
  59. Describing more than one endpoint in port@0 is invalid. Only VIN
  60. instances that are connected to external pins should have port@0.
  61. Endpoint nodes of port@0 support the optional properties listed in
  62. the Gen2 per-board settings description.
  63. - port@1 - sub-nodes describing one or more endpoints connected to
  64. the VIN from local SoC CSI-2 receivers. The endpoint numbers must
  65. use the following schema.
  66. - endpoint@0 - sub-node describing the endpoint connected to CSI20
  67. - endpoint@1 - sub-node describing the endpoint connected to CSI21
  68. - endpoint@2 - sub-node describing the endpoint connected to CSI40
  69. - endpoint@3 - sub-node describing the endpoint connected to CSI41
  70. Endpoint nodes of port@1 do not support any optional endpoint property.
  71. Device node example for Gen2 platforms
  72. --------------------------------------
  73. aliases {
  74. vin0 = &vin0;
  75. };
  76. vin0: vin@e6ef0000 {
  77. compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin";
  78. clocks = <&mstp8_clks R8A7790_CLK_VIN0>;
  79. reg = <0 0xe6ef0000 0 0x1000>;
  80. interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>;
  81. status = "disabled";
  82. };
  83. Board setup example for Gen2 platforms (vin1 composite video input)
  84. -------------------------------------------------------------------
  85. &i2c2 {
  86. status = "okay";
  87. pinctrl-0 = <&i2c2_pins>;
  88. pinctrl-names = "default";
  89. adv7180@20 {
  90. compatible = "adi,adv7180";
  91. reg = <0x20>;
  92. remote = <&vin1>;
  93. port {
  94. adv7180: endpoint {
  95. bus-width = <8>;
  96. remote-endpoint = <&vin1ep0>;
  97. };
  98. };
  99. };
  100. };
  101. /* composite video input */
  102. &vin1 {
  103. pinctrl-0 = <&vin1_pins>;
  104. pinctrl-names = "default";
  105. status = "okay";
  106. port {
  107. vin1ep0: endpoint {
  108. remote-endpoint = <&adv7180>;
  109. bus-width = <8>;
  110. };
  111. };
  112. };
  113. Device node example for Gen3 platforms
  114. --------------------------------------
  115. vin0: video@e6ef0000 {
  116. compatible = "renesas,vin-r8a7795";
  117. reg = <0 0xe6ef0000 0 0x1000>;
  118. interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
  119. clocks = <&cpg CPG_MOD 811>;
  120. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  121. resets = <&cpg 811>;
  122. renesas,id = <0>;
  123. ports {
  124. #address-cells = <1>;
  125. #size-cells = <0>;
  126. port@1 {
  127. #address-cells = <1>;
  128. #size-cells = <0>;
  129. reg = <1>;
  130. vin0csi20: endpoint@0 {
  131. reg = <0>;
  132. remote-endpoint= <&csi20vin0>;
  133. };
  134. vin0csi21: endpoint@1 {
  135. reg = <1>;
  136. remote-endpoint= <&csi21vin0>;
  137. };
  138. vin0csi40: endpoint@2 {
  139. reg = <2>;
  140. remote-endpoint= <&csi40vin0>;
  141. };
  142. };
  143. };
  144. };
  145. csi20: csi2@fea80000 {
  146. compatible = "renesas,r8a7795-csi2";
  147. reg = <0 0xfea80000 0 0x10000>;
  148. interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
  149. clocks = <&cpg CPG_MOD 714>;
  150. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  151. resets = <&cpg 714>;
  152. ports {
  153. #address-cells = <1>;
  154. #size-cells = <0>;
  155. port@0 {
  156. reg = <0>;
  157. csi20_in: endpoint {
  158. clock-lanes = <0>;
  159. data-lanes = <1>;
  160. remote-endpoint = <&adv7482_txb>;
  161. };
  162. };
  163. port@1 {
  164. #address-cells = <1>;
  165. #size-cells = <0>;
  166. reg = <1>;
  167. csi20vin0: endpoint@0 {
  168. reg = <0>;
  169. remote-endpoint = <&vin0csi20>;
  170. };
  171. };
  172. };
  173. };
  174. [1] video-interfaces.txt common video media interface