Hello,
We at
https://openvario.org/ are trying to upgrade our device from legacy linux-3.4 with proprietary mali drivers to modern linux with DRM/KMS-based graphics. The device we are building is based on Cubieboard 2 with Allwinner A20 (sun7i) SoC. It has a LCD screen connected via LVDS interface.
We have a problem making this screen running under sun4i-drm display pipeline.
We are building an SD image using Yocto-based build system, that builds u-boot and linux kernel-5.2-rc2. Under current setup (which I will describe below), device is booted by u-boot, that successfully initializes the LCD and outputs a splash image on it (that's how I know LCD itself is connected correctly and works). When u-boot passes control to the kernel, that splash image slowly fades into all-white and the screen stays bright-white until device is turned off. I have full access to the machine via serial (ttyS0) interface.
U-boot is compiled with these config options (among others):
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN7I=y
CONFIG_VIDEO_LCD_MODE="x:640,y:480,depth:18,pclk_khz:25000,hs:1,vs:1,le:157,ri:2,up:42,lo:2,sync:3,vmode:0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
Kernel is configured to compile these drm-related modules (among others):
drm, panel_lvds, lima, sun4i_drm, gpu_sched, sun4i_drm_hdmi, sun4i_backend, sun4i_tcon, sun4i_frontend, drm_kms_helper.
They all load automatically during boot and together with lima module produce /dev/dri/card0 and /dev/dri/card1 devices. I have created the device tree for the kernel with "panel-lvds" connected directly to tcon0, port 1, endpoint 0. I have also provided additional reset line, as per sun4i-drm.txt doc (see [1]). There is a pipeline for HDMI is set up in DT too, but I'm omitting it for brevity.
When kernel loads, I see sun4i-drm modules initialize without apparent errors (see [2]).
Since this set up didn't work out-of-the-box, I started to dig deeper and added more trace logging to parts of drivers/gpu/drm/sun4i/sun4i_tcon.c that deal with LVDS. It turned out that all LVDS initialization was basically skipped, because current sun4i_tcon_quirks object (sun7i_a20_quirks in my case) did not have "supports_lvds" property (compare to sun8i_a83t_lcd_quirks). My naive attempt to simply add that property didn't result to LCD working (no notable changes in panel' behavior), however my tracing output indicate that sun4i_lvds_init() is called before "sun4i-drm display-engine: bound 1c0c000.lcd-controller" message. sun4i_tcon_lvds_set_status() function is called too (with enabled=true), just after "fbcon: Taking over console" message. Effectively what you see in [2] is a log after I introduced sun7i_a20_quirks.supports_lvds.
Do you see anything I missed trying to make LCD work? Is it expected to work at all with current kernel? If not, what is missing? Can I provide any additional info?
I (and all Openvario users) would really appreciate any help making the LCD to run!
[1] Device tree excerpt:
panel {
compatible = "openvario,lvds57", "panel-lvds";
width-mm = <261>;
height-mm = <163>;
data-mapping = "jeida-18";
panel-timing {
/* 640x480 @60Hz */
clock-frequency = <25000000>;
hactive = <640>;
vactive = <480>;
hsync-len = <1>;
hfront-porch = <2>;
hback-porch = <157>;
vsync-len = <1>;
vfront-porch = <2>;
vback-porch = <42>;
};
port {
lvds_panel_in: endpoint {
remote-endpoint = <&display_out_rgb>;
};
};
};
&tcon0 {
resets = <&ccu RST_TCON0>, <&ccu RST_LVDS>;
reset-names = "lcd", "lvds";
ports {
tcon0_out: port@1 {
display_out_rgb: endpoint@0 {
reg = <0>;
remote-endpoint = <&lvds_panel_in>;
allwinner,tcon-channel = <0>;
};
};
};
};
[2] dmesg report excerpt
...
[ 5.017228] lima 1c40000.gpu: bus rate = 300000000
[ 5.022129] lima 1c40000.gpu: mod rate = 384000000
[ 5.090519] lima 1c40000.gpu: gp - mali400 version major 1 minor 1
[ 5.096905] lima 1c40000.gpu: pp0 - mali400 version major 1 minor 1
[ 5.103562] lima 1c40000.gpu: pp1 - mali400 version major 1 minor 1
[ 5.109985] lima 1c40000.gpu: l2 cache 64K, 4-way, 64byte cache line, 64bit external bus
[ 5.122207] sun4i-drm display-engine: bound 1e00000.display-frontend (ops sun4i_frontend_driver_exit [sun4i_frontend])
[ 5.133246] sun4i-drm display-engine: bound 1e20000.display-frontend (ops sun4i_frontend_driver_exit [sun4i_frontend])
[ 5.144504] sun4i-drm display-engine: bound 1e60000.display-backend (ops sun4i_backend_ops [sun4i_backend])
[ 5.154749] sun4i-drm display-engine: bound 1e40000.display-backend (ops sun4i_backend_ops [sun4i_backend])
[ 5.206936] [drm] Initialized lima 1.0.0 20190217 for 1c40000.gpu on minor 0
[ 5.211187] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops sun4i_tcon_platform_driver_exit [sun4i_tcon])
[ 5.251228] sun4i-tcon 1c0d000.lcd-controller: Missing LVDS properties, Please upgrade your DT
[ 5.259931] sun4i-tcon 1c0d000.lcd-controller: LVDS output disabled
[ 5.282987] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[ 5.290858] sun4i-drm display-engine: bound 1c0d000.lcd-controller (ops sun4i_tcon_platform_driver_exit [sun4i_tcon])
[ 5.354508] axp20x-i2c 0-0034: AXP20X driver loaded
[ 5.365705] sun4i-drm display-engine: bound 1c16000.hdmi (ops sun4i_hdmi_driver_exit [sun4i_drm_hdmi])
...
[ 11.486816] fbcon: Taking over console
[ 11.513746] Console: switching to colour frame buffer device 80x30