This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Device tree HDMI configuration problem

Part Number: AM5728
Other Parts Discussed in Thread: TPD12S015, , DRA742

Tool/software: Linux

 I have an custom AM5728 board that works under the v3.00 PSDK but the HDMI system failing when I try to update the system to use the 04.01 PSDK. The board is based on a Compulab AM5728 SOM on top of my own custom carrier board and does NOT have a TPD12S015 HDMI level shifter as the AM5728-EVM/Beagle-X15 systems do. The board only uses HDMI. As the format of the TI dts/dtsi system for the am57xx-evm has expanded since the v3.00 release I am atempting to update my dts to the new linux kerenel system using the evm as a starting point. Where I'm running into problems is that my HDMI is not being configured correctly. and I'm getting many "connector-hdmi connector: failed to find video source" lines emitted into the console log on boot. 
My original Version 3.0 Device tree include map looks like the following:
am57xx-aii-compulab.dts
dt-bindings/input/input.h
am57xx-cl-som-am57x.dtsi*
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "dra74x.dtsi"
#include "dra7.dtsi"
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/pinctrl/dra.h>
#include "skeleton.dtsi"
#include <dt-bindings/clk/ti-dra7-atl.h>
*am57xx-cl-som-am57x.dtsi doesn't have definitions related to HDMI/DRM
and the related code in am57xx-aii-compulab.dts that configures the hdmi looks like the following:
/ {
       model = "Assurance 5728 Weld Controller";
       compatible = "aii,assurance5728", "compulab,cl-som-am57x", "ti,am5728", "ti,dra742", "ti,dra74", "ti,dra7";
       aliases {
               display0 = &hdmi;
       };
hdmi_conn: connector@0 {
compatible = "hdmi-connector";
label = "hdmi";
type = "a";
};
};
&dra7_pmx_core {
       hdmi_pins: pinmux_hdmi_pins {
               pinctrl-single,pins = <
                       DRA7XX_CORE_IOPAD(0x3808, PIN_INPUT | MUX_MODE1)        /* i2c2_sda.hdmi1_ddc_scl */
                       DRA7XX_CORE_IOPAD(0x380c, PIN_INPUT | MUX_MODE1)        /* i2c2_scl.hdmi1_ddc_sda */
               >;
       };
       hdmi_conn_pins: pinmux_hdmi_conn_pins {
               pinctrl-single,pins = <
                       DRA7XX_CORE_IOPAD(0x37b8, PIN_INPUT | MUX_MODE14)       /* spi1_cs2.gpio7_12 */
               >;
       };
};
&hdmi {
       status = "ok";
       vdda-supply = <&ldo4_reg>;
       pinctrl-names = "default";
       pinctrl-0 = <&hdmi_pins>;
       port {
               hdmi_out: endpoint {
                       remote-endpoint = <&hdmi_connector_in>;
                       lanes = <1 0 3 2 5 4 7 6>;
               };
       };
};
&hdmi_conn {
       pinctrl-names = "default";
       pinctrl-0 = <&hdmi_conn_pins>;
       hpd-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>;
       port {
               hdmi_connector_in: endpoint {
                       remote-endpoint = <&hdmi_out>;
               };
       };
};
  Now on the AM57xx-evm, the HDMI system is apparently coupled through a tpd12s015 level converter and so all the device tree bits configure that in place of the more generic "hdmi-connector" that is used om my machine. The tpd12s015 is pretty much a pass-through device/level shifter but it needs 2 extra enables (CT_CP_HPD and LS_OE) which as not present in my case. 
I looked at just faking the tpd12s015 device and aiming the two "extra" GPIO at unused pins but don't really want to dedicate 2 pins if i can help it. I looked somewhat briefly at the lower level dts files (dra74 and dra7) and didn't see anything that changed down there between v3.00 and v4.01.
  Obviously I'm not configuring something correctly to account for changes since v3.00 - so some questions:
1. I'm looking at the drivers and it's unclear how the video source gets routed from the dss to the the HDMI. Can someone provide a quick explanation of how this is supposed to be "wired up" in the device tree.
i.e. explain the relationships between dss, encoders, connectors or point me to the documentation.
2. Given that the TI device trees all seem to use the tpd12s015 driver(s) (there are two!)- is it possible that there is now a bug in the more generic "hdmi-connector" driver that has gone unnoticed? 
    
