This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: AM62x: lvds panel doesn't work

Part Number: AM625

Hi TI Team,

Currently, I am working on our custom board  and trying to activate LVDS CH1 (odd) port.  The sdk version is v9.02. 

Previously, we had an RGB LCD screen that worked fine; now we need to use an LVDS single link 18bits LCD screen. The interface information is shown in the attached images. Referring to some articles on the forum, I have modified the DTS file and panel-simple.c as follows. However, the LVDS panel is not working properly and remains in bist mode.

DTS:

	panel {
		compatible = "boe,boe_ev150x0m";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_panel_en>;
		power-supply = <&vcc_5v0>;
		enable-gpios = <&main_gpio1 7 GPIO_ACTIVE_HIGH>;
		backlight = <&backlight>;

		/*
		* Note that the OLDI TX 0 transmits the odd set of pixels
		* while the OLDI TX 1 transmits the even set. This is a
		* fixed configuration in the IP integration and is not
		* changeable. The properties, "dual-lvds-odd-pixels" and
		* "dual-lvds-even-pixels" have been used to merely
		* identify if a Dual Link configuration is required.
		* But swapping them will cause an error in the dss driver.
		*/
		port@0 {
			//dual-lvds-odd-pixels;
			lcd_in0: endpoint {
				remote-endpoint = <&oldi_out0>;
			};
		};
	};
	
		main_oldi0_pins_default: main-oldi0-pins-default {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x0260, PIN_OUTPUT, 0) /* (AA5) OLDI0_A0N */
			AM62X_IOPAD(0x025c, PIN_OUTPUT, 0) /* (Y6) OLDI0_A0P */
			AM62X_IOPAD(0x0268, PIN_OUTPUT, 0) /* (AD3) OLDI0_A1N */
			AM62X_IOPAD(0x0264, PIN_OUTPUT, 0) /* (AB4) OLDI0_A1P */
			AM62X_IOPAD(0x0270, PIN_OUTPUT, 0) /* (Y8) OLDI0_A2N */
			AM62X_IOPAD(0x026c, PIN_OUTPUT, 0) /* (AA8) OLDI0_A2P */
			AM62X_IOPAD(0x0278, PIN_OUTPUT, 0) /* (AB6) OLDI0_A3N */
			AM62X_IOPAD(0x0274, PIN_OUTPUT, 0) /* (AA7) OLDI0_A3P */
			AM62X_IOPAD(0x0280, PIN_OUTPUT, 0) /* (AC6) OLDI0_A4N */
			AM62X_IOPAD(0x027c, PIN_OUTPUT, 0) /* (AC5) OLDI0_A4P */
			AM62X_IOPAD(0x0288, PIN_OUTPUT, 0) /* (AE5) OLDI0_A5N */
			AM62X_IOPAD(0x0284, PIN_OUTPUT, 0) /* (AD6) OLDI0_A5P */
			AM62X_IOPAD(0x0290, PIN_OUTPUT, 0) /* (AE6) OLDI0_A6N */
			AM62X_IOPAD(0x028c, PIN_OUTPUT, 0) /* (AD7) OLDI0_A6P */
			AM62X_IOPAD(0x0298, PIN_OUTPUT, 0) /* (AD8) OLDI0_A7N */
			AM62X_IOPAD(0x0294, PIN_OUTPUT, 0) /* (AE7) OLDI0_A7P */
			AM62X_IOPAD(0x02a0, PIN_OUTPUT, 0) /* (AD4) OLDI0_CLK0N */
			AM62X_IOPAD(0x029c, PIN_OUTPUT, 0) /* (AE3) OLDI0_CLK0P */
			AM62X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (AE4) OLDI0_CLK1N */
			AM62X_IOPAD(0x02a4, PIN_OUTPUT, 0) /* (AD5) OLDI0_CLK1P */
		>;
	};
	
	&dss {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_oldi0_pins_default &main_dss0_pins_default>;
};

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

		/* VP1: LVDS Output (OLDI TX 0) */
	port@0 {
		reg = <0>;
		oldi_out0: endpoint {
			remote-endpoint = <&lcd_in0>;
		};
	};
};

panel-simple.c:

static const struct drm_display_mode boe_ev150x0m_mode = {
	.clock = 58000,
	.hdisplay = 1024,
	.hsync_start = 1024 + 80,
	.hsync_end = 1024 + 80+ 80,
	.htotal = 1024 + 80 + 80 + 40,
	.vdisplay = 768,
	.vsync_start = 768 + 10,
	.vsync_end = 768 + 10 + 10,
	.vtotal = 768 + 10 + 10 + 10,
};

static const struct panel_desc boe_ev150x0m = {
	.modes = &boe_ev150x0m_mode,
	.bpc = 6,
	.num_modes = 1,
	.size = {
		.width = 304,
		.height = 228,
	},
	.delay = {
		.prepare = 50,
		.disable = 50,
	},
	.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
	.bus_flags = DRM_BUS_FLAG_DE_HIGH,
	.connector_type = DRM_MODE_CONNECTOR_LVDS,
};

