HDMI output on A04 - disabled?

Aha, I’m checking my devTerm recently again, and after reading https://www.kernel.org/doc/Documentation/devicetree/bindings/display/allwinner%2Csun8i-r40-tcon-top.yaml, I’m able to get HDMI+LCD working!

Just put this into a file (such as hdmi.dts):

/dts-v1/;
/plugin/;

/ {
    compatible = "clockwork,devterm-a04";

    fragment@0 {
        target = <&tcon_tv>;
        __overlay__ {
            status = "okay";
        };
    };

    fragment@1 {
        target = <&i2s1>;
        __overlay__ {
            status = "okay";
        };
    };

    fragment@2 {
        target = <&tcon_top>;
        __overlay__ {

            tcon_top_hdmi_in: port@4 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <4>;

                tcon_top_hdmi_in_tcon_tv: endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&tcon_tv_out_tcon_top>;
                };
            };

            tcon_top_hdmi_out: port@5 {
                reg = <5>;

                tcon_top_hdmi_out_hdmi: endpoint {
                    remote-endpoint = <&hdmi_in_tcon_top>;
                };
            };
        };
    };

    fragment@3 {
        target = <&tcon_tv_out_tcon_top>;
        __overlay__ {
            remote_endpoint = <&tcon_top_hdmi_in_tcon_tv>;
        };
    };

    fragment@4 {
        target = <&hdmi_in_tcon_top>;
        __overlay__ {
            remote_endpoint = <&tcon_top_hdmi_out_hdmi>;
        };
    };
};

Then run sudo armbian-add-overlay hdmi.dts, and reboot. Now it displays on both internal LCD and external HDMI!

The main hint is this graph in that doc:


                                  / LCD0/LVDS0
                   / [0] TCON-LCD0
                   |              \ MIPI DSI
   mixer0          |
          \        / [1] TCON-LCD1 - LCD1/LVDS1
           TCON-TOP
          /        \ [2] TCON-TV0 [0] - TVE0/RGB
   mixer1          |                  \
                   |                   TCON-TOP - HDMI
                   |                  /
                   \ [3] TCON-TV1 [1] - TVE1/RGB

Notice that the tcon-top goes to tcon-tv, then goes back to tcon-top, then goes to hdmi. This is reflected in the sample code below in the doc.

In contrast, the default devterm devtree points the tcon-tv directly to hdmi. That’s incorrect. Once the connection is fixed, it works!

Actually this is hinted by the aliases in the original device tree (for example, HDMI’s input endpoint is called hdmi_in_tcon_top, hinting that it should come from tcon-top, not tcon-tv; also, tcon-tv’s output endpoint is called tcon_tv_out_tcon_top, hinting that it should go to tcon-top). I’m not sure why it’s not connected correctly.

7 Likes