sun4i-drm.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. Allwinner A10 Display Pipeline
  2. ==============================
  3. The Allwinner A10 Display pipeline is composed of several components
  4. that are going to be documented below:
  5. For all connections between components up to the TCONs in the display
  6. pipeline, when there are multiple components of the same type at the
  7. same depth, the local endpoint ID must be the same as the remote
  8. component's index. For example, if the remote endpoint is Frontend 1,
  9. then the local endpoint ID must be 1.
  10. Frontend 0 [0] ------- [0] Backend 0 [0] ------- [0] TCON 0
  11. [1] -- -- [1] [1] -- -- [1]
  12. \ / \ /
  13. X X
  14. / \ / \
  15. [0] -- -- [0] [0] -- -- [0]
  16. Frontend 1 [1] ------- [1] Backend 1 [1] ------- [1] TCON 1
  17. For a two pipeline system such as the one depicted above, the lines
  18. represent the connections between the components, while the numbers
  19. within the square brackets corresponds to the ID of the local endpoint.
  20. The same rule also applies to DE 2.0 mixer-TCON connections:
  21. Mixer 0 [0] ----------- [0] TCON 0
  22. [1] ---- ---- [1]
  23. \ /
  24. X
  25. / \
  26. [0] ---- ---- [0]
  27. Mixer 1 [1] ----------- [1] TCON 1
  28. HDMI Encoder
  29. ------------
  30. The HDMI Encoder supports the HDMI video and audio outputs, and does
  31. CEC. It is one end of the pipeline.
  32. Required properties:
  33. - compatible: value must be one of:
  34. * allwinner,sun4i-a10-hdmi
  35. * allwinner,sun5i-a10s-hdmi
  36. * allwinner,sun6i-a31-hdmi
  37. - reg: base address and size of memory-mapped region
  38. - interrupts: interrupt associated to this IP
  39. - clocks: phandles to the clocks feeding the HDMI encoder
  40. * ahb: the HDMI interface clock
  41. * mod: the HDMI module clock
  42. * ddc: the HDMI ddc clock (A31 only)
  43. * pll-0: the first video PLL
  44. * pll-1: the second video PLL
  45. - clock-names: the clock names mentioned above
  46. - resets: phandle to the reset control for the HDMI encoder (A31 only)
  47. - dmas: phandles to the DMA channels used by the HDMI encoder
  48. * ddc-tx: The channel for DDC transmission
  49. * ddc-rx: The channel for DDC reception
  50. * audio-tx: The channel used for audio transmission
  51. - dma-names: the channel names mentioned above
  52. - ports: A ports node with endpoint definitions as defined in
  53. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  54. first port should be the input endpoint. The second should be the
  55. output, usually to an HDMI connector.
  56. DWC HDMI TX Encoder
  57. -------------------
  58. The HDMI transmitter is a Synopsys DesignWare HDMI 1.4 TX controller IP
  59. with Allwinner's own PHY IP. It supports audio and video outputs and CEC.
  60. These DT bindings follow the Synopsys DWC HDMI TX bindings defined in
  61. Documentation/devicetree/bindings/display/bridge/dw_hdmi.txt with the
  62. following device-specific properties.
  63. Required properties:
  64. - compatible: value must be one of:
  65. * "allwinner,sun8i-a83t-dw-hdmi"
  66. - reg: base address and size of memory-mapped region
  67. - reg-io-width: See dw_hdmi.txt. Shall be 1.
  68. - interrupts: HDMI interrupt number
  69. - clocks: phandles to the clocks feeding the HDMI encoder
  70. * iahb: the HDMI bus clock
  71. * isfr: the HDMI register clock
  72. * tmds: TMDS clock
  73. - clock-names: the clock names mentioned above
  74. - resets: phandle to the reset controller
  75. - reset-names: must be "ctrl"
  76. - phys: phandle to the DWC HDMI PHY
  77. - phy-names: must be "phy"
  78. - ports: A ports node with endpoint definitions as defined in
  79. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  80. first port should be the input endpoint. The second should be the
  81. output, usually to an HDMI connector.
  82. DWC HDMI PHY
  83. ------------
  84. Required properties:
  85. - compatible: value must be one of:
  86. * allwinner,sun8i-a83t-hdmi-phy
  87. * allwinner,sun8i-h3-hdmi-phy
  88. * allwinner,sun50i-a64-hdmi-phy
  89. - reg: base address and size of memory-mapped region
  90. - clocks: phandles to the clocks feeding the HDMI PHY
  91. * bus: the HDMI PHY interface clock
  92. * mod: the HDMI PHY module clock
  93. - clock-names: the clock names mentioned above
  94. - resets: phandle to the reset controller driving the PHY
  95. - reset-names: must be "phy"
  96. H3 and A64 HDMI PHY require additional clocks:
  97. - pll-0: parent of phy clock
  98. - pll-1: second possible phy clock parent (A64 only)
  99. TV Encoder
  100. ----------
  101. The TV Encoder supports the composite and VGA output. It is one end of
  102. the pipeline.
  103. Required properties:
  104. - compatible: value should be "allwinner,sun4i-a10-tv-encoder".
  105. - reg: base address and size of memory-mapped region
  106. - clocks: the clocks driving the TV encoder
  107. - resets: phandle to the reset controller driving the encoder
  108. - ports: A ports node with endpoint definitions as defined in
  109. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  110. first port should be the input endpoint.
  111. TCON
  112. ----
  113. The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
  114. Required properties:
  115. - compatible: value must be either:
  116. * allwinner,sun4i-a10-tcon
  117. * allwinner,sun5i-a13-tcon
  118. * allwinner,sun6i-a31-tcon
  119. * allwinner,sun6i-a31s-tcon
  120. * allwinner,sun7i-a20-tcon
  121. * allwinner,sun8i-a33-tcon
  122. * allwinner,sun8i-a83t-tcon-lcd
  123. * allwinner,sun8i-a83t-tcon-tv
  124. * allwinner,sun8i-r40-tcon-tv
  125. * allwinner,sun8i-v3s-tcon
  126. * allwinner,sun9i-a80-tcon-lcd
  127. * allwinner,sun9i-a80-tcon-tv
  128. - reg: base address and size of memory-mapped region
  129. - interrupts: interrupt associated to this IP
  130. - clocks: phandles to the clocks feeding the TCON.
  131. - 'ahb': the interface clocks
  132. - 'tcon-ch0': The clock driving the TCON channel 0, if supported
  133. - resets: phandles to the reset controllers driving the encoder
  134. - "lcd": the reset line for the TCON
  135. - "edp": the reset line for the eDP block (A80 only)
  136. - clock-names: the clock names mentioned above
  137. - reset-names: the reset names mentioned above
  138. - clock-output-names: Name of the pixel clock created, if TCON supports
  139. channel 0.
  140. - ports: A ports node with endpoint definitions as defined in
  141. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  142. first port should be the input endpoint, the second one the output
  143. The output may have multiple endpoints. TCON can have 1 or 2 channels,
  144. usually with the first channel being used for the panels interfaces
  145. (RGB, LVDS, etc.), and the second being used for the outputs that
  146. require another controller (TV Encoder, HDMI, etc.). The endpoints
  147. will take an extra property, allwinner,tcon-channel, to specify the
  148. channel the endpoint is associated to. If that property is not
  149. present, the endpoint number will be used as the channel number.
  150. For TCONs with channel 0, there is one more clock required:
  151. - 'tcon-ch0': The clock driving the TCON channel 0
  152. For TCONs with channel 1, there is one more clock required:
  153. - 'tcon-ch1': The clock driving the TCON channel 1
  154. When TCON support LVDS (all TCONs except TV TCONs on A83T, R40 and those found
  155. in A13, H3, H5 and V3s SoCs), you need one more reset line:
  156. - 'lvds': The reset line driving the LVDS logic
  157. And on the A23, A31, A31s and A33, you need one more clock line:
  158. - 'lvds-alt': An alternative clock source, separate from the TCON channel 0
  159. clock, that can be used to drive the LVDS clock
  160. TCON TOP
  161. --------
  162. TCON TOPs main purpose is to configure whole display pipeline. It determines
  163. relationships between mixers and TCONs, selects source TCON for HDMI, muxes
  164. LCD and TV encoder GPIO output, selects TV encoder clock source and contains
  165. additional TV TCON and DSI gates.
  166. It allows display pipeline to be configured in very different ways:
  167. / LCD0/LVDS0
  168. / [0] TCON-LCD0
  169. | \ MIPI DSI
  170. mixer0 |
  171. \ / [1] TCON-LCD1 - LCD1/LVDS1
  172. TCON-TOP
  173. / \ [2] TCON-TV0 [0] - TVE0/RGB
  174. mixer1 | \
  175. | TCON-TOP - HDMI
  176. | /
  177. \ [3] TCON-TV1 [1] - TVE1/RGB
  178. Note that both TCON TOP references same physical unit. Both mixers can be
  179. connected to any TCON.
  180. Required properties:
  181. - compatible: value must be one of:
  182. * allwinner,sun8i-r40-tcon-top
  183. - reg: base address and size of the memory-mapped region.
  184. - clocks: phandle to the clocks feeding the TCON TOP
  185. * bus: TCON TOP interface clock
  186. * tcon-tv0: TCON TV0 clock
  187. * tve0: TVE0 clock
  188. * tcon-tv1: TCON TV1 clock
  189. * tve1: TVE0 clock
  190. * dsi: MIPI DSI clock
  191. - clock-names: clock name mentioned above
  192. - resets: phandle to the reset line driving the TCON TOP
  193. - #clock-cells : must contain 1
  194. - clock-output-names: Names of clocks created for TCON TV0 channel clock,
  195. TCON TV1 channel clock and DSI channel clock, in that order.
  196. - ports: A ports node with endpoint definitions as defined in
  197. Documentation/devicetree/bindings/media/video-interfaces.txt. 6 ports should
  198. be defined:
  199. * port 0 is input for mixer0 mux
  200. * port 1 is output for mixer0 mux
  201. * port 2 is input for mixer1 mux
  202. * port 3 is output for mixer1 mux
  203. * port 4 is input for HDMI mux
  204. * port 5 is output for HDMI mux
  205. All output endpoints for mixer muxes and input endpoints for HDMI mux should
  206. have reg property with the id of the target TCON, as shown in above graph
  207. (0-3 for mixer muxes and 0-1 for HDMI mux). All ports should have only one
  208. endpoint connected to remote endpoint.
  209. DRC
  210. ---
  211. The DRC (Dynamic Range Controller), found in the latest Allwinner SoCs
  212. (A31, A23, A33, A80), allows to dynamically adjust pixel
  213. brightness/contrast based on histogram measurements for LCD content
  214. adaptive backlight control.
  215. Required properties:
  216. - compatible: value must be one of:
  217. * allwinner,sun6i-a31-drc
  218. * allwinner,sun6i-a31s-drc
  219. * allwinner,sun8i-a33-drc
  220. * allwinner,sun9i-a80-drc
  221. - reg: base address and size of the memory-mapped region.
  222. - interrupts: interrupt associated to this IP
  223. - clocks: phandles to the clocks feeding the DRC
  224. * ahb: the DRC interface clock
  225. * mod: the DRC module clock
  226. * ram: the DRC DRAM clock
  227. - clock-names: the clock names mentioned above
  228. - resets: phandles to the reset line driving the DRC
  229. - ports: A ports node with endpoint definitions as defined in
  230. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  231. first port should be the input endpoints, the second one the outputs
  232. Display Engine Backend
  233. ----------------------
  234. The display engine backend exposes layers and sprites to the
  235. system.
  236. Required properties:
  237. - compatible: value must be one of:
  238. * allwinner,sun4i-a10-display-backend
  239. * allwinner,sun5i-a13-display-backend
  240. * allwinner,sun6i-a31-display-backend
  241. * allwinner,sun7i-a20-display-backend
  242. * allwinner,sun8i-a33-display-backend
  243. * allwinner,sun9i-a80-display-backend
  244. - reg: base address and size of the memory-mapped region.
  245. - interrupts: interrupt associated to this IP
  246. - clocks: phandles to the clocks feeding the frontend and backend
  247. * ahb: the backend interface clock
  248. * mod: the backend module clock
  249. * ram: the backend DRAM clock
  250. - clock-names: the clock names mentioned above
  251. - resets: phandles to the reset controllers driving the backend
  252. - ports: A ports node with endpoint definitions as defined in
  253. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  254. first port should be the input endpoints, the second one the output
  255. On the A33, some additional properties are required:
  256. - reg needs to have an additional region corresponding to the SAT
  257. - reg-names need to be set, with "be" and "sat"
  258. - clocks and clock-names need to have a phandle to the SAT bus
  259. clocks, whose name will be "sat"
  260. - resets and reset-names need to have a phandle to the SAT bus
  261. resets, whose name will be "sat"
  262. DEU
  263. ---
  264. The DEU (Detail Enhancement Unit), found in the Allwinner A80 SoC,
  265. can sharpen the display content in both luma and chroma channels.
  266. Required properties:
  267. - compatible: value must be one of:
  268. * allwinner,sun9i-a80-deu
  269. - reg: base address and size of the memory-mapped region.
  270. - interrupts: interrupt associated to this IP
  271. - clocks: phandles to the clocks feeding the DEU
  272. * ahb: the DEU interface clock
  273. * mod: the DEU module clock
  274. * ram: the DEU DRAM clock
  275. - clock-names: the clock names mentioned above
  276. - resets: phandles to the reset line driving the DEU
  277. - ports: A ports node with endpoint definitions as defined in
  278. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  279. first port should be the input endpoints, the second one the outputs
  280. Display Engine Frontend
  281. -----------------------
  282. The display engine frontend does formats conversion, scaling,
  283. deinterlacing and color space conversion.
  284. Required properties:
  285. - compatible: value must be one of:
  286. * allwinner,sun4i-a10-display-frontend
  287. * allwinner,sun5i-a13-display-frontend
  288. * allwinner,sun6i-a31-display-frontend
  289. * allwinner,sun7i-a20-display-frontend
  290. * allwinner,sun8i-a33-display-frontend
  291. * allwinner,sun9i-a80-display-frontend
  292. - reg: base address and size of the memory-mapped region.
  293. - interrupts: interrupt associated to this IP
  294. - clocks: phandles to the clocks feeding the frontend and backend
  295. * ahb: the backend interface clock
  296. * mod: the backend module clock
  297. * ram: the backend DRAM clock
  298. - clock-names: the clock names mentioned above
  299. - resets: phandles to the reset controllers driving the backend
  300. - ports: A ports node with endpoint definitions as defined in
  301. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  302. first port should be the input endpoints, the second one the outputs
  303. Display Engine 2.0 Mixer
  304. ------------------------
  305. The DE2 mixer have many functionalities, currently only layer blending is
  306. supported.
  307. Required properties:
  308. - compatible: value must be one of:
  309. * allwinner,sun8i-a83t-de2-mixer-0
  310. * allwinner,sun8i-a83t-de2-mixer-1
  311. * allwinner,sun8i-h3-de2-mixer-0
  312. * allwinner,sun8i-v3s-de2-mixer
  313. - reg: base address and size of the memory-mapped region.
  314. - clocks: phandles to the clocks feeding the mixer
  315. * bus: the mixer interface clock
  316. * mod: the mixer module clock
  317. - clock-names: the clock names mentioned above
  318. - resets: phandles to the reset controllers driving the mixer
  319. - ports: A ports node with endpoint definitions as defined in
  320. Documentation/devicetree/bindings/media/video-interfaces.txt. The
  321. first port should be the input endpoints, the second one the output
  322. Display Engine Pipeline
  323. -----------------------
  324. The display engine pipeline (and its entry point, since it can be
  325. either directly the backend or the frontend) is represented as an
  326. extra node.
  327. Required properties:
  328. - compatible: value must be one of:
  329. * allwinner,sun4i-a10-display-engine
  330. * allwinner,sun5i-a10s-display-engine
  331. * allwinner,sun5i-a13-display-engine
  332. * allwinner,sun6i-a31-display-engine
  333. * allwinner,sun6i-a31s-display-engine
  334. * allwinner,sun7i-a20-display-engine
  335. * allwinner,sun8i-a33-display-engine
  336. * allwinner,sun8i-a83t-display-engine
  337. * allwinner,sun8i-h3-display-engine
  338. * allwinner,sun8i-r40-display-engine
  339. * allwinner,sun8i-v3s-display-engine
  340. * allwinner,sun9i-a80-display-engine
  341. - allwinner,pipelines: list of phandle to the display engine
  342. frontends (DE 1.0) or mixers (DE 2.0) available.
  343. Example:
  344. panel: panel {
  345. compatible = "olimex,lcd-olinuxino-43-ts";
  346. #address-cells = <1>;
  347. #size-cells = <0>;
  348. port {
  349. #address-cells = <1>;
  350. #size-cells = <0>;
  351. panel_input: endpoint {
  352. remote-endpoint = <&tcon0_out_panel>;
  353. };
  354. };
  355. };
  356. connector {
  357. compatible = "hdmi-connector";
  358. type = "a";
  359. port {
  360. hdmi_con_in: endpoint {
  361. remote-endpoint = <&hdmi_out_con>;
  362. };
  363. };
  364. };
  365. hdmi: hdmi@1c16000 {
  366. compatible = "allwinner,sun5i-a10s-hdmi";
  367. reg = <0x01c16000 0x1000>;
  368. interrupts = <58>;
  369. clocks = <&ccu CLK_AHB_HDMI>, <&ccu CLK_HDMI>,
  370. <&ccu CLK_PLL_VIDEO0_2X>,
  371. <&ccu CLK_PLL_VIDEO1_2X>;
  372. clock-names = "ahb", "mod", "pll-0", "pll-1";
  373. dmas = <&dma SUN4I_DMA_NORMAL 16>,
  374. <&dma SUN4I_DMA_NORMAL 16>,
  375. <&dma SUN4I_DMA_DEDICATED 24>;
  376. dma-names = "ddc-tx", "ddc-rx", "audio-tx";
  377. ports {
  378. #address-cells = <1>;
  379. #size-cells = <0>;
  380. port@0 {
  381. #address-cells = <1>;
  382. #size-cells = <0>;
  383. reg = <0>;
  384. hdmi_in_tcon0: endpoint {
  385. remote-endpoint = <&tcon0_out_hdmi>;
  386. };
  387. };
  388. port@1 {
  389. #address-cells = <1>;
  390. #size-cells = <0>;
  391. reg = <1>;
  392. hdmi_out_con: endpoint {
  393. remote-endpoint = <&hdmi_con_in>;
  394. };
  395. };
  396. };
  397. };
  398. tve0: tv-encoder@1c0a000 {
  399. compatible = "allwinner,sun4i-a10-tv-encoder";
  400. reg = <0x01c0a000 0x1000>;
  401. clocks = <&ahb_gates 34>;
  402. resets = <&tcon_ch0_clk 0>;
  403. port {
  404. #address-cells = <1>;
  405. #size-cells = <0>;
  406. tve0_in_tcon0: endpoint@0 {
  407. reg = <0>;
  408. remote-endpoint = <&tcon0_out_tve0>;
  409. };
  410. };
  411. };
  412. tcon0: lcd-controller@1c0c000 {
  413. compatible = "allwinner,sun5i-a13-tcon";
  414. reg = <0x01c0c000 0x1000>;
  415. interrupts = <44>;
  416. resets = <&tcon_ch0_clk 1>;
  417. reset-names = "lcd";
  418. clocks = <&ahb_gates 36>,
  419. <&tcon_ch0_clk>,
  420. <&tcon_ch1_clk>;
  421. clock-names = "ahb",
  422. "tcon-ch0",
  423. "tcon-ch1";
  424. clock-output-names = "tcon-pixel-clock";
  425. ports {
  426. #address-cells = <1>;
  427. #size-cells = <0>;
  428. tcon0_in: port@0 {
  429. #address-cells = <1>;
  430. #size-cells = <0>;
  431. reg = <0>;
  432. tcon0_in_be0: endpoint@0 {
  433. reg = <0>;
  434. remote-endpoint = <&be0_out_tcon0>;
  435. };
  436. };
  437. tcon0_out: port@1 {
  438. #address-cells = <1>;
  439. #size-cells = <0>;
  440. reg = <1>;
  441. tcon0_out_panel: endpoint@0 {
  442. reg = <0>;
  443. remote-endpoint = <&panel_input>;
  444. };
  445. tcon0_out_tve0: endpoint@1 {
  446. reg = <1>;
  447. remote-endpoint = <&tve0_in_tcon0>;
  448. };
  449. };
  450. };
  451. };
  452. fe0: display-frontend@1e00000 {
  453. compatible = "allwinner,sun5i-a13-display-frontend";
  454. reg = <0x01e00000 0x20000>;
  455. interrupts = <47>;
  456. clocks = <&ahb_gates 46>, <&de_fe_clk>,
  457. <&dram_gates 25>;
  458. clock-names = "ahb", "mod",
  459. "ram";
  460. resets = <&de_fe_clk>;
  461. ports {
  462. #address-cells = <1>;
  463. #size-cells = <0>;
  464. fe0_out: port@1 {
  465. #address-cells = <1>;
  466. #size-cells = <0>;
  467. reg = <1>;
  468. fe0_out_be0: endpoint {
  469. remote-endpoint = <&be0_in_fe0>;
  470. };
  471. };
  472. };
  473. };
  474. be0: display-backend@1e60000 {
  475. compatible = "allwinner,sun5i-a13-display-backend";
  476. reg = <0x01e60000 0x10000>;
  477. interrupts = <47>;
  478. clocks = <&ahb_gates 44>, <&de_be_clk>,
  479. <&dram_gates 26>;
  480. clock-names = "ahb", "mod",
  481. "ram";
  482. resets = <&de_be_clk>;
  483. ports {
  484. #address-cells = <1>;
  485. #size-cells = <0>;
  486. be0_in: port@0 {
  487. #address-cells = <1>;
  488. #size-cells = <0>;
  489. reg = <0>;
  490. be0_in_fe0: endpoint@0 {
  491. reg = <0>;
  492. remote-endpoint = <&fe0_out_be0>;
  493. };
  494. };
  495. be0_out: port@1 {
  496. #address-cells = <1>;
  497. #size-cells = <0>;
  498. reg = <1>;
  499. be0_out_tcon0: endpoint@0 {
  500. reg = <0>;
  501. remote-endpoint = <&tcon0_in_be0>;
  502. };
  503. };
  504. };
  505. };
  506. display-engine {
  507. compatible = "allwinner,sun5i-a13-display-engine";
  508. allwinner,pipelines = <&fe0>;
  509. };