Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Modify kernel for VGA-OUT only

115

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
115

Modify kernel for VGA-OUT only

Posted at 6/26/2015 13:01:58      View:12069 | Replies:3        Print      Only Author   [Copy Link] 1#
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):

  1. &i2c4 {                                                                                                                                                     
  2.     status = "okay";
  3.     rk1000_control@40 {
  4.         compatible = "rockchip,rk1000_control";
  5.         reg = <0x40>;
  6.         gpio-reset = <&gpio7 GPIO_C5 GPIO_ACTIVE_LOW>;
  7.         clocks = <&clk_i2s>, <&clk_i2s_out>;
  8.         clock-names = "i2s_clk","i2s_mclk";
  9.         //pinctrl-names = "default";
  10.         //pinctrl-0 = <&i2s_mclk>;
  11.     };  
  12.     rk1000_tve@42 {
  13.         compatible = "rockchip,rk1000_tve";
  14.         reg = <0x42>;
  15. //      gpio-switch = <&gpio3 GPIO_D4 GPIO_ACTIVE_LOW>;
  16.         rockchip,source = <0>; //0: LCDC0; 1: LCDC1
  17.         rockchip,prop = <PRMRY>;//<EXTEND>
  18.     };  
  19.     rk1000_codec: rk1000_codec@60 {
  20.         compatible = "rockchip,rk1000_codec";
  21.         reg = <0x60>;
  22.         spk_ctl_io = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
  23.         boot_depop = <1>;
  24.         pa_enable_time = <5000>;
  25.     };  
  26.     vga_ddc@50 {
  27.         compatible = "firefly,vga_ddc";
  28.         reg = <0x50>;
  29.         gpio-pwn = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
  30.         rockchip,source = <0>; //0: LCDC0; 1: LCDC1
  31.         rockchip,prop = <PRMRY>;//<EXTEND>
  32.         status = "okay";
  33.     };  
  34. };

  35. &i2c5 {
  36.     status = "disabled";
  37. };

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

  45. &fb {
  46.     rockchip,disp-mode = <DUAL>;
  47. };

  48. &rk_screen {
  49.      display-timings = <&disp_timings>;
  50. };

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

  56. &lcdc1 {
  57.     status = "disabled";
  58.     rockchip,prop = <EXTEND>;
  59. };

  60. &hdmi {
  61.     status = "okay";
  62.     rockchips,hdmi_audio_source = <0>;
  63.     hdmi_cec = <0>;
  64. };
Copy the code


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

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

  15.     lcdc0: lcdc@ff930000 {
  16.         compatible = "rockchip,rk3288-lcdc";
  17.         rockchip,prop = <EXTEND>;
  18.         rockchip,pwr18 = <0>;
  19.         rockchip,iommu-enabled = <1>;
  20.         reg = <0xff930000 0x10000>;
  21.         interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
  22.         //pinctrl-names = "default", "gpio";
  23.         //pinctrl-0 = <&lcdc0_lcdc>;
  24.         //pinctrl-1 = <&lcdc0_gpio>;
  25.         status = "disabled";
  26.         clocks = <&clk_gates15 5>, <&dclk_lcdc0>, <&clk_gates15 6>, <&pd_vop0>;
  27.         clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "pd_lcdc";
  28.     };

  29.     lcdc1: lcdc@ff940000 {
  30.         compatible = "rockchip,rk3288-lcdc";
  31.         rockchip,prop = <PRMRY>;
  32.         rochchip,pwr18 = <0>;
  33.         rockchip,iommu-enabled = <1>;
  34.         reg = <0xff940000 0x10000>;
  35.         interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
  36.         pinctrl-names = "default", "gpio";
  37.         pinctrl-0 = <&lcdc0_lcdc>;
  38.         pinctrl-1 = <&lcdc0_gpio>;
  39.         status = "disabled";
  40.         clocks = <&clk_gates15 7>, <&dclk_lcdc1>, <&clk_gates15 8>, <&pd_vop1>;
  41.         clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "pd_lcdc";
  42.     };
Copy the code


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

  1. /*lcdc0 as PRMRY(HDMI),lcdc1 as EXTEND(RK1000)*/
Copy the code


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):

  1.     vga_ddc@50 {
  2.         compatible = "firefly,vga_ddc";
  3.         reg = <0x50>;
  4.         gpio-pwn = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
  5.         rockchip,source = <0>; //0: LCDC0; 1: LCDC1
  6.         rockchip,prop = <PRMRY>;//<EXTEND>
  7.         status = "okay";
  8.     };  
Copy the code


My interpretation is that
  1. rockchip,source = <0>; //0: LCDC0; 1: LCDC1
Copy the code
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:

  1. void vga_switch_source(int source)
  2. {
  3.    gpio_direction_output(ddev->gpio_sel, (source==VGA_SOURCE_INTERNAL) ? ddev->gpio_sel_enable:(!ddev->gpio_sel_enable));                           
  4. }
Copy the code


I appreciate any suggestion!
Reply

Use props Report

115

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
115
Posted at 6/29/2015 12:01:37        Only Author  2#
Last edited by return0 In 6/29/2015 12:03 Editor

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:

  1. &hdmi {
  2.     status = "disabled";
  3.     rockchips,hdmi_audio_source = <0>;
  4.     hdmi_cec = <0>;
  5. };
Copy the code


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
  1. make distclean
Copy the code
followed by kernel recompilation with just this change in the DT:

  1. &hdmi {
  2.     status = "disabled";
  3.     rockchips,hdmi_audio_source = <0>;
  4.     hdmi_cec = <0>;
  5. };
Copy the code


It works!

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

Use props Report

36

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
36
Posted at 10/5/2015 18:23:00        Only Author  3#
thank for your post, it very helpfull!
Could you please guide me to display only on LVDS LCD only!
Thank you!
Reply

Use props Report

78

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
78
Posted at 9/6/2017 06:20:58        Only Author  4#
Is there a way to use this to force the HDMI into DVI mode?
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list