Verdin AM62 native LVDS display issues

Hello there!

tdx-info output:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.1.83-6.7.0+git.0a32d33d5fb7 #1-TorizonCore SMP PREEMPT Fri Jun 28 09:20:37 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/4860b7954d80173545a45a89e0765e31bb165e2c97451c60ae9597b7228d2683/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.7.0-build.18
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-am62-15207106
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 WB on prototype mk1
Toradex version:          0075 V1.1A
Serial number:            15207106
Processor arch:           aarch64
------------------------------------------------------------

I am currently working on getting an LVDS display to show anything, which isn’t a black screen. Furthermore I’d like to have the backlight be enabled on startup. I am working with a custom carrier board - the same prototype mentioned in my last post. We’re using native LVDS. The display is a Tianma P0800WVF1MA00. As far as I can tell from the datasheet, no additional drivers are required to operate the display.

Backlight

My current device tree builds, and the backlight is controllable. I can enable the backlight, and set it to different brightness levels. However, it isn’t enabled at when booting the device. The following snippet contains the backlight definition in the device tree:

	backlight_lvds_native: backlight_lvds_native {
        compatible = "pwm-backlight";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_blk_grp>;
        brightness-levels = <0 45 63 88 119 158 203 255>;
        default-brightness-level = <7>;
        enable-gpios = <&main_gpio0 30 GPIO_ACTIVE_HIGH>;
        pwms = <&epwm1 0 6666667 PWM_POLARITY_INVERTED>;
	};

LVDS display

