我实际上需要一些帮助来定义内核/linux DTS 文件并将其与 uboot videoargs 一起使用。
使用的是来自 NXP imx8m YOCTO 项目的 5.4.47 uboot 和 kernel/linux。
在 uboot 中,我已经可以使用 5 个不同的 MIPI DSI 显示面板和 nxp 的 HDMI 适配器。为了在 uboot 中配置显示类型,我使用 video_link 环境变量。这对我来说效果很好,并且可以轻松扩展和配置。为了完成这项工作,我的 uboot DTS 如下所示:
#include <dt-bindings/usb/pd.h>
#include "imx8mm.dtsi"
/ {
model = "My own board";
compatible = "fsl,imx8mm-evk", "fsl,imx8mm";
.
.
.
dsi_host: dsi-host {
compatible = "samsung,sec-mipi-dsi";
status = "okay";
};
01_panel {
compatible = "mydisplay,01_display";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <67>;
panel-height-mm = <121>;
status = "okay";
port {
01_from_dsim: endpoint {
remote-endpoint = <&dsim_to_01>;
};
};
};
02_panel {
compatible = "mydisplay,02_display";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <67>;
panel-height-mm = <121>;
status = "okay";
port {
02_from_dsim: endpoint {
remote-endpoint = <&dsim_to_02>;
};
};
};
.
.
.
};
.
.
.
&mipi_dsi {
status = "okay";
port@1 {
dsim_to_adv7535: endpoint {
remote-endpoint = <&adv7535_from_dsim>;
};
};
port@2 {
dsim_to_01: endpoint {
remote-endpoint = <&01_from_dsim>;
};
};
port@3 {
dsim_to_02: endpoint {
remote-endpoint = <&02_from_dsim>;
};
};
.
.
.
};
当然,现在我想在 kernel/linux 中使用相同的显示。我首先从 uboot DTS 文件中尝试了与上面相同的 DTS 结构。我还使用了以下 kernel/linux DTS 配置:
#include "imx8mm.dtsi"
/ {
model = "My own board";
compatible = "fsl,imx8mm-flunder", "fsl,imx8mm";
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
rpmsg_reserved: rpmsg@0xb8000000 {
no-map;
reg = <0 0xb8000000 0 0x400000>;
};
};
.
.
.
};
.
.
.
&mipi_dsi {
status = "okay";
port@1 {
dsim_to_adv7535: endpoint {
remote-endpoint = <&adv7535_from_dsim>;
};
};
panel@0 {
compatible = "mydisplay,01_display";
pinctrl-names = "default";
reg = <0>;
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <62>;
panel-height-mm = <110>;
status = "okay";
};
panel@1 {
compatible = "mydisplay,02_display";
pinctrl-names = "default";
reg = <0>;
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <62>;
panel-height-mm = <110>;
status = "okay";
};
};
.
.
.
第二个变体以在内核引导时使用面板 0 结束。但在这两个变体中,我无法从 uboot 端告诉内核/linux 我想使用哪个显示器。
作为 uboot 端的 boot- 或 videoargs,我测试了许多变体,但没有成功。
您可以在此处看到一个简短的示例列表:
video=imx-drm:720x1280@60
primary_display=imx-drm
video=DSI-1:dev=01,720x1280@60
video=mxcfb0:dev=ldb,01_panel,if=RGB24
video=mxcfb0:dev=mipi_dsi,01_panel,if=RGB24
video=DSI-1:dev=01_panel
video=mxcfb0:dev=mipi_dsi,720x1280M@60,if=RGB24
video=mxcfb0:dev=ldb,720x1280M@60,if=RGB24
video=DSI-1:720x1280@60
在我看来,第一个配置(就像我在 uboot 中使用的那样)是正确的,但我最后提出了以下问题:
对于多个 MIPI DSI 显示器,如何正确配置内核/linux DTS 文件?
在启动时如何告诉内核它必须使用哪个显示器?