3. is there any debugging I can turn on to help track down what could be going wrong with this config. 
   
  • The software team have been notified. They will respond here.
  • Hi,

    We tried quick hack patch removing the tpd12s015  driver from the chain of AM5 EVM and it worked fine.  The patch just drops tpd12s015 from the dts, and the few GPIOs that were handled by tpd12s015, were changed to be handled by gpio-hog so that they are always enabled. So the SW thinks the SoC is directly connected to the HDMI connector now.

    Attached tried patch on X15 and AM5 EVM. The patch isn't on top of  4.1 Processor SDK but on  ti-linux-4.9.y branch  of   git repo.

    Below is the changes that were done -

    REMOVED

    ----------------

    &tpd12s015 {

                 gpios = <&gpio7 10 GPIO_ACTIVE_HIGH>,           /* gpio7_10, CT CP HPD */

                                <&gpio2 30 GPIO_ACTIVE_HIGH>,           /* gpio2_30, LS OE */

                                <&gpio7 12 GPIO_ACTIVE_HIGH>;           /* gpio7_12/sp1_cs2, HPD */

    };

    ADDED

    -------------

    &gpio7 {

                 p10 {

                                /* gpio7_10, CT CP HPD */

                                gpio-hog;

                                gpios = <10 GPIO_ACTIVE_HIGH>;

                                output-high;

                                line-name = "CT CP HPD";

                 };

    };

    &gpio2 {

                 p30 {

                                /* gpio2_30, LS OE */

                                gpio-hog;

                                gpios = <30 GPIO_ACTIVE_HIGH>;

                                output-high;

                                line-name = "LS OE";

                 };

    }

                 hdmi0: connector {

                                compatible = "hdmi-connector";

                                label = "hdmi";

                                type = "a";

                                hpd-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>;

                                port {

                                              hdmi_connector_in: endpoint {

                                                             remote-endpoint = <&hdmi_out>;

                                              };

                                };

    If your are seeing "could not find video source" errors, it means that the previous component in the chain has not been registered. I.e. in TI GP EVM board, if hdmi connector gives that error, it means that tpd12s015 has not been probed successfully. 

     

    But this error may also be seen due to deferred probing even in a normal boot. I.e. if hdmi connector driver happens to be probed first, it can't find tpd12s015 because it's not loaded yet. After some time, tpd12s015 is probed, and then hdmi connector will be retried, successfully.

  • manisha,

        Thank you for confirming the system/device tree would work without the TPD12S015 encoder defined -- A sanity check is always most useful! I ended up putting in a few more debugging statements in the various kernel drivers to see where things were failing and I now have the 4.9.41 kernel running on my board. In case others are using the Compulab AM572x boards the following is the configuration that worked for me - I have stripped out non-relevant bits so the config is easier to see - note in my case I'm just using HDMI. 

    Final configuration (kernel config)
    
    CONFIG_DRM_OMAP=y
    CONFIG_DRM_OMAP_WB=y
    CONFIG_OMAP2_DSS_INIT=y
    CONFIG_OMAP_DSS_BASE=y
    CONFIG_OMAP2_DSS=y
    CONFIG_OMAP2_DSS_DEBUG=y
    CONFIG_OMAP2_DSS_DEBUGFS=y
    # CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
    CONFIG_OMAP2_DSS_DPI=y
    # CONFIG_OMAP2_DSS_VENC is not set
    CONFIG_OMAP2_DSS_HDMI_COMMON=y
    CONFIG_OMAP4_DSS_HDMI=y
    CONFIG_OMAP5_DSS_HDMI=y
    # CONFIG_OMAP2_DSS_SDI is not set
    # CONFIG_OMAP2_DSS_DSI is not set
    CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
    CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
    CONFIG_TI_DSS6=y
    
    #
    # OMAPDRM External Display Device Drivers
    #
    # CONFIG_DRM_OMAP_ENCODER_OPA362 is not set
    # CONFIG_DRM_OMAP_ENCODER_TFP410 is not set
    # CONFIG_DRM_OMAP_ENCODER_TPD12S015 is not set
    # CONFIG_DRM_OMAP_ENCODER_TC358768 is not set
    # CONFIG_DRM_OMAP_DRA7_DIRECT_ENCODER is not set
    # CONFIG_DRM_OMAP_DRA7EVM_ENCODER_TPD12S015 is not set
    # CONFIG_DRM_OMAP_ENCODER_SII9022 is not set
    # CONFIG_DRM_OMAP_CONNECTOR_DVI is not set
    CONFIG_DRM_OMAP_CONNECTOR_HDMI=y
    # CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV is not set
    # CONFIG_DRM_OMAP_PANEL_DPI is not set
    # CONFIG_DRM_OMAP_PANEL_DSI_CM is not set
    # CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM is not set
    # CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 is not set
    # CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 is not set
    # CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 is not set
    # CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 is not set
    # CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 is not set
    CONFIG_DRM_TILCDC=y
    CONFIG_DRM_TILCDC_SLAVE_COMPAT=y
    # CONFIG_DRM_QXL is not set
    # CONFIG_DRM_BOCHS is not set
    # CONFIG_DRM_VIRTIO_GPU is not set
    # CONFIG_DRM_FSL_DCU is not set
    CONFIG_DRM_BRIDGE=y
    
    
    
    Relevant Device Tree bits:
    * I opted to not include the regulator definitions (ldoln_reg, ldo4_reg) to keep this doc concise / { aliases { display0 = &hdmi; }; hdmi_conn: connector { compatible = "hdmi-connector"; label = "hdmi"; type = "a"; hpd-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>; port { hdmi_connector_in: endpoint { remote-endpoint = <&hdmi_out>; }; }; }; }; &dra7_pmx_core { /* HDMI related pin configuration */ hdmi_pins: pinmux_hdmi_pins { pinctrl-single,pins = < DRA7XX_CORE_IOPAD(0x3808, PIN_INPUT | MUX_MODE1) /* i2c2_sda.hdmi1_ddc_scl */ DRA7XX_CORE_IOPAD(0x380c, PIN_INPUT | MUX_MODE1) /* i2c2_scl.hdmi1_ddc_sda */ >; }; hdmi_conn_pins: pinmux_hdmi_conn_pins { pinctrl-single,pins = < DRA7XX_CORE_IOPAD(0x37b8, PIN_INPUT | MUX_MODE14) /* spi1_cs2.gpio7_12 */ >; }; dss_dpi_pins: dss_pins { pinctrl-single,pins = < >; }; }; &dss { status = "ok"; pinctrl-names = "default"; vdda_video-supply = <&ldoln_reg>; }; &hdmi { status = "ok"; vdda-supply = <&ldo4_reg>; pinctrl-names = "default"; pinctrl-0 = <&hdmi_pins>; port { hdmi_out: endpoint { remote-endpoint = <&hdmi_connector_in>; lanes = <1 0 3 2 5 4 7 6>; }; }; }; &hdmi_conn { pinctrl-names = "default"; pinctrl-0 = <&hdmi_conn_pins>; };