Modify kernel for VGA-OUT only

Hi everyone,

I am trying to work out exactly how to obtain video output only from the VGA port, by modifying the kernel accordingly.

I would like the HDMI out to be completely disabled.

First of all, looking at the board schematics I seem to understand that the VGA port is routed to the RK3288 LVDS domain (LCDC0_Dx) while the HDMI port is routed to the RK3288 HDMI pinouts - can someone confirm this?

Then, looking at the relevant kernel device tree section (firefly-rk3288.dts):

&i2c4 {
    status = "okay";
    rk1000_control@40 {
        compatible = "rockchip,rk1000_control";
        reg = <0x40>;
        gpio-reset = <&gpio7 GPIO_C5 GPIO_ACTIVE_LOW>;
        clocks = <&clk_i2s>, <&clk_i2s_out>;
        clock-names = "i2s_clk","i2s_mclk";
        //pinctrl-names = "default";
        //pinctrl-0 = <&i2s_mclk>;
    };
    rk1000_tve@42 {
        compatible = "rockchip,rk1000_tve";
        reg = <0x42>;
//      gpio-switch = <&gpio3 GPIO_D4 GPIO_ACTIVE_LOW>;
        rockchip,source = <0>; //0: LCDC0; 1: LCDC1
        rockchip,prop = <PRMRY>;//<EXTEND>
    };
    rk1000_codec: rk1000_codec@60 {
        compatible = "rockchip,rk1000_codec";
        reg = <0x60>;
        spk_ctl_io = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
        boot_depop = <1>;
        pa_enable_time = <5000>;
    };
    vga_ddc@50 {
        compatible = "firefly,vga_ddc";
        reg = <0x50>;
        gpio-pwn = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
        rockchip,source = <0>; //0: LCDC0; 1: LCDC1
        rockchip,prop = <PRMRY>;//<EXTEND>
        status = "okay";
    };
};

&i2c5 {
    status = "disabled";
};

/*$_rbox_$_modify_$_begin_huangzhibao for rk1000*/
//&i2s{
//    pinctrl-names = "default", "sleep";
//      pinctrl-0 = <&i2s_sclk &i2s_lrckrx &i2s_lrcktx &i2s_sdi &i2s_sdo0 &i2s_sdo1 &i2s_sdo2 &i2s_sdo3>;
//      pinctrl-1 = <&i2s_gpio>;
//};
/*$_rbox_$_modify_$_end*/

&fb {
    rockchip,disp-mode = <DUAL>;
};

&rk_screen {
     display-timings = <&disp_timings>;
};

/*lcdc0 as PRMRY(HDMI),lcdc1 as EXTEND(RK1000)*/
&lcdc0 {
    status = "okay";
    rockchip,prop = <PRMRY>;
};

&lcdc1 {
    status = "disabled";
    rockchip,prop = <EXTEND>;
};

&hdmi {
    status = "okay";
    rockchips,hdmi_audio_source = <0>;
    hdmi_cec = <0>;
};

Of course this DT section overrides (or rather, is merged with) the default rk3288.dtsi tree, standard for all RK3288 SoCs:

    hdmi: hdmi@ff980000 {
        compatible = "rockchip,rk3288-hdmi";
        reg = <0xff980000 0x20000>;
        interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
        pinctrl-names = "default", "gpio";
        //pinctrl-0 = <&i2c5_sda &i2c5_scl>;
        pinctrl-0 = <&i2c5_sda &i2c5_scl &hdmi_cec>;
        pinctrl-1 = <&i2c5_gpio>;
        //clocks = <&clk_gates16 9>, <&clk_gates5 12>;
        //clock-names = "pclk_hdmi", "hdcp_clk_hdmi";
        clocks = <&clk_gates16 9>, <&clk_gates5 12>, <&clk_gates5 11>;
        clock-names = "pclk_hdmi", "hdcp_clk_hdmi", "cec_clk_hdmi";
        status = "disabled";
    };

    lcdc0: lcdc@ff930000 {
        compatible = "rockchip,rk3288-lcdc";
        rockchip,prop = <EXTEND>;
        rockchip,pwr18 = <0>;
        rockchip,iommu-enabled = <1>;
        reg = <0xff930000 0x10000>;
        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
        //pinctrl-names = "default", "gpio";
        //pinctrl-0 = <&lcdc0_lcdc>;
        //pinctrl-1 = <&lcdc0_gpio>;
        status = "disabled";
        clocks = <&clk_gates15 5>, <&dclk_lcdc0>, <&clk_gates15 6>, <&pd_vop0>;
        clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "pd_lcdc";
    };

    lcdc1: lcdc@ff940000 {
        compatible = "rockchip,rk3288-lcdc";
        rockchip,prop = <PRMRY>;
        rochchip,pwr18 = <0>;
        rockchip,iommu-enabled = <1>;
        reg = <0xff940000 0x10000>;
        interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
        pinctrl-names = "default", "gpio";
        pinctrl-0 = <&lcdc0_lcdc>;
        pinctrl-1 = <&lcdc0_gpio>;
        status = "disabled";
        clocks = <&clk_gates15 7>, <&dclk_lcdc1>, <&clk_gates15 8>, <&pd_vop1>;
        clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "pd_lcdc";
    };

