MIPI Driver Configuration

Enable MIPI in Kernel menuconfig

  1. Under the root directory of freelight-u-sdk, run the following command to enter the kernel menu configuration GUI.
    make linux-menuconfig
  2. Enter the Device Drivers menu.

  3. Enter the Graphics support menu.

  4. In the Graphics support menu, select the DRM Support option.

  5. In the Graphics support menu, select the Starfive MIPI DSI Select option.

  6. To enable the M31 DPHY, go back to Device Drivers menu, enter the PHY Subsystem menu, and select the Starfive M31 MIPI DPHY TX Driver option.

  7. Save your change and exit the kernel configuration dialog.

Enable modetest in menuconfig

Enable the Install Test Programs in the kernel configuration so that you can use the modetest tool in the kernel for testing.

  1. Under the root directory of freelight-u-sdk, type the following command to enter the kernel menu configuration GUI.

    make buildroot_initramfs-menuconfig
  2. Enter the Target packages > Libraries > libdrm menu.

  3. Select the Install test programs option, or you may select ALL options under this menu.
    Figure 1. Install Test Programs

    Result: After you have completed all the above configuration, you can use the modetest tool in kernel for testing.

  4. Save your change and exit the kernel configuration dialog.

Enable/Disable MIPI at Board Level

In the jh7110-common.dtsi file, you can enable or disable MIPI at the board level which overrides the corresponding settings at the SoC level which is defined in the jh7110.dtsi file.

The following code example enables MIPI DSI controller at the board level:
linux/arch/riscv/boot/dts/starfive/jh7110-common.dtsi:
&mipi_dsi {
	status = "okay";
};
The following code example enables MIPI DPHY at the board level:
linux/arch/riscv/boot/dts/starfive/jh7110-common.dts:
&mipi_dphy {
	status = "okay";
};

Configure MIPI DSI Port at Board Level

To activate and fully utilize the DSI controller’s output port for display, a matching MIPI DSI panel device node must be defined and connected through the Device Tree OF graph binding.

This procedure demonstrates how to attach a MIPI DSI panel as an I2C slave and establish the cross-file graph connection between the panel and the DSI controller output port.

Enable and tune the I2C2 bus in jh7110-common.dts, and then declare the Seeed DSI panel as its I2C slave child node. The panel’s endpoint references the pre-defined dsi_out_port from jh7110.dtsi, forming one half of the bidirectional display pipeline link (DSI TX output to panel input).
// jh7110-common.dts (board-level DTS)
&i2c2 {
	clock-frequency = <100000>;
	i2c-sda-hold-time-ns = <300>;
	i2c-sda-falling-time-ns = <510>;
	i2c-scl-falling-time-ns = <510>;
	auto_calc_scl_lhcnt;
	pinctrl-names = "default";
	pinctrl-0 = <&i2c2_pins>;
	status = "okay";

	// Board-defined MIPI DSI panel I2C slave node
	seeed_plane_i2c@45 {
		compatible = "seeed_panel";
		reg = <0x45>; // I2C slave address of panel controller IC
       // Panel input endpoint to connect DSI output port
		port {
			panel_dsi_port: endpoint {
				remote-endpoint = <&dsi_out_port>;
			};
		};
The complete bidirectional cross-reference spans two files:
  • Board file (jh7110-common.dts): Panel endpoint points to DSI output &dsi_out_port
  • SoC header (jh7110.dtsi): The MIPI DSI controller’s output endpoint pre-declares the reverse reference remote-endpoint = <&panel_dsi_port>.

Seeed Panel Driver API Reference

Enable, disable, or obtain seeed panel information using the following API.

Table 1. Panel API
Function Description Prototype
seeed_panel_enable Initializes the DSI link and lane configuration, enables the LCD power supply, and turns on the backlight.
static int seeed_panel_enable(struct drm_panel *panel)
seeed_panel_disable Disables the LCD power supply and turns off the backlight.
static int seeed_panel_disable(struct drm_panel* panel)
seeed_panel_get_modes Gets registration information of panel.
static int seeed_panel_get_modes(struct drm_panel* panel, struct drm_connector* connector)