lcd information:

Below are kmsprint and kmstest results, and register 0x3020A160 and 0x108700.

root@am62xx-evm:~# kmsprint
Connector 0 (40) LVDS-1 (connected)
  Encoder 0 (39) LVDS
    Crtc 0 (38) 1024x768@59.38 58.000 1024/80/80/40/? 768/10/10/10/? 59 (59.38) 0x0 0x48
      Plane 0 (31) fb-id: 48 (crtcs: 0) 0,0 1024x768 -> 0,0 1024x768 (AR12 AB12 RA12 RG16 BG16 AR15 AB15 AR24 AB24 RA24 BA24 RG24 BG24 AR30 AB30 XR12 XB12 RX12 XR15 XB15 XR24 XB24 RX24 BX24 XR30 XB30 YUYV UYVY NV12)
        FB 48 1024x768
root@am62xx-evm:~# kmstest
Connector 0/@40: LVDS-1
  Crtc 0/@38: 1024x768@59.38 58.000 1024/80/80/40/? 768/10/10/10/? 59 (59.38) 0x0 0x48
  Plane 0/@31: 0,0-1024x768
    Fb 49 1024x768-XR24
press enter to exit

root@am62xx-evm:~# devmem2 0x00108700
/dev/mem opened.
Memory mapped at address 0xffff971f2000.
Read at address  0x00108700 (0xffff971f2700): 0x80000002
root@am62xx-evm:~# devmem2 0x3020A160
/dev/mem opened.
Memory mapped at address 0xffffa5125000.
Read at address 0x3020A160 (0xffffa5125160): 0x00001185

I checked the clock signal using an oscilloscope and found that the actual clock frequency was only half of what I configured. Specifically, the configured frequency was 58MHz, but the actual measured frequency was around 29MHz. How can I resolve this issue and get the panel work.

