Page 1 of 1

MIPI DBI/ST7789

Posted: 2026-05-27 1:12
by nobuddy2012

I know I'm asking for a lot of trouble here, but I'll ask anyway.

I see that, out-of-box, Luckfox Lyra has support for a few DSI displays -- a few more than Raspberry Pi has (wink). However, I'm trying to use something physically smaller than 2.8". I have a few ST7789s lying around, and I know for a fact they will work with the Linux "panel" driver over SPI.

What I am looking for in the way of information:

  1. Which DTS do I modify, if any, to set the chip up so it looks for the display on SPI0.0? SEE BELOW

  2. How do I properly remove the overlay that keeps removing my kernel driver config to include the panel driver, instead of modifying said overlay? SEE BELOW

  3. Where do I configure the display parameters, knowing that Luckfox doesn't have a "config.txt" in the same way that Raspberry Pi does?IGNORE THIS

Thanks

**UPDATE**

While poking around, I managed to get the driver to register, but I'm still having trouble getting the signals to actually output from the module. This is what I have done so far:

  • Modified rk3506-display.config (I'm not sure how to prevent this from overriding my kernel config):

    Code: Select all

    CONFIG_DRM_PANEL_MIPI_DBI=m
    
  • Added to rk3506-luckfox-lyra.dtsi:

    Code: Select all

    &spi0 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&rm_io7_spi0_clk &rm_io6_spi0_mosi &rm_io5_spi0_miso &rm_io4_spi0_csn0>;
    
    	dbi_panel: panel@1 {
    		compatible = "panel", "panel-mipi-dbi-spi";
    		reg = <0>;
    		spi-max-frequency = <40000000>;
    		dc_gpios=<&gpio0 RK_PA3 0>;
    		reset_gpios=<&gpio0 RK_PA2 0>;
    		backlight=<&gpio1 RK_PD3 0>;
    		width-mm = <33>;
    		height-mm = <33>;
    		write-only;
    		panel-timing {
    			hactive = <240>;
    			vactive = <240>;
    			hback-porch = <0>;
    			vback-porch = <0>;
    
    			clock-frequency = <0>;
    			hfront-porch = <0>;
    			hsync-len = <0>;
    			vfront-porch = <0>;
    			vsync-len = <0>;
    		};
    	};
    
    };
    
  • added the appropriate firmware for my ST7789 display, per https://github.com/notro/panel-mipi-dbi/wiki

Any pointers on how to get the SPI and GPIO up and running would be appreciated. The driver isn't throwing any errors in `dmesg` so I'm imagining I must have the pin configuration wrong somehow.


Re: MIPI DBI/ST7789

Posted: 2026-05-28 2:32
by Crocodile
  1. Modify the DTS file corresponding to your board form factor, enable spi0, and configure the relevant pins and driver. If you need to use the SPI display as a framebuffer, you may refer to this device tree configuration (using the FBTFT driver). As for the tinydrm driver you mentioned, I have not used it before, and I am unsure whether it will conflict with Rockchip's driver (which requires the display to be bound to a VOP).

    Code: Select all

    /**********spi0**********/
    &spi0 {
    	status = "okay";
    	pinctrl-0 = <&rm_io1_spi0_clk &rm_io4_spi0_mosi &rm_io3_spi0_csn0>;
    	#address-cells = <1>;
    	#size-cells = <0>;
    
    	fbtft@0{
    		status = "okay";
    		compatible = "sitronix,st7789v";
    		reg = <0>;
    		spi-max-frequency = <50000000>;
    		fps = <60>;
    		buswidth = <8>;
    		debug = <0x7>;
    		dc-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;      //DC
    		reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;    //RES
    	};
    };
  2. After running ./build.sh config, select Kernel and set the defconfig fragments to empty. This will prevent the kernel configuration from being overwritten.
  3. config.txt is a mechanism specific to the Raspberry Pi. On the Luckfox Lyra, the initialization sequence and resolution must be properly configured directly in the driver source code.