7" hdmi display


Recommended Posts

Hi

 

I connect 7" hdmi display from waveshare to orange pi one on mainline dev kernel.

http://www.waveshare.com/wiki/7inch_HDMI_LCD

 

When it is powered before orange, it works ok.

But it don't work if it is powered at the same time.

 

 

 

I am tried to add hpd_delay at the top of  boot.cmd:

 

setenv video-mode sunxi:1024x768-24@60,monitor=hdmi,hpd=1,hpd_delay=20000,edid=1
saveenv

 

the do mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

But still no lack, display shows "no cable connected"

 

Also when board start up, u-boot show on serial console this if display powered up before board:

 

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   vidconsole
Err:   vidconsole

 

And this if display powered same time with board:

 

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial

 

 

How can I debug this?

 

 

 

Also I tried another 5" hdmi display, that is working correctly (it have another hdmi chip, so it starts more quickly)

 

Link to post
Share on other sites
Donate and support the project!

Actually you can't do much except patch U-Boot. H3 and newer chips uses driver in U-Boot which doesn't consider video-mode variable. Since kernel relies on U-Boot to set up HDMI for now, the only thing you can do is to create U-Boot patch and rebuild the image on your own. You only need to change line 131.

Link to post
Share on other sites

Thank you.

It is working now with this patch:

 

diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 33920a2..9ae547a 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -122,13 +122,14 @@ static int sunxi_dw_hdmi_get_plug_in_status(void)
 static int sunxi_dw_hdmi_wait_for_hpd(void)
 {
        ulong start;
+       mdelay(3000);

        start = get_timer(0);
        do {
                if (sunxi_dw_hdmi_get_plug_in_status())
                        return 0;
                udelay(100);
-       } while (get_timer(start) < 300);
+       } while (get_timer(start) < 5000);

        return -1;
 }

 

Is it possible to set timeouts from environment variable?

 

 

 

Link to post
Share on other sites

Touch screen is also working with following tune up

 

sun8i-h3-spi-ads7846.dts

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun8i-h3";

        fragment@0 {
                target = <&pio>;
                __overlay__ {
                        ads7846_pins: ads7846_pins {
                                pins= "PA2";
                                function = "irq";
                        };
                };
        };

        fragment@1 {
                target = <&spi0>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";

                        ads7846@0 {
                                compatible = "ti,ads7846";
                                reg = <1>; /* Chip Select 0 */
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&ads7846_pins>;
                                spi-max-frequency = <500000>;
                                interrupt-parent = <&pio>;
                                interrupts = <0 2 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */
                                pendown-gpio = <&pio 0 2 0>; /* PA7 */

                                /* driver defaults, optional */
                                ti,x-min = /bits/ 16 <0>;
                                ti,x-max = /bits/ 16 <4095>;
                                ti,y-min = /bits/ 16 <0>;
                                ti,y-max = /bits/ 16 <4095>;
                                ti,swap-xy = <1>;
                                ti,pressure-min = /bits/ 16 <0>;
                                ti,pressure-max = /bits/ 16 <255>;
/*                              ti,x-plate-ohms = /bits/ 16 <180>;  */
                                ti,x-plate-ohms = /bits/ 16 <100>;
                                ti,debounce_max = /bits/ 16 <15000>;
                                ti,debounce_tol = /bits/ 16 <65535>;
                                ti,debounce_rep = /bits/ 16 <100>;
                                ti,vref-delay-usecs = /bits/ 16 <450>;
                                ti,keep_vref_on =  <1>;
                                ti,settle_delay_usecs = /bits/ 16 <100>;
                                ti,penirq-recheck-delay-usecs = /bits/ 16 <100>;
                        };
                };
        };
};

 

 

/etc/X11/xorg.conf.d/99-calibr.conf

 

 

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "154 3975 3933 66"
        Option  "SwapAxes"      "0"
EndSection

 

Link to post
Share on other sites
2 minutes ago, Mike R9FT said:

Is it possible to get it from environment variable?

 

Of course, consider following line in drivers/video/videomodes.c

char *p = getenv("video-mode");

Please note that video drivers are loaded very quickly, before U-Boot command line, so variable has to exist before. This can be achieved by setting variable and save it with "saveenv" command.

Link to post
Share on other sites
Guest
This topic is now closed to further replies.