renesas,drif.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. Renesas R-Car Gen3 Digital Radio Interface controller (DRIF)
  2. ------------------------------------------------------------
  3. R-Car Gen3 DRIF is a SPI like receive only slave device. A general
  4. representation of DRIF interfacing with a master device is shown below.
  5. +---------------------+ +---------------------+
  6. | |-----SCK------->|CLK |
  7. | Master |-----SS-------->|SYNC DRIFn (slave) |
  8. | |-----SD0------->|D0 |
  9. | |-----SD1------->|D1 |
  10. +---------------------+ +---------------------+
  11. As per datasheet, each DRIF channel (drifn) is made up of two internal
  12. channels (drifn0 & drifn1). These two internal channels share the common
  13. CLK & SYNC. Each internal channel has its own dedicated resources like
  14. irq, dma channels, address space & clock. This internal split is not
  15. visible to the external master device.
  16. The device tree model represents each internal channel as a separate node.
  17. The internal channels sharing the CLK & SYNC are tied together by their
  18. phandles using a property called "renesas,bonding". For the rest of
  19. the documentation, unless explicitly stated, the word channel implies an
  20. internal channel.
  21. When both internal channels are enabled they need to be managed together
  22. as one (i.e.) they cannot operate alone as independent devices. Out of the
  23. two, one of them needs to act as a primary device that accepts common
  24. properties of both the internal channels. This channel is identified by a
  25. property called "renesas,primary-bond".
  26. To summarize,
  27. - When both the internal channels that are bonded together are enabled,
  28. the zeroth channel is selected as primary-bond. This channels accepts
  29. properties common to all the members of the bond.
  30. - When only one of the bonded channels need to be enabled, the property
  31. "renesas,bonding" or "renesas,primary-bond" will have no effect. That
  32. enabled channel can act alone as any other independent device.
  33. Required properties of an internal channel:
  34. -------------------------------------------
  35. - compatible: "renesas,r8a7795-drif" if DRIF controller is a part of R8A7795 SoC.
  36. "renesas,r8a7796-drif" if DRIF controller is a part of R8A7796 SoC.
  37. "renesas,rcar-gen3-drif" for a generic R-Car Gen3 compatible device.
  38. When compatible with the generic version, nodes must list the
  39. SoC-specific version corresponding to the platform first
  40. followed by the generic version.
  41. - reg: offset and length of that channel.
  42. - interrupts: associated with that channel.
  43. - clocks: phandle and clock specifier of that channel.
  44. - clock-names: clock input name string: "fck".
  45. - dmas: phandles to the DMA channels.
  46. - dma-names: names of the DMA channel: "rx".
  47. - renesas,bonding: phandle to the other channel.
  48. Optional properties of an internal channel:
  49. -------------------------------------------
  50. - power-domains: phandle to the respective power domain.
  51. Required properties of an internal channel when:
  52. - It is the only enabled channel of the bond (or)
  53. - If it acts as primary among enabled bonds
  54. --------------------------------------------------------
  55. - pinctrl-0: pin control group to be used for this channel.
  56. - pinctrl-names: must be "default".
  57. - renesas,primary-bond: empty property indicating the channel acts as primary
  58. among the bonded channels.
  59. - port: child port node corresponding to the data input, in accordance with
  60. the video interface bindings defined in
  61. Documentation/devicetree/bindings/media/video-interfaces.txt. The port
  62. node must contain at least one endpoint.
  63. Optional endpoint property:
  64. ---------------------------
  65. - sync-active: Indicates sync signal polarity, 0/1 for low/high respectively.
  66. This property maps to SYNCAC bit in the hardware manual. The
  67. default is 1 (active high).
  68. Example:
  69. --------
  70. (1) Both internal channels enabled:
  71. -----------------------------------
  72. When interfacing with a third party tuner device with two data pins as shown
  73. below.
  74. +---------------------+ +---------------------+
  75. | |-----SCK------->|CLK |
  76. | Master |-----SS-------->|SYNC DRIFn (slave) |
  77. | |-----SD0------->|D0 |
  78. | |-----SD1------->|D1 |
  79. +---------------------+ +---------------------+
  80. drif00: rif@e6f40000 {
  81. compatible = "renesas,r8a7795-drif",
  82. "renesas,rcar-gen3-drif";
  83. reg = <0 0xe6f40000 0 0x64>;
  84. interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
  85. clocks = <&cpg CPG_MOD 515>;
  86. clock-names = "fck";
  87. dmas = <&dmac1 0x20>, <&dmac2 0x20>;
  88. dma-names = "rx", "rx";
  89. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  90. renesas,bonding = <&drif01>;
  91. renesas,primary-bond;
  92. pinctrl-0 = <&drif0_pins>;
  93. pinctrl-names = "default";
  94. port {
  95. drif0_ep: endpoint {
  96. remote-endpoint = <&tuner_ep>;
  97. };
  98. };
  99. };
  100. drif01: rif@e6f50000 {
  101. compatible = "renesas,r8a7795-drif",
  102. "renesas,rcar-gen3-drif";
  103. reg = <0 0xe6f50000 0 0x64>;
  104. interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
  105. clocks = <&cpg CPG_MOD 514>;
  106. clock-names = "fck";
  107. dmas = <&dmac1 0x22>, <&dmac2 0x22>;
  108. dma-names = "rx", "rx";
  109. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  110. renesas,bonding = <&drif00>;
  111. };
  112. (2) Internal channel 1 alone is enabled:
  113. ----------------------------------------
  114. When interfacing with a third party tuner device with one data pin as shown
  115. below.
  116. +---------------------+ +---------------------+
  117. | |-----SCK------->|CLK |
  118. | Master |-----SS-------->|SYNC DRIFn (slave) |
  119. | | |D0 (unused) |
  120. | |-----SD-------->|D1 |
  121. +---------------------+ +---------------------+
  122. drif00: rif@e6f40000 {
  123. compatible = "renesas,r8a7795-drif",
  124. "renesas,rcar-gen3-drif";
  125. reg = <0 0xe6f40000 0 0x64>;
  126. interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
  127. clocks = <&cpg CPG_MOD 515>;
  128. clock-names = "fck";
  129. dmas = <&dmac1 0x20>, <&dmac2 0x20>;
  130. dma-names = "rx", "rx";
  131. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  132. renesas,bonding = <&drif01>;
  133. };
  134. drif01: rif@e6f50000 {
  135. compatible = "renesas,r8a7795-drif",
  136. "renesas,rcar-gen3-drif";
  137. reg = <0 0xe6f50000 0 0x64>;
  138. interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
  139. clocks = <&cpg CPG_MOD 514>;
  140. clock-names = "fck";
  141. dmas = <&dmac1 0x22>, <&dmac2 0x22>;
  142. dma-names = "rx", "rx";
  143. power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
  144. renesas,bonding = <&drif00>;
  145. pinctrl-0 = <&drif0_pins>;
  146. pinctrl-names = "default";
  147. port {
  148. drif0_ep: endpoint {
  149. remote-endpoint = <&tuner_ep>;
  150. sync-active = <0>;
  151. };
  152. };
  153. };