|
Modify kernel for VGA-OUT only
Posted at 6/26/2015 13:01:58
View:12072
|
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):
- &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>;
- };
Copy the code
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";
- };
Copy the code
The first thing that I find rather confusing, is this comment in the code (see above):
- /*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):
- 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";
- };
Copy the code
My interpretation is that- 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:
- void vga_switch_source(int source)
- {
- gpio_direction_output(ddev->gpio_sel, (source==VGA_SOURCE_INTERNAL) ? ddev->gpio_sel_enable:(!ddev->gpio_sel_enable));
- }
Copy the code
I appreciate any suggestion! |
|