18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci# Copyright 2019 BayLibre, SAS
38c2ecf20Sopenharmony_ci%YAML 1.2
48c2ecf20Sopenharmony_ci---
58c2ecf20Sopenharmony_ci$id: "http://devicetree.org/schemas/display/amlogic,meson-vpu.yaml#"
68c2ecf20Sopenharmony_ci$schema: "http://devicetree.org/meta-schemas/core.yaml#"
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cititle: Amlogic Meson Display Controller
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_cimaintainers:
118c2ecf20Sopenharmony_ci  - Neil Armstrong <narmstrong@baylibre.com>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cidescription: |
148c2ecf20Sopenharmony_ci  The Amlogic Meson Display controller is composed of several components
158c2ecf20Sopenharmony_ci  that are going to be documented below
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci  DMC|---------------VPU (Video Processing Unit)----------------|------HHI------|
188c2ecf20Sopenharmony_ci     | vd1   _______     _____________    _________________     |               |
198c2ecf20Sopenharmony_ci  D  |-------|      |----|            |   |                |    |   HDMI PLL    |
208c2ecf20Sopenharmony_ci  D  | vd2   | VIU  |    | Video Post |   | Video Encoders |<---|-----VCLK      |
218c2ecf20Sopenharmony_ci  R  |-------|      |----| Processing |   |                |    |               |
228c2ecf20Sopenharmony_ci     | osd2  |      |    |            |---| Enci ----------|----|-----VDAC------|
238c2ecf20Sopenharmony_ci  R  |-------| CSC  |----| Scalers    |   | Encp ----------|----|----HDMI-TX----|
248c2ecf20Sopenharmony_ci  A  | osd1  |      |    | Blenders   |   | Encl ----------|----|---------------|
258c2ecf20Sopenharmony_ci  M  |-------|______|----|____________|   |________________|    |               |
268c2ecf20Sopenharmony_ci  ___|__________________________________________________________|_______________|
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci  VIU: Video Input Unit
308c2ecf20Sopenharmony_ci  ---------------------
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci  The Video Input Unit is in charge of the pixel scanout from the DDR memory.
338c2ecf20Sopenharmony_ci  It fetches the frames addresses, stride and parameters from the "Canvas" memory.
348c2ecf20Sopenharmony_ci  This part is also in charge of the CSC (Colorspace Conversion).
358c2ecf20Sopenharmony_ci  It can handle 2 OSD Planes and 2 Video Planes.
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci  VPP: Video Post Processing
388c2ecf20Sopenharmony_ci  --------------------------
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci  The Video Post Processing is in charge of the scaling and blending of the
418c2ecf20Sopenharmony_ci  various planes into a single pixel stream.
428c2ecf20Sopenharmony_ci  There is a special "pre-blending" used by the video planes with a dedicated
438c2ecf20Sopenharmony_ci  scaler and a "post-blending" to merge with the OSD Planes.
448c2ecf20Sopenharmony_ci  The OSD planes also have a dedicated scaler for one of the OSD.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci  VENC: Video Encoders
478c2ecf20Sopenharmony_ci  --------------------
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci  The VENC is composed of the multiple pixel encoders
508c2ecf20Sopenharmony_ci   - ENCI : Interlace Video encoder for CVBS and Interlace HDMI
518c2ecf20Sopenharmony_ci   - ENCP : Progressive Video Encoder for HDMI
528c2ecf20Sopenharmony_ci   - ENCL : LCD LVDS Encoder
538c2ecf20Sopenharmony_ci  The VENC Unit gets a Pixel Clocks (VCLK) from a dedicated HDMI PLL and clock
548c2ecf20Sopenharmony_ci  tree and provides the scanout clock to the VPP and VIU.
558c2ecf20Sopenharmony_ci  The ENCI is connected to a single VDAC for Composite Output.
568c2ecf20Sopenharmony_ci  The ENCI and ENCP are connected to an on-chip HDMI Transceiver.
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciproperties:
598c2ecf20Sopenharmony_ci  compatible:
608c2ecf20Sopenharmony_ci    oneOf:
618c2ecf20Sopenharmony_ci      - items:
628c2ecf20Sopenharmony_ci          - enum:
638c2ecf20Sopenharmony_ci              - amlogic,meson-gxbb-vpu # GXBB (S905)
648c2ecf20Sopenharmony_ci              - amlogic,meson-gxl-vpu # GXL (S905X, S905D)
658c2ecf20Sopenharmony_ci              - amlogic,meson-gxm-vpu # GXM (S912)
668c2ecf20Sopenharmony_ci          - const: amlogic,meson-gx-vpu
678c2ecf20Sopenharmony_ci      - enum:
688c2ecf20Sopenharmony_ci          - amlogic,meson-g12a-vpu # G12A (S905X2, S905Y2, S905D2)
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci  reg:
718c2ecf20Sopenharmony_ci    maxItems: 2
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci  reg-names:
748c2ecf20Sopenharmony_ci    items:
758c2ecf20Sopenharmony_ci      - const: vpu
768c2ecf20Sopenharmony_ci      - const: hhi
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci  interrupts:
798c2ecf20Sopenharmony_ci    maxItems: 1
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci  amlogic,canvas:
828c2ecf20Sopenharmony_ci    description: should point to a canvas provider node
838c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci  power-domains:
868c2ecf20Sopenharmony_ci    maxItems: 1
878c2ecf20Sopenharmony_ci    description: phandle to the associated power domain
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci  port@0:
908c2ecf20Sopenharmony_ci    type: object
918c2ecf20Sopenharmony_ci    description:
928c2ecf20Sopenharmony_ci      A port node pointing to the CVBS VDAC port node.
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci  port@1:
958c2ecf20Sopenharmony_ci    type: object
968c2ecf20Sopenharmony_ci    description:
978c2ecf20Sopenharmony_ci      A port node pointing to the HDMI-TX port node.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci  "#address-cells":
1008c2ecf20Sopenharmony_ci    const: 1
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci  "#size-cells":
1038c2ecf20Sopenharmony_ci    const: 0
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_cirequired:
1068c2ecf20Sopenharmony_ci  - compatible
1078c2ecf20Sopenharmony_ci  - reg
1088c2ecf20Sopenharmony_ci  - interrupts
1098c2ecf20Sopenharmony_ci  - port@0
1108c2ecf20Sopenharmony_ci  - port@1
1118c2ecf20Sopenharmony_ci  - "#address-cells"
1128c2ecf20Sopenharmony_ci  - "#size-cells"
1138c2ecf20Sopenharmony_ci  - amlogic,canvas
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ciadditionalProperties: false
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ciexamples:
1188c2ecf20Sopenharmony_ci  - |
1198c2ecf20Sopenharmony_ci    vpu: vpu@d0100000 {
1208c2ecf20Sopenharmony_ci        compatible = "amlogic,meson-gxbb-vpu", "amlogic,meson-gx-vpu";
1218c2ecf20Sopenharmony_ci        reg = <0xd0100000 0x100000>, <0xc883c000 0x1000>;
1228c2ecf20Sopenharmony_ci        reg-names = "vpu", "hhi";
1238c2ecf20Sopenharmony_ci        interrupts = <3>;
1248c2ecf20Sopenharmony_ci        #address-cells = <1>;
1258c2ecf20Sopenharmony_ci        #size-cells = <0>;
1268c2ecf20Sopenharmony_ci        amlogic,canvas = <&canvas>;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci        /* CVBS VDAC output port */
1298c2ecf20Sopenharmony_ci        port@0 {
1308c2ecf20Sopenharmony_ci            reg = <0>;
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci            cvbs_vdac_out: endpoint {
1338c2ecf20Sopenharmony_ci                remote-endpoint = <&tv_connector_in>;
1348c2ecf20Sopenharmony_ci            };
1358c2ecf20Sopenharmony_ci        };
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci        /* HDMI TX output port */
1388c2ecf20Sopenharmony_ci        port@1 {
1398c2ecf20Sopenharmony_ci            reg = <1>;
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci            hdmi_tx_out: endpoint {
1428c2ecf20Sopenharmony_ci                remote-endpoint = <&hdmi_tx_in>;
1438c2ecf20Sopenharmony_ci            };
1448c2ecf20Sopenharmony_ci        };
1458c2ecf20Sopenharmony_ci    };
146