Device Tree configuration

A DTS/DTSI file is used to store all the device tree configuration.

The device tree of MIPI LCD is stored in the following path:

linux-5.10/arch/riscv/boot/dts/starfive/
The following code block shows the DTS file structure for MIPI LCD.
linux-5.15.0
└-- arch
└-- | -- riscv
| -- | -- | -- boot
| -- | -- | -- | -- dts
| -- | -- | -- | -- | -- starfive
| -- | -- | -- | -- | -- | -- jh7110-common.dtsi
| -- | -- | -- | -- | -- | -- jh7110.dtsi

MIPI DSI

In the file jh7110.dtsi, you can find the device tree configuration of MIPI DSI as the following code block:
linux/arch/riscv/boot/dts/starfive/jh7110.dtsi:
		 mipi_dsi: mipi@295d0000 {
			compatible = "starfive,jh7110-mipi_dsi","cdns,dsi";
			reg = <0x0 0x295d0000 0x0 0x10000>;
			interrupts = <98>;
			reg-names = "dsi";
			clocks = <&clkvout JH7110_U0_CDNS_DSITX_CLK_SYS>,
				 <&clkvout JH7110_U0_CDNS_DSITX_CLK_APB>,
				 <&clkvout JH7110_U0_CDNS_DSITX_CLK_TXESC>,
				 <&clkvout JH7110_U0_CDNS_DSITX_CLK_DPI>;
			clock-names = "sys", "apb", "txesc", "dpi";
			resets = <&rstgen RSTN_U0_CDNS_DSITX_DPI>,
				 <&rstgen RSTN_U0_CDNS_DSITX_APB>,
				 <&rstgen RSTN_U0_CDNS_DSITX_RXESC>,
				 <&rstgen RSTN_U0_CDNS_DSITX_SYS>,
				 <&rstgen RSTN_U0_CDNS_DSITX_TXBYTEHS>,
				 <&rstgen RSTN_U0_CDNS_DSITX_TXESC>;
			reset-names = "dsi_dpi", "dsi_apb", "dsi_rxesc",
					"dsi_sys", "dsi_txbytehs", "dsi_txesc";
			phys = <&mipi_dphy>;			
                       phy-names = "dphy";
			status = "disabled";

			port {
				dsi_out_port: endpoint@0 {
					remote-endpoint = <&panel_dsi_port>;
				};
				dsi_in_port: endpoint@1 {
					remote-endpoint = <&mipi_out>;
				};
			};

			mipi_panel: panel@0 {
				/*compatible = "";*/
				status = "okay";
			};
		};	

linux/arch/riscv/boot/dts/starfive/jh7110-common.dtsi:

&mipi_dsi {
	status = "okay";
};
The following list provides explanations for the parameters included in the above code block.
  • compatible: Compatibility information, used to associate the driver and its target device.
  • reg: Register base address "0x295d0000" and range "0x10000".
  • interrupts: Hardware interrupt ID.
  • reg-name: The name of the above register.
  • clocks: The clocks used by the LCD module.
  • clock-names: The names of the above clocks.
  • resets: The reset signals used by the LCD module.
  • reset-names: The names of the above reset signals.
  • phys: The phys used by the LCD module.
  • phy-names: The name of the phys.
  • status: The work status of the LCD module. To enable the module, set this bit as "okay" or to disable the module, set this bit as "disabled".
  • port: The port(s) used by the LCD driver.

MIPI DPHY

In the file jh7110.dtsi, you can find the device tree configuration of MIPI DPHY as the following code block:
linux/arch/riscv/boot/dts/starfive/jh7110.dts:
		mipi_dphy: mipi-dphy@295e0000{
			compatible = "starfive,jh7110-mipi-dphy-tx","m31,mipi-dphy-tx";
			reg = <0x0 0x295e0000 0x0 0x10000>;
			clocks = <&clkvout JH7110_U0_MIPITX_DPHY_CLK_TXESC>;
			clock-names = "dphy_txesc";
			resets = <&rstgen RSTN_U0_MIPITX_DPHY_SYS>,
				 <&rstgen RSTN_U0_MIPITX_DPHY_TXBYTEHS>;
			reset-names = "dphy_sys", "dphy_txbytehs";
			#phy-cells = <0>;
			status = "disabled";
		};
linux/arch/riscv/boot/dts/starfive/jh7110-common.dts:
&mipi_dphy {
	status = "okay";
};
The following list provides explanations for the parameters included in the above code block.
  • compatible: Compatibility information, used to associate the driver and its target device.
  • reg: Register base address "0x295e0000" and range "0x10000".
  • clocks: The clocks used by the LCD module.
  • clock-names: The names of the above clocks.
  • resets: The reset signals used by the LCD module.
  • reset-names: The names of the above reset signals.
  • status: The work status of the LCD module. To enable the module, set this bit as "okay" or to disable the module, set this bit as "disabled".

I2C2

In the file jh7110-common.dtsi, in order to configure LCD DTS port, the seeed_panel dts port should be added into i2c2. You can find the device tree configuration of i2c2 as the following code block:
linux/arch/riscv/boot/dts/starfive/jh7110-common.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";

	seeed_plane_i2c@45 {
		compatible = "seeed_panel";
		reg = <0x45>;

		port {
			panel_dsi_port: endpoint {
				remote-endpoint = <&dsi_out_port>;
			};
		};
	};

};

In the above code block, the parameters of pinctrl-names and pinctrl-0 are used to configure the i2c2 pin configuration settings.