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: disabling DSS per device tree

Part Number: AM5728
Other Parts Discussed in Thread: TPD12S015

Tool/software: Linux

Hi Champs,

we want to disable all units that we do not use per device tree. This works fine for RTC, PCI, ABB and SATA, but getting rid of DSS does not work. We tried it like this:

&dss {

            clocks = <&dummy_ck>;

};

or:

&dss {

            status = “disabled”;

};

but without success.

What are we missing here?

Thanks and kind regards,

one and zero

  • Hello,

    Which files exactly you are modifying? DTS files that should be modified are:

    linux-kernel/arch/arm/boot/dts/dra7.dtsi
    linux-kernel/arch/arm/boot/dts/dra74x.dtsi

    You can also remove DSS support from the menuconfig, see below wiki page:

    processors.wiki.ti.com/.../Linux_Core_DSS_User's_Guide

    Regards,
    Pavel
  • Hi Pavel,

    using menuconfig / omapdrm is not an option.

    We modified the dra7 device tree files already as mentioned in my earlier post.

    Could you please provide a more detailed guidance since the standard procedure obviously does not work. Perhaps you can reproduce the issue on your end.

    Kind regards,

    one and zero 

  • Hi one and zero,

    Can you attach the modified versions of the DRA7 device tree files (dra7.dtsi and dra74x.dtsi), I want to have a look.

    Could you please also provide more details what happen after you modify the DRA7 device tree files? Do you still have Matrix GUI on the LCD display?

    Regards,
    Pavel
  • one and zero said:
    using menuconfig / omapdrm is not an option.

    Why? Could you please provide more details regarding what is stopping you to remove the DSS support from the linux kernel through menuconfig / omapdrm?


    The DSS support is enabled by default from the tisdk_am57xx-evm_defconfig file. You can disable it through menuconfig:

    Device Drivers -> Graphics Support

    <   > OMAP DRM

    <   >  DRM Support for TI LCDC Display Controller

    Regards,
    Pavel

  • Hi Pavel,

    this is a customer kernel build for a product without a display. So we don't want the graphic support in the kernel. We don't want to manually remove the code from the c sources.

    So the method of choice is to configure via modifying the device tree. But it doesn't work when adding

    &dss {

                clocks = <&dummy_ck>;

    };

    or:

    &dss {

                status = “disabled”;

    };

    to linux-kernel/arch/arm/boot/dts/dra7.dtsi
    linux-kernel/arch/arm/boot/dts/dra74x.dtsi

    which we think it should.

    Kind regards,

    one and zero

  • One and zero,

    one and zero said:
    this is a customer kernel build for a product without a display. So we don't want the graphic support in the kernel. We don't want to manually remove the code from the c sources.

    So you should use defconfig file which is specific for your custom board, you can not use tisdk_am57xx-evm_defconfig which is for AM572x EVM. In your defconfig file you should remove omapdrm support, thus there will be no need to change anything through menuconfig.

    one and zero said:
    So the method of choice is to configure via modifying the device tree. But it doesn't work

    By default we have there:

    dra7.dtsi

    dss: dss@58000000 {
                compatible = "ti,dra7-dss";
                /* 'reg' defined in dra72x.dtsi and dra74x.dtsi */
                /* 'clocks' defined in dra72x.dtsi and dra74x.dtsi */
                status = "disabled";
                ti,hwmods = "dss_core";
                /* CTRL_CORE_DSS_PLL_CONTROL */
                syscon-pll-ctrl = <&scm_conf 0x538>;
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;

                dispc@58001000 {
                    compatible = "ti,dra7-dispc";
                    reg = <0x58001000 0x1000>;
                    interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
                    ti,hwmods = "dss_dispc";
                    clocks = <&dss_dss_clk>;
                    clock-names = "fck";
                    /* CTRL_CORE_SMA_SW_1 */
                    syscon-pol = <&scm_conf 0x534>;
                };

                hdmi: encoder@58060000 {
                    compatible = "ti,dra7-hdmi";
                    reg = <0x58040000 0x200>,
                          <0x58040200 0x80>,
                          <0x58040300 0x80>,
                          <0x58060000 0x19000>;
                    reg-names = "wp", "pll", "phy", "core";
                    interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
                    status = "disabled";
                    ti,hwmods = "dss_hdmi";
                    clocks = <&dss_48mhz_clk>, <&dss_hdmi_clk>;
                    clock-names = "fck", "sys_clk";
                    dmas = <&sdma_xbar 76>;
                    dma-names = "audio_tx";
                };
            };

    Remove syscon-pll-ctrl, dispc and hdmi.

    dra74x.dtsi

    &dss {
        reg = <0x58000000 0x80>,
              <0x58004054 0x4>,
              <0x58004300 0x20>,
              <0x58009054 0x4>,
              <0x58009300 0x20>;
        reg-names = "dss", "pll1_clkctrl", "pll1",
                "pll2_clkctrl", "pll2";

        clocks = <&dss_dss_clk>,
             <&dss_video1_clk>,
             <&dss_video2_clk>;
        clock-names = "fck", "video1_clk", "video2_clk";
    };

    Remove clocks and clock-names.

    Regards,
    Pavel

  • Hi Pavel,

    this is not a really what we want to do. You're suggestion still modifies two existing files from the original kernel, which we consider “patching” – which is not want we want to do.
    We want to overload settings from our own device tree only. Please advise how to do that.

    Kind regards,
    one and zero
  • one and zero said:
    You're suggestion still modifies two existing files from the original kernel

    If we consider zImage as the kernel, my suggestions do not modify zImage.

    For AM572x TI EVM we have MLO, u-boot-spl.bin, u-boot.img, zImage and am57xx-evm.dtb. When modifying dra74x.dtsi and dra7.dtsi files, will result in new am57xx-evm.dtb, but zImage is still the same.

    For removing DSS support I can think of 3 approaches:

    1. Modify linux kernel code directly and remove DSS support from the code. This will result in new zImage. This approach is not recommended.

    2. Modify defconfig file. This will result in new zImage.

    3. Modify device tree files. This will result in new device tree blob.

    one and zero said:
    We want to overload settings from our own device tree only. Please advise how to do that.

    Can you provide more details regarding your definition of "our own device tree only"? Which and what is your device tree?

    Regards,
    Pavel

  • Hi Pavel,

    I attached the current device tree file. Please be aware that this still contains a lot of experimental stuff and needs some cleanups, but it shows what we want to achieve.

    The interesting parts are all the sections with “status=disabled” at the bottom.

    We managed to disable most of the unused units, but everything that has to do with DSS does not show the desired effect.

    I suspect that the root cause is a defect in the code, which does not honor the “status=disabled” setting properly.

    Is it possible to provide a patch that fixes this in the Linux kernel? Or provide a proper workaround.

    Alternatively we also tried to fool the system by telling the subsystem that it is running on a fixed 0Hz clock, or on a power domain that is switched off, but that also did not help.

    Kind regards,

    one and zero

    8308.Custom.zip

  • one and zero said:

    I attached the current device tree file. Please be aware that this still contains a lot of experimental stuff and needs some cleanups, but it shows what we want to achieve.

    The interesting parts are all the sections with “status=disabled” at the bottom.

    In AM572x TI EVM, that main DTS file is am57xx-evm.dts, which includes am57xx-beagle-x15.dts, am57xx-beagle-x15-common.dtsi, dra74x.dtsi, dra7.dtsi. In dra7x.dtsi we describe DSS and make it disable (status = "disabled"). Then in am57xx-beagle-x15-common.dtsi, we enable it:

    &dss {
        status = "ok";

        vdda_video-supply = <&ldoln_reg>;
    };

    &hdmi {
        status = "ok";
        vdda-supply = <&ldo4_reg>;

        port {
            hdmi_out: endpoint {
                remote-endpoint = <&tpd12s015_in>;
            };
        };
    };

    While your main DTS file is Custom.dts, which includes dra74x.dtsi, dra7.dtsi. And you want to disable DSS from the main DTS file Custom.dts.

    I would suggest to type of updates for the Custom.dts file:

    1. Remove any reference to dss, hdmi, dispc, dss_dss_clk, dss_video1_clk, dss_video2_clk, dss_deshdcp_clk. As DSS is disabled by default in dra7.dtsi, you just need not to enable it in Custom.dts. Please try with this approach and let me know the result.

    2. Refer to am57xx-beagle-x15-common.dtsi, we have there:

    &dss {
        status = "ok";

        vdda_video-supply = <&ldoln_reg>;
    };

    &hdmi {
        status = "ok";
        vdda-supply = <&ldo4_reg>;

        port {
            hdmi_out: endpoint {
                remote-endpoint = <&tpd12s015_in>;
            };
        };
    };

    Add only these two entries in your Custom.dts file and change only status from "ok" to "disabled". Please try with this approach and let me know the result.

    one and zero said:
    I suspect that the root cause is a defect in the code, which does not honor the “status=disabled” setting properly.

    The status setting is checked in the below file and function:

    linux-kernel/drivers/of/base.c

    static bool __of_device_is_available(const struct device_node *device)
    {
        const char *status;
        int statlen;

        if (!device)
            return false;

        status = __of_get_property(device, "status", &statlen);
        if (status == NULL)
            return true;

        if (statlen > 0) {
            if (!strcmp(status, "okay") || !strcmp(status, "ok"))
                return true;
        }

        return false;
    }

     

    Can you check what this function return (true/enable or false/disable) when invoke for the DSS?

    This function is called in:

    linux-kernel/arch/arm/mach-omap2/display.c -> omapdss_init_of() -> of_device_is_available(node);

    linux-kernel/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c -> omapdss_boot_init() -> of_device_is_available(dss);

    linux-kernel/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c -> of_device_is_available(dss);

     

     

  • one and zero,

    I made one test on the AM572x TI EVM rev A2. And I can successfully remove DSS support from the am57xx-beagle-x15-common.dtsi file (which should correspond to your Custom. dts file).

    First when I use default am57xx-evm.dtb file, I have "Matrix App Launcher v2 p1" on the LCD screen and below messages during kernel boot up:

    OMAP DSS rev 6.1

    omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops)

    omapdss_dss 58000000.dss: bound 58040000.encoder (ops hdmi5_component_ops)

    omap-hdmi-audio omap-hdmi-audio.0.auto: snd-soc-dummy-dai <-> 58040000.encoder mapping ok

    [drm] Supports vblank timestamp caching Rev 2 (21.10.2013)

    [drm] No driver support for vblank timestamp query.

    [drm] Enabling DMM ywrap scrolling

    omapdrm omapdrm.0: fb0: omapdrm frame buffer device

    [drm] Initialized omapdrm 1.0.0 20110917 on minor 0

     

    And I have these registers values in user space:

    CM_DSS_CLKSTCTRL = 0x703

    CM_DSS_DSS_CLKCTRL = 0x1102

    CM_DSS_PWRSTST = 0x37

     

    When I modify only am57xx-beagle-x15-common.dtsi file(as below) I remove DSS support.

    &dss {
        status = "disabled"; //status = "ok";

        vdda_video-supply = <&ldoln_reg>;
    };

    &bb2d {
        status = "disabled"; //status = "okay";
    };

    &hdmi {
        status = "disabled"; //status = "ok";
        vdda-supply = <&ldo4_reg>;

        port {
            hdmi_out: endpoint {
                remote-endpoint = <&tpd12s015_in>;
            };
        };
    };

     

    I generate new am57xx-evm.dtb file (based on the modified am57xx-beagle-x15-common.dtsi file), thus I do not have the kernel messages related to DSS, HDMI and DRM (listed above) and I have nothing on the LCD display (no "Matrix App Launcher v2 p1").

    And I have these registers values in user space:

    CM_DSS_CLKSTCTRL = 0x3

    CM_DSS_DSS_CLKCTRL = 0x70000

    CM_DSS_PWRSTST = 0x0

     

    Regards,
    Pavel

  • I tried the below modification also. In am57xx-beagle-x15-common.dtsi, I just remove DSS node (nothing more):

    &oppdm_core {

    vdd-supply = <&smps6_reg>;

    };

    /*&dss {

    status = "ok";

    vdda_video-supply = <&ldoln_reg>;

    };*/

    &bb2d {

    status = "okay";

    };

    &hdmi {

    status = "ok";

    vdda-supply = <&ldo4_reg>;

    port {

    hdmi_out: endpoint {

    remote-endpoint = <&tpd12s015_in>;

    };

    };

    };

     

    With this approach, DSS is also disabled successfully on the AM572x TI EVM.

     

    Regards,
    Pavel