St7789v tft display bring up on colibri imx7d

Hi @henrique.tx,

what do you intend with “you do not have the power-supply property in the SPI panel node”? In any case, at the moment I switch on the display with “gpio set 54”, from u-boot…

Also, in the device tree example, graph logic is used. you should also try using that.

I tried also with this, in my device tree:

&iomuxc {	
	pinctrl_disp_gpio: disp_gpio_muxgrp {
		fsl,pins = <
			MX7D_PAD_ECSPI2_SS0__GPIO4_IO23      0x14  // DIS_RST   @ SODIMM 65
			MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2  0x14  // DIS_D/CX  @ SODIMM 63
		>;
	};
};

&ecspi3 {
	// Enable the SPI controller
	status = "okay";
	
	// needed to avoid dtc warning
	#address-cells = <1>;
	#size-cells = <0>;

	mcp2515: can@0 {
		compatible = "microchip,mcp2515";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can_int>;
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio5>;
		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <10000000>;
		status = "disabled";
	};

	spidev0: spidev@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <23000000>;
		status = "disabled";
	};

	display: panel@0 {
		compatible = "sitronix,st7789v";
		
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_disp_gpio>;		
		
		reg = <0>;
		
		reset-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
		dc-gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
		backlight = <&pwm1>;
		spi-max-frequency = <100000>;
		spi-cpol;
		spi-cpha;

//		port {
//			panel_input: endpoint {
//				remote-endpoint = <&tcon0_out_panel>;
//			};
//		};
	
		width = <320>;
		height = <240>;
		buswidth = <8>;  // Most controllers use this value

		// This is a hack to prevent fb_s6d02a1.c:set_var() from issuing
		// command 0x36 after the init sequence has been applied and thus
		// changing the config.
		rotate = <1>;
		
		debug = <0x4000000>;  // Print init commands to the kernel log

		status = "okay";	
	};
};

but the result is the same: no fb0 interface in /dev…

Did you check if there is any other SPI device with reg=<0>?

Yes, I disabled all spi device on ecspi3 (spidev and can), as you can see on my imx7d-colibri-emmc-eval-v3.dts

Please share the dmesg output when trying to boot with this SPI panel enabled.

this is what happens in dmesg about spi, the problem it seems related to spi probe by the fb7789v driver, but I don’t understand why, because this is work when I use the driver like module:

CSFreedomX:~# dmesg | grep spi
[    1.003941] spi_imx 30840000.ecspi: can't get the TX DMA channel, error -19!
[    1.003952] spi_imx 30840000.ecspi: dma setup error -19, use pio
[    1.010313] spi_imx 30840000.ecspi: registered master spi2
[    1.010491] spi spi2.0: spi_imx_setup: mode 3, 8 bpw, 100000 hz
[    1.010508] spi spi2.0: setup mode 3, 8 bits/w, 100000 Hz max --> 0
[    1.010766] spi_imx 30840000.ecspi: registered child spi2.0
[    1.010774] spi_imx 30840000.ecspi: probed
[    1.504974] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.629283] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.629500] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.629710] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.629909] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.630622] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.630823] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.631024] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.631224] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.631554] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.631754] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.631955] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.632155] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.632356] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.632557] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.632758] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.632958] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.633160] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.633360] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.633689] spi_imx 30840000.ecspi: mx51_ecspi_clkdiv: fin: 60000000, fspi: 100000, post: 6, pre: 9
[    1.643345] fb_st7789v: probe of spi2.0 failed with error -22
SCSFreedomX:~#

In any case I attached the whole dmesg output:
boot.txt (20.1 KB)

This is what happen in dmesg when I use the driver as module:
boot_as_mdule.txt (43.8 KB)

I also tried to delay (with “mdelay(3000)”) the init_display function in fb_st7789v.c, but the result is the same…

I’m really astonished about the behaviour of this kind of display… :((((

Any suggestion, test or idea is really appreciated!

Thank you very much!

Valerio