cancel
Showing results for 
Search instead for 
Did you mean: 

Enable LVDS panel on STM32MP257F-EV1 based on Android OS

Tim_ho
Associate III

Dear ST Developer Support,

I want to enable LVDS panel on STM32MP257F-EV1 based on Android OS.

I tried to modify device tree stm32mp257f-ev1.dts and stm32mp257f-ev1-overlay.dts to enable LVDS panel.

But I could not enable it. When I revert the device fdt file, I saw that the LVDS related device tree nodes 

  • lvds

  • ltdc
  • panel-lvds

  • panel-lvds-backlight

  • display-controller

status were "disabled".

In stm32mp257f-ev1.dts and stm32mp257f-ev1-overlay.dts file, the LVDS related device note are status="okay".

So, I confuse on this problem. Maybe somewhere dts overlay this device node, but I cannot find it.

Would you help me solve this problem?

Thanks.

15 REPLIES 15

Hi Philippe,

Yes, I just modify the panel_lvds node to fit my LVDS panel timing spec.

	panel_lvds: panel-lvds {
		compatible = "edt,etml0700z9ndha", "panel-lvds";
		enable-gpios = <&gpiog 15 GPIO_ACTIVE_HIGH>;
		backlight = <&panel_lvds_backlight>;
		status = "okay";

		width-mm = <261>;
		height-mm = <163>;
		data-mapping = "vesa-24";

		panel-timing {
			clock-frequency = <69900000>;
			hactive = <1280>;
			vactive = <800>;
			hfront-porch = <72>;
			hback-porch = <200>;
			hsync-len = <128>;
			vfront-porch = <3>;
			vback-porch = <22>;
			vsync-len = <6>;
		};

		port {
			lvds_panel_in: endpoint {
				remote-endpoint = <&lvds_out0>;
			};
		};
	};

 

I have a question. if the lvds panel is disconnect, the ltdc and lvds status would show disabled?

Thanks. 

Hi,

 

I did again some tests by modifying the panel-timing section to check if modifications are taken into account.

Be sure to use this command line to really update your image with your new dtb:

 

build_kernel ; build_kernel -i; make -j8

 

If screen is still black, timing might not be good (?)

To get more info on your LVDS connection, you can use "modetest" tool :

https://wiki.st.com/stm32mpu/wiki/DRM_KMS_overview#modetest_-28DRM-2FKMS_test_tool-29

 

For Android, I give you a few quick tips to use this binary as it is not installed by default:

cd external/libdrm/tests/modetest

mm
adb root
adb remount (takes a while sometimes)
adb push ./out/soong/.intermediates/external/libdrm/tests/modetest/modetest/android_arm64_armv8-a/modetest /vendor/bin/.
 

When LVDS is connected, you should get this "/vendor/bin/modetest" output on target:

 

id      crtc    type    possible crtcs  possible clones 
31      0       DSI     0x00000001      0x00000001
33      44      LVDS    0x00000001      0x00000002
 ...
34      33      connected       LVDS-1          156x92          1       33
 modes:
       index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
 #0 1024x600 ...

Hope this can help you.

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Philippe,

I confuse a question. If the lvds panel is disconnect or connect other lvds panel, the ltdc and lvds status become "disabled"? 

root@stm32mp2-e3-df-42:~# cat /proc/device-tree/soc@0/bus@42080000/display-controller@48010000/status
disabled
root@stm32mp2-e3-df-42:~# cat /proc/device-tree/soc@0/bus@42080000/lvds@48060000/status
disabled
root@stm32mp2-e3-df-42:~# cat /proc/device-tree/panel-lvds/status
disabled

 I found a situation, I use the same dtb, I connect the B-LVDS7-WSVGA panel, the lvds status would show "okay".

And I can see lvds driver log in dmsg, which I add some debug message in lvds driver.

But, when I disconnect lvds panel or connect other lvds panel, the lvds status would become "disabled". 

Besides, the lvds driver would not probe in kernel. I cannot see any debug message which I added.

Hi,

I just got this information that uboot needs to be modified in case another LVDS panel is used.

Otherwise uboot will desactivate the LVDS DT node and we won't be able to get the driver working.

I will come back to you tomorrow with more explanation about necessary uboot patches.

BR,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi,

to modify uboot/bootloader, you need to follow this documentation:

https://wiki.st.com/stm32mpu/wiki/How_to_build_bootloaders_for_Android

 

And in order to use another LVDS screen than the standard one (etml0700z9ndha) delivered with Eval board, you have comment the following section in 

"./device/stm/stm32mp2-bootloader/u-boot-stm32mp2/board/st/stm32mp2/stm32mp2.c" file (line 784)

 

      //if (board_is_stm32mp257_eval()) {
      // ret = fixup_stm32mp257_eval_panel(blob);
      // if (ret)
      //  log_err("Error during panel fixup ! (%d)\n", ret);
     //}

 

This will avoid to disable the DT node when another LVDS screen is used.

 

As explained in documentation, rebuild bootloader (build_bootloader), update it (build_bootloader -i), build full image (make -j) and reflash (flash-device).

Let me know if you have trouble,

BR,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Philippe,

After I modified u-boot "stm32mp2.c" file, the LVDS panel can work. Thank your help!

But, I find another problem. The LVDS panel can bring up on android, it cannot show the ST logo system logo in u-boot and kernel boot up phase. How to enable the boot up logo on u-boot and kernel phase?