gurucafe
Posts: 7
Joined: Thu Sep 16, 2021 2:24 am

Re: Dual DSI Screens

Tue Sep 21, 2021 2:14 pm

6by9 wrote:
Mon Sep 20, 2021 12:00 pm
gurucafe wrote:
Mon Sep 20, 2021 11:03 am
@6by9 This mean the current vc4-dsi driver still cannot used with two DSI LCDs simultaneously or what I have to update in the vc4-kms overlay? Thank you.
Technically we don't provide support for the OSOYOO displays - they've reverse engineered the official Raspberry Pi panel and made something that should work in the same way. If it doesn't work, it's not actually our problem.
I'm running with the latest kernel and firmware (use "sudo rpi-update" or build your own kernel from the repo), and adding the following overlay as vc4-kms-dsi-7inch-disp0

Code: Select all

/*
 * Device Tree overlay for RaspberryPi 7" Touchscreen panel
 *
 */

/dts-v1/;
/plugin/;

//#include "edt-ft5406.dtsi"

/ {
	compatible = "brcm,bcm2835";

	fragment@0 {
		target = <&dsi0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			port {
				dsi_out: endpoint {
					remote-endpoint = <&bridge_in>;
				};
			};
			bridge@0 {
				reg = <0>;
				compatible = "toshiba,tc358762";
				vddc-supply = <&reg_bridge>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;

					port@0 {
						reg = <0>;
						bridge_in: endpoint {
							remote-endpoint = <&dsi_out>;
						};
					};

					port@1 {
						reg = <1>;
						bridge_out: endpoint {
							remote-endpoint = <&panel_in>;
						};
					};
				};
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			panel_disp0: panel_disp1@1 {
				reg = <1>;
				compatible = "raspberrypi,7inch-dsi", "simple-panel";
				backlight = <&reg_display>;
				power-supply = <&reg_display>;

				port {
					panel_in: endpoint {
						remote-endpoint = <&bridge_out>;
					};
				};
			};

			reg_bridge: reg_bridge@1 {
				reg = <1>;
				compatible = "regulator-fixed";
				regulator-name = "bridge_reg";
				gpio = <&reg_display 0 0>;
				vin-supply = <&reg_display>;
				enable-active-high;
			};
		};
	};

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

			reg_display: reg_display@45 {
				compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
				reg = <0x45>;
				gpio-controller;
				#gpio-cells = <2>;
			};
		};
	};

	fragment@3 {
		target = <&i2c0if>;
		__overlay__ {
			status = "okay";
		};
	};

	fragment@4 {
		target = <&i2c0mux>;
		__overlay__ {
			status = "okay";
		};
	};

	fragment@10 {
		target = <&i2c_vc>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			ft5406: ts@38 {
				compatible = "edt,edt-ft5406";
				reg = <0x38>;

				touchscreen-size-x = < 800 >;
				touchscreen-size-y = < 480 >;

				vcc-supply = <&reg_display>;
				reset-gpio = <&reg_display 1 1>;
			};
		};
	};

	fragment@11 {
		target = <&i2c0if>;
		__overlay__ {
			status = "okay";
		};
	};
};
aBUGSworstnightmare's suggestion of removing the i2c0mux means you won't be able to run two panels together. The above retains it, therefore we can communicate with both.
The touchscreen overlay needs to be resolved to apply to create unique node names for the two instances - DT isn't always simple when trying to do that kind of stuff.
As I said, for me I get both panels come up, but the one connected to DSI0 is rolling as if there is a vsync issue.
Thanks @6by9, both 5in DSI displays work simultaneously with your overlay and kernel 5.10.63. I don't think there is a vsync issue. It has been fixed? You're right we're using the display from OSOYOO. Actually we preferred to use official PI display if any. Unfortunately it seems there is only an official 7" DSI display model that it doesn't fit to our requirement. So we have to find another from the 3rd party. We know it's our own risk if will not get official support. However thanks again for your support. By the way, please keep me posted if you can get touch overlay working. Thank you.
2x-dsi.jpg
2x 5in DSI LCD
2x-dsi.jpg (66.21 KiB) Viewed 393 times

gurucafe
Posts: 7
Joined: Thu Sep 16, 2021 2:24 am

Re: Dual DSI Screens

Tue Sep 21, 2021 2:26 pm

6by9 wrote:
Tue Sep 21, 2021 1:41 pm
6by9 wrote:
Tue Sep 21, 2021 7:11 am
I do have an Osoyoo 3.5" display turning up today, so I'll see what it does. If it's simple then that's easy, but if it is fussy about power sequencing then it may be impossible to get the touch overlay working within KMS at the same time as the panel. Ho hum.
It looks like there's hope - it appears to just work even with the new driver.
Rather bizarrely it appears to respond on all I2C addresses, so you may have issues trying to run a camera or other I2C device (eg the fan controller or RTC on the CM4IO) on the same bus.
I think I'm getting same issue at my end with Osoyoo 5in DSI display. There are many I2C devices detected on I2C bus when DSI LCD is connected.
Attachments
i2c-dsi.jpg
i2c-dsi.jpg (84.68 KiB) Viewed 390 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11860
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual DSI Screens