TorizonOS is currently able to find the display. There is a card0-LVDS-1 directory with an edid file present in the /sys/class/drm directory. However, both the edid and modes files are empty. The following snippets are the definitions used to detect the LVDS display in the device tree:

	panel-lvds-native {
        compatible = "panel-lvds";
        // backlight = <&backlight_lvds_native>;
        data-mapping = "jeida-18";
        height-mm = <122>;
        width-mm = <192>;

        panel-timing {
            clock-frequency = <28390000 33260000 52030000>;
            de-active = <1>;
            hactive = <800 800 800>;
            hback-porch = <0 0 0>;
            hfront-porch = <0 0 0>;
            hsync-active = <0>;
            hsync-len = <110 256 338>;
            pixelclk-active = <1>; /* positive edge */
            vactive = <480 480 480>;
            vback-porch = <0 0 0>;
            vfront-porch = <0 0 0>;
            vsync-active = <0>;
            vsync-len = <40 45 282>;
        };

        port {
            panel_lvds_native_in: endpoint {
                remote-endpoint = <&oldi_out0>;
            };
        };

Weston also keeps restarting, as it fails to configure the output. The following logs, are the logs provided by the weston container:

Switching VT tty1 to text mode if currently in graphics mode
Switching to VT 7
Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
Date: 2022-04-28 UTC
[17:42:59.746] weston 10.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 10.0.1
[17:42:59.746] Command line: weston -Bdrm-backend.so --current-mode -Swayland-0
[17:42:59.746] OS: Linux, 6.1.83-6.7.0+git.0a32d33d5fb7, #1-TorizonCore SMP PREEMPT Fri Jun 28 09:20:37 UTC 2024, aarch64
[17:42:59.746] Flight recorder: enabled
[17:42:59.747] Using config file '/etc/xdg/weston-dev/weston.ini'
[17:42:59.758] Output repaint window is 7 ms maximum.
[17:42:59.760] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/drm-backend.so'
[17:42:59.824] initializing drm backend
[17:42:59.825] Trying libseat launcher...
00:00:00.256 [INFO] [seatd/server.c:145] New client connected (pid: 27, uid: 1000, gid: 1000)
00:00:00.257 [INFO] [seatd/seat.c:170] Added client 7 to seat0
00:00:00.257 [INFO] [seatd/seat.c:480] Opened client 7 on seat0
[17:42:59.826] libseat: session control granted
[17:42:59.839] using /dev/dri/card0
[17:42:59.839] DRM: supports atomic modesetting
[17:42:59.839] DRM: supports GBM modifiers
[17:42:59.839] DRM: supports picture aspect ratio
[17:42:59.842] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/gl-renderer.so'
[17:43:01.023] EGL client extensions: EGL_EXT_device_base
               EGL_EXT_device_enumeration EGL_EXT_device_query
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device
               EGL_EXT_platform_wayland EGL_KHR_platform_wayland
               EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb
               EGL_MESA_platform_gbm EGL_KHR_platform_gbm
               EGL_MESA_platform_surfaceless
[17:43:01.032] EGL device extensions: EGL_EXT_device_drm
[17:43:01.033] EGL version: 1.5
[17:43:01.033] EGL vendor: Mesa Project
[17:43:01.033] EGL client APIs: OpenGL_ES
[17:43:01.033] EGL extensions: EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age
               EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers
               EGL_EXT_image_gl_colorspace EGL_EXT_yuv_surface
               EGL_IMG_context_priority EGL_KHR_cl_event2
               EGL_KHR_config_attribs EGL_KHR_create_context
               EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
               EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image
               EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image
               EGL_KHR_gl_texture_cubemap_image EGL_KHR_image
               EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_partial_update
               EGL_KHR_reusable_sync EGL_KHR_surfaceless_context
               EGL_EXT_pixel_format_float EGL_KHR_wait_sync
               EGL_MESA_configless_context EGL_MESA_drm_image
               EGL_MESA_image_dma_buf_export EGL_MESA_query_driver
               EGL_WL_bind_wayland_display EGL_IMG_cl_image
[17:43:01.049] EGL_KHR_surfaceless_context available
[17:43:01.169] GL version: OpenGL ES 3.1 build 23.3@6512818
[17:43:01.169] GLSL version: OpenGL ES GLSL ES 3.10 build 23.3@6512818
[17:43:01.169] GL vendor: Imagination Technologies
[17:43:01.169] GL renderer: PowerVR A-Series AXE-1-16M
[17:43:01.169] GL extensions: GL_APPLE_texture_format_BGRA8888
               GL_EXT_EGL_image_array GL_EXT_YUV_target GL_EXT_blend_minmax
               GL_EXT_buffer_storage GL_EXT_clear_texture GL_EXT_clip_control
               GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float
               GL_EXT_compressed_ETC1_RGB8_sub_texture
               GL_EXT_conservative_depth GL_EXT_copy_image
               GL_EXT_discard_framebuffer GL_EXT_draw_buffers
               GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex
               GL_EXT_float_blend GL_EXT_gpu_shader5 GL_EXT_memory_object
               GL_EXT_memory_object_fd GL_EXT_multi_draw_arrays
               GL_EXT_multisampled_render_to_texture
               GL_EXT_multisampled_render_to_texture2
               GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp
               GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB
               GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects
               GL_EXT_shader_framebuffer_fetch GL_EXT_shader_group_vote
               GL_EXT_shader_implicit_conversions GL_EXT_shader_io_blocks
               GL_EXT_shader_non_constant_global_initializers
               GL_EXT_shader_pixel_local_storage
               GL_EXT_shader_pixel_local_storage2 GL_EXT_shader_texture_lod
               GL_EXT_shadow_samplers GL_EXT_sparse_texture
               GL_EXT_texture_border_clamp GL_EXT_texture_buffer
               GL_EXT_texture_cube_map_array GL_EXT_texture_format_BGRA8888
               GL_EXT_texture_format_sRGB_override GL_EXT_texture_rg
               GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8
               GL_EXT_texture_sRGB_decode GL_EXT_texture_shadow_lod
               GL_EXT_texture_type_2_10_10_10_REV GL_EXT_unpack_subimage
               GL_IMG_framebuffer_downsample
               GL_IMG_multisampled_render_to_texture GL_IMG_program_binary
               GL_IMG_read_format GL_IMG_shader_binary
               GL_IMG_texture_format_BGRA8888 GL_IMG_texture_npot
               GL_KHR_blend_equation_advanced
               GL_KHR_blend_equation_advanced_coherent GL_KHR_debug
               GL_KHR_robustness GL_NV_draw_instanced GL_NV_instanced_arrays
               GL_OES_EGL_image GL_OES_EGL_image_external
               GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_depth_texture GL_OES_depth_texture_cube_map
               GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex
               GL_OES_element_index_uint GL_OES_fragment_precision_high
               GL_OES_get_program_binary GL_OES_gpu_shader5 GL_OES_mapbuffer
               GL_OES_packed_depth_stencil GL_OES_required_internalformat
               GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables
               GL_OES_shader_image_atomic GL_OES_shader_io_blocks
               GL_OES_shader_multisample_interpolation
               GL_OES_standard_derivatives GL_OES_surfaceless_context
               GL_OES_texture_3D GL_OES_texture_border_clamp
               GL_OES_texture_buffer GL_OES_texture_cube_map_array
               GL_OES_texture_float GL_OES_texture_half_float
               GL_OES_texture_half_float_linear GL_OES_texture_npot
               GL_OES_texture_stencil8
               GL_OES_texture_storage_multisample_2d_array
               GL_OES_vertex_array_object GL_OES_vertex_half_float
[17:43:01.331] GL ES 3.1 - renderer features:
               read-back format: BGRA
               EGL Wayland extension: yes
[17:43:01.502] event0  - tps65219-pwrbutton: is tagged by udev as: Keyboard
[17:43:01.503] event0  - tps65219-pwrbutton: device is a keyboard
[17:43:01.513] event1  - TSC2007 Touchscreen: is tagged by udev as: Touchscreen
[17:43:01.514] event1  - TSC2007 Touchscreen: device is a touch device
[17:43:01.705] libinput: configuring device "tps65219-pwrbutton".
[17:43:01.715] Touchscreen - TSC2007 Touchscreen - /sys/devices/platform/bus@f0000/20020000.i2c/i2c-2/2-0048/input/input2/event1
[17:43:01.716] libinput: configuring device "TSC2007 Touchscreen".
[17:43:01.716] input device event1 has no enabled output associated (none named), skipping calibration for now.
[17:43:01.716] DRM: head 'LVDS-1' updated, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[17:43:01.716] DRM: head 'LVDS-1' found, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[17:43:01.717] Registered plugin API 'weston_drm_output_api_v1' of size 24
[17:43:01.717] Registered plugin API 'weston_drm_virtual_output_api_v1' of size 48
[17:43:01.717] Color manager: no-op
[17:43:01.717] no available modes for LVDS-1
[17:43:01.717] Cannot configure an output using weston_drm_output_api.
[17:43:01.719] event0  - tps65219-pwrbutton: device removed
[17:43:01.756] event1  - TSC2007 Touchscreen: device removed
00:00:02.289 [INFO] [seatd/seat.c:418] No clients on seat0 to activate
00:00:02.290 [INFO] [seatd/seat.c:524] Closed client 7 on seat0
00:00:02.290 [INFO] [seatd/seat.c:192] Removed client 7 from seat0
00:00:02.290 [INFO] [seatd/client.c:471] Client disconnected
00:00:02.350 [INFO] [seatd/seatd.c:218] seatd stopped
Switching back to vt 1

I’m unsure of how to continue, as I have limited experince getting custom displays to work. Any and all help would be much appreciated. Thanks!

Best regards,
Sophus

The issue has been solved!
For anyone else using the same Tianma P0800WVF1MA00 LVDS display. I am currently unsure exactly which change made everything work, so I’ll post all the changes made.

For the backlight, I uncommented the backlight property of the panel-lvds-native phandle.
The data-mapping property of the panel-lvds-native phandle got changed to "jeida-24".
The display has 4 inputs used to control scan direction, mode, resetting the display and putting it to standby. Here, I created a gpio-hog for the GPIO responsible for handling the mode, and set it to output-high.
Finally I split the timings, so hback-porch, hfront-porch, vback-porch and vfront-porch contained values. I doubt this was the actual reason for the sudden success, but it might be worth a try, if you’ve tried all the other suggestions posted here, and it still doesn’t work.
The following device tree configuration might not work 100% for other users, as that would depend on the pins used for configuration of the display, pwm used, etc, but could provide a guideline for those struggling:

/ {
	backlight_lvds_native: backlight_lvds_native {
        compatible = "pwm-backlight";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_blk_grp>;
        brightness-levels = <0 45 63 88 119 158 203 255>;
        default-brightness-level = <7>;
        enable-gpios = <&main_gpio0 30 GPIO_ACTIVE_HIGH>;
        pwms = <&epwm1 0 6666667 PWM_POLARITY_INVERTED>;
	};

	panel-lvds-native {
        compatible = "panel-lvds";
        backlight = <&backlight_lvds_native>;
        data-mapping = "jeida-24";
        height-mm = <122>;
        width-mm = <192>;

        panel-timing {
            clock-frequency = <28390000 33260000 52030000>;
            hactive = <800 800 800>;
            hback-porch = <50 120 150>;
            hfront-porch = <50 120 150>;
            hsync-len = <10 16 38>;
            vactive = <480 480 480>;
            vback-porch = <14 15 130>;
            vfront-porch = <14 15 130>;
            vsync-len = <12 15 22>;
            de-active = <1>;
			hsync-active = <0>;
			vsync-active = <0>;
            pixelclk-active = <1>; /* positive edge */
        };

        port {
            panel_lvds_native_in: endpoint {
                remote-endpoint = <&oldi_out0>;
            };
        };
};

&dss {
	status = "okay";
};

&dss_ports {
    #address-cells = <1>;
    #size-cells = <0>;

    /* LVDS Output (OLDI TX 0) */
    port@0 {
        reg = <0>;

        oldi_out0: endpoint {
            remote-endpoint = <&panel_lvds_native_in>;
        };
    };
};

&epwm1 {
	#pwm-cells = <2>;
    status = "okay";
};

&main_pmx0 {
	pinctrl_blk_grp: main-gpio0-30-pins-default {
		pinctrl-single,pins = 
			<AM62X_IOPAD(0x0078, PIN_INPUT, 7)>;				// BLEN					SODIMM 21
	};

	agpinctrl_lvds_gpios: aggpio-lvds {
		pinctrl-single,pins = 
			<AM62X_IOPAD(0x234, PIN_OUTPUT, 7)>,				// SC					SODIMM 78
			<AM62X_IOPAD(0x230, PIN_OUTPUT, 7)>,				// Reset				SODIMM 80
			<AM62X_IOPAD(0x22c, PIN_OUTPUT, 7)>,				// Mode					SODIMM 82
			<AM62X_IOPAD(0x240, PIN_OUTPUT, 7)>;				// Standby				SODIMM 84
	};
};

&main_gpio1 {
	pinctrl-0 =
		<&agpinctrl_lvds_gpios>;
	
	lvds_mode_hog: mode-hog {
		gpio-hog;
		gpios = <43 GPIO_ACTIVE_HIGH>;
		line-name = "LVDS_MODE_SET";
		output-high;
		status = "okay";
	};
};