The first thing that I find rather confusing, is this comment in the code (see above):

/*lcdc0 as PRMRY(HDMI),lcdc1 as EXTEND(RK1000)*/

What does this mean? How can lcdc0 be HDMI if HDMI itself has its own dedicated node in the DT? Does it mean that lcdc0 is routed to the HDMI port on the board?

Again, carefully looking at the code (see above for full snippet):

    vga_ddc@50 {
        compatible = "firefly,vga_ddc";
        reg = <0x50>;
        gpio-pwn = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
        rockchip,source = <0>; //0: LCDC0; 1: LCDC1
        rockchip,prop = <PRMRY>;//<EXTEND>
        status = "okay";
    };  

My interpretation is that

rockchip,source = <0>; //0: LCDC0; 1: LCDC1

can select two different sources.

So by default lcdc0 is selected as VGA source and according to the above code lcdc0 is HDMI (?) - when I change the VGA source to 1 (RK1000?) what is supposed to happen?

I tried various (somewhat logical) combinations by enabling/disabling the relevant nodes but all I’ve obtained was the board booting with no video out at all (no VGA, no HDMI) - best case was only the HDMI out working.

I suspect that there’s more involved than just modifying the kernel DT - for example, the Firefly VGA driver itself (firefly_vga.c) has this function:

void vga_switch_source(int source)
{
   gpio_direction_output(ddev->gpio_sel, (source==VGA_SOURCE_INTERNAL) ? ddev->gpio_sel_enable:(!ddev->gpio_sel_enable));
}

I appreciate any suggestion! :smiley:

UPDATE - I seem to have (sadly) overlooked the simplicity of what I am trying to achieve.

The first thing that I have tried initially, was the following trivial change in the kernel DT:

&hdmi {
    status = "disabled";
    rockchips,hdmi_audio_source = <0>;
    hdmi_cec = <0>;
};

As I compiled the kernel the first time with such change, I found that no HDMI or VGA outputs were working anymore, although the board was booting fine - this led me to think that something else was involved so I got sidetracked with other related attempts.

I was about to give up, when I thought about starting from scratch - all I did was

make distclean

followed by kernel recompilation with just this change in the DT:

&hdmi {
    status = "disabled";
    rockchips,hdmi_audio_source = <0>;
    hdmi_cec = <0>;
};

It works! :lol

Moral of the story: if you are convinced that something should just work but it doesn’t, try cleaning up and start from scratch!

thank for your post, it very helpfull!
Could you please guide me to display only on LVDS LCD only!
Thank you!

Is there a way to use this to force the HDMI into DVI mode?

Based on the board schematics, the VGA port is connected to the RK3288’s LVDS interface Geoguessr Free (LCDC0_Dx), while the HDMI port is connected to the RK3288’s dedicated HDMI pins.

Thanks!!
fnaf 1

The AZ-305 exam encompasses a wide range of critical topics, including identity and security, data storage solutions, business continuity, infrastructure design, and monitoring strategies. Navigating this technically demanding curriculum requires a focused and current study approach. Guide4Sure delivers precisely that with its meticulously updated preparation materials that are comprehensively aligned with Microsoft’s latest examination objectives. This contemporary approach ensures your preparation efforts remain concentrated on high-yield Azure concepts and current implementations, enabling you to build the robust technical foundation necessary for both examination success and professional cloud architecture.

Become a Microsoft Azure Solutions Architect Expert with Guide4sure at >>>>>>> https://www.guide4sure.com/AZ-305-release.html

Through reading this article, I gained a lot of professional knowledge. Free access to the Exam L4M6 exercise test questions. Best of luck to everyone!