Best regards.

  • Hi,

    Let me check internally and get back to you.

    Regards,
    Krunal

  • Hi Krunal,


    Sorry, I made a mistake in the previous information. According to my MEDIA_BUS_FMT_RGB666_1X7X3_SPWG configuration, the result of devmem2 0x3020A160 is 0x00001081.

    I checked the VP1_OLDI_CFG Register definition, I think BIT7(DEPOL) should not be set to 1, as 1 indicates that DE is active-low, but my panel's DE is active-high. And, I believe BIT8 should be set to 1, Use 6 msbs each of RGB data R[7:2], G[7:2] and B[7:2]. Therefore, I modified the driver in tidss_dispc.c to set this register to 0x00001101, but it did not get any positive results.
    I tried setting the frequency to around 100MHz, resulting in a measured CLK frequency of 50MHz, and also tested various configurations with MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA/SPWG, but both of them didn't solve the problem.

    Do you have any progress or any clues ?

    Best regards.

  • Hi,

    I don't think you need to double the clock and it should be programmed as 58000. Also, you htotal and vtotal does not add up to the LCD specs. Are you sure you programed the right values?

    Also, you mentioned the LCD worked previously and was it with our platform? 

    Regards,
    Krunal

  • Hi Krunal,

    1. I modified htotal and vtotal config as below,also it didn't work.

    static const struct drm_display_mode boe_ev150x0m_mode = {
    	.clock = 58000,
    	.hdisplay = 1024,
    	.hsync_start = 1024 + 80,
    	.hsync_end = 1024 + 80+ 80,
    	.htotal = 1024 + 80 + 80 + 160,
    	.vdisplay = 768,
    	.vsync_start = 768 + 10,
    	.vsync_end = 768 + 10 + 10,
    	.vtotal = 768 + 10 + 10 + 18,
    };
    
    static const struct panel_desc boe_ev150x0m = {
    	.modes = &boe_ev150x0m_mode,
    	.bpc = 6,
    	.num_modes = 1,
    	.size = {
    		.width = 304,
    		.height = 228,
    	},
    	.delay = {
    		.prepare = 50,
    		.disable = 50,
    	},
    	.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
    	.bus_flags = DRM_BUS_FLAG_DE_HIGH,
    	.connector_type = DRM_MODE_CONNECTOR_LVDS,

    2. Yes, I have another RGB interface LCD panel that is working fine on the same board. It is connected to another interface of the board.

    The panel still doesn't work properly. 

    My configuration seems to be correct, but why is the output frequency only half of the set frequency? Could there be an issue with the driver? When using dual-link LVDS, the output frequency should be half of the set frequency, but when set to single-link, the driver is not correctly configured to the set value? Could you please help confirm this? 

    This LVDS panel is being used on our AM335X board, where the RGB signal is converted into LVDS by an SN65LVDS84. I measured the clock frequency when it's working normally, and it's 58MHz, which shouldn't be half of the set value.

    And any other clues?

    Regards,

    Huashan

  • Hi Huashan,

    Understood and I agree with you on the clock frequency. Let me internally check with our developer and get back to you.

    Regards,
    Krunal

  • Hi Krunal,

    I changed the configuration to the following with double clock and hdisplay,, and the panel is working properly now.

    static const struct drm_display_mode boe_ev150x0m_mode = {
    	.clock = 116000,
    	.hdisplay = 2048,
    	.hsync_start = 2048 + 160,
    	.hsync_end = 2048 + 160+ 160,
    	.htotal = 2048 + 160 + 160 + 320,
    	.vdisplay = 768,
    	.vsync_start = 768 + 20,
    	.vsync_end = 768 + 20 + 20,
    	.vtotal = 768 + 20 + 20 + 36,
    };

    Therefore, I believe the driver is working as dual-link instead of the expected single-link. When I configure it with double frequency and hdisplay, I get the desired 1024x768 configuration on LVDS1, with the image combined from odd (or even) pixel columns. Please help check why the driver is not working as single-link.

    Regards,

    Huashan

  • Hi,

    Can you run the command "k3conf dump clock 186" while running kmstest?

    Regards,
    Krunal

  • Hi Krunal,

    Output as below:

    root@am62xx-evm:~# kmstest &
    [1] 1339
    root@am62xx-evm:~# Connector 0/@40: LVDS-1
      Crtc 0/@38: 2048x768@51.13 116.000 2048/160/160/320/? 768/20/20/36/? 51 (51.13) 0x0 0x48
      Plane 0/@31: 0,0-2048x768
        Fb 49 2048x768-XR24
    press enter to exit
    
    root@am62xx-evm:~# k3conf dump clock 186
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Wed Mar 06 14:29:58 UTC 2024)              |
    | SoC    | AM62X SR1.0                                                         |
    | SYSFW  | ABI: 3.1 (firmware version 0x0009 '9.2.7--v09.02.07 (Kool Koala))') |
    |------------------------------------------------------------------------------|
    
    |----------------------------------------------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name                                                      | Status          | Clock Frequency |
    |----------------------------------------------------------------------------------------------------------------------------|
    |   186     |     0    | DEV_DSS0_DPI_0_IN_CLK                                           | CLK_STATE_READY | 812500000       |
    |   186     |     2    | DEV_DSS0_DPI_1_IN_CLK                                           | CLK_STATE_READY | 170000000       |
    |   186     |     3    | DEV_DSS0_DPI_1_IN_CLK_PARENT_HSDIV0_16FFT_MAIN_17_HSDIVOUT0_CLK | CLK_STATE_READY | 170000000       |
    |   186     |     4    | DEV_DSS0_DPI_1_IN_CLK_PARENT_BOARD_0_VOUT0_EXTPCLKIN_OUT        | CLK_STATE_READY | 0               |
    |   186     |     5    | DEV_DSS0_DPI_1_OUT_CLK                                          | CLK_STATE_READY | 0               |
    |   186     |     6    | DEV_DSS0_DSS_FUNC_CLK                                           | CLK_STATE_READY | 250000000       |
    |----------------------------------------------------------------------------------------------------------------------------|

    regards, 

    Huashan

  • Hello,

    I will try to setup a single link on my side and test the output frequency. Based on my internal discussion with SW developers, we do not see any bugs in the driver but will confirm on the poragmmed frequency vs output frequency. I will get back to you by later in the week and in the meantime, have you checked your programmed values with the LCD vendor?

    Regards,
    Krunal

  • Hi Krunal,

    I have confirmed with LCD verdorl that the values are suitable. 

    Have you tested the frequency when configured as single-link?

    Regards,

    Huashan

  • No, I will hopefully get to test it by tomorrow and update you.

    Regards,
    Krunal

  • Hi,

    I was able to replicate the issue on my side as well and can you share what's included in your boot folder? Is the following file included: ti_logo_414x97_32bpp.bmp.gz and if yes, can you remove it?

    If no, can you use the 9.1 Uboot with your 9.2 Kernel and let me know if you still see the divide/2 issue? I believe it has something to do with the following feature: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_02_01_10/exports/docs/linux/Foundational_Components/U-Boot/UG-Splash-Screen.html?highlight=splash and I am still investigating. In the meantime, try the recommendation I listed above and let me know your results. 

    Regards,
    Krunal

  • Hi Krunal,

    Yes , i have ti_logo_414x97_32bpp.bmp.gz include in my boot folder and i  have tested the situation you mentioned above: 

    When I remove ti_logo_414x97_32bpp.bmp.gz file from boot folder, it works normally at configuration 58Mhz/1024x768, and the actual measured frequency is 58Mhz;
    When use the V9.01 u-boot and V9.02 Kernel, the LCD panel also works well, without the frequency being halved.

    Previously I did not test the u-boot support for LVDS. Does the u-boot v9.02 support single-link LVDS panle?

    Regards,

    Huashan

  • Hi,

    We do not support single link and only dual link lvds is supported. I believe customers have modified our base driver to support single link as well. 

    Regards,
    Krunal