Tue Sep 21, 2021 3:54 pm

gurucafe wrote:
Tue Sep 21, 2021 2:14 pm
Thanks @6by9, both 5in DSI displays work simultaneously with your overlay and kernel 5.10.63. I don't think there is a vsync issue. It has been fixed? You're right we're using the display from OSOYOO. Actually we preferred to use official PI display if any. Unfortunately it seems there is only an official 7" DSI display model that it doesn't fit to our requirement. So we have to find another from the 3rd party. We know it's our own risk if will not get official support. However thanks again for your support. By the way, please keep me posted if you can get touch overlay working. Thank you.
Getting touch to work means loading the same contents is in edt-ft5406.dtsi, but redirecting it to be on i2c_vc instead of i2c_csi_dsi. The touchscreen vcc-supply and reset-gpio also need to point to the right place (reg_display in that overlay).

I will be looking to generalise the overlay for disp0 or disp1, but just not quite yet.
gurucafe wrote:
Tue Sep 21, 2021 2:26 pm
6by9 wrote:
Tue Sep 21, 2021 1:41 pm
It looks like there's hope - it appears to just work even with the new driver.
Rather bizarrely it appears to respond on all I2C addresses, so you may have issues trying to run a camera or other I2C device (eg the fan controller or RTC on the CM4IO) on the same bus.
I think I'm getting same issue at my end with Osoyoo 5in DSI display. There are many I2C devices detected on I2C bus when DSI LCD is connected.
That would be a very badly implemented I2C slave interface! I don't know if yours is the same, but the back of my 3.5" panel appears to have a Lattice FPGA and an STM32F030F4 MCU on it, so probably something iffy in there.
I have a suspicion that the Lattice chip is doing DSI to DPI conversion, and just accepts whatever it is given (within reason) over DSI. It doesn't need the initialisation phase that the Toshiba bridge takes, so it's probably more forgiving over DSI states. It may not even be power gating in the same way that the Pi panel does.
I'm a little amazed that it runs the whole panel off the 3V3 line - it's generally not designed for large loads like backlights.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11860
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual DSI Screens

Thu Sep 23, 2021 12:53 pm

6by9 wrote:
Tue Sep 21, 2021 3:54 pm
I have a suspicion that the Lattice chip is doing DSI to DPI conversion, and just accepts whatever it is given (within reason) over DSI. It doesn't need the initialisation phase that the Toshiba bridge takes, so it's probably more forgiving over DSI states. It may not even be power gating in the same way that the Pi panel does.
I'm a little amazed that it runs the whole panel off the 3V3 line - it's generally not designed for large loads like backlights.
So a little playing and it does appear that this 3.5" panel doesn't need any of the MIPI DCS commands to configure it, hence other than the I2C to identify the regulator, and the control the PWM to the backlight, it is pretty much just taking the DSI video data.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

gurucafe
Posts: 7
Joined: Thu Sep 16, 2021 2:24 am

Re: Dual DSI Screens

Fri Sep 24, 2021 2:25 am

6by9 wrote:
Tue Sep 21, 2021 3:54 pm
That would be a very badly implemented I2C slave interface! I don't know if yours is the same, but the back of my 3.5" panel appears to have a Lattice FPGA and an STM32F030F4 MCU on it, so probably something iffy in there.
I have a suspicion that the Lattice chip is doing DSI to DPI conversion, and just accepts whatever it is given (within reason) over DSI. It doesn't need the initialisation phase that the Toshiba bridge takes, so it's probably more forgiving over DSI states. It may not even be power gating in the same way that the Pi panel does.
I'm a little amazed that it runs the whole panel off the 3V3 line - it's generally not designed for large loads like backlights.
@6by9 Yes, it's same for Osoyoo 5" panel, there are only three chips on PCB:- Lattice, STM32 and DC/DC. I think you're right DSI to DPI implemented in Lattice FPGA and I guess STM32 is for backlight/touchscreen function and DC/DC is for backlight.

By the way, even all I2C addresses detected on the I2C bus when DSI screen is connected. I tried to dump on each address, it seems still get correct response from FAN controller at 0x2F and RTC at 0x51. Also found the response on address 0x38, 0x2c and 0x45 (only when 5" screen connected). So I guess 0x38 is touchscreen but no idea for others? I hope I will try to make the touchscreen working on both DSI screen later. I'd appreciate if you could advise. Thank you.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11860
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual DSI Screens

Fri Sep 24, 2021 6:15 am

I already have advice on getting the touch working in viewtopic.php?p=1916140#p1916140

0x45 is the mcu for power and backlight control.
0x38 is the touchscreen controller.
I don't know about 0x2c.
Something is off in the i2c implementation even if you do appear to be able to receive back data from the other devices correctly.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Compute Module”