在设备升级新版内核后,发现没有 fb0 设备,开机没有打印 drm 相关的信息

首先是检查设备树,确认加入 panel 节点

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
panel: panel {
compatible = "lg,lb070wv8”, “simple-panel";
#address-cells = <1>;
#size-cells = <0>;
enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;

port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};

其次是检查内核是否开启了相关的驱动,这里使用的是 lichepi nano,依赖的驱动是 SUN4I 系列的驱动

1
2
3
CONFIG_DRM_SUN4I=y
CONFIG_DRM_SUN4I_HDMI=y
CONFIG_DRM_SUN4I_BACKEND=y

不过在检查完上面两个地方没有问题后,还是没有解决问题

为了获取 drm 启动过程中的更多信息,在 uboot 的 bootargs 中加入 drm.debug=0x1f debug ,让内核打印 drm 的更多信息

1
2
3
4
5
6
7
[    1.079849] [drm:drm_core_init] Initialized
[ 1.084524] [drm:sun4i_drv_probe] Adding component /soc/display-backend@1e60000
[ 1.092143] [drm:sun4i_drv_probe] Adding component /soc/lcd-controller@1c0c000
[ 1.099606] [drm:sun4i_drv_probe] Adding component /panel
[ 1.105025] [drm:sun4i_drv_traverse_endpoints] No output to bind on port 1
[ 1.124695] [drm:compare_of] Comparing of node /soc/lcd-controller@1c0c000 with /soc/display-backend@1e60000
...

发现内核尝试着挂载 /panel 节点,这个本来是不用挂载的

修改 suniv_quirks,加上 has_channel_0 的配置。缺少 has_channel_0 会让内核认为这个 TCON 没有 RGB 口

1
2
3
4
static const struct sun4i_tcon_quirks suniv_quirks = {
.has_channel_0 = true,
.has_channel_1 = true,
};

重新编译烧录后,drm 的启动信息如下。内核没有再去挂载 /panel 节点了,不过 drm 的启动还是没有成功

1
2
3
4
5
6
[    1.079943] [drm:drm_core_init] Initialized
[ 1.084616] [drm:sun4i_drv_probe] Adding component /soc/display-backend@1e60000
[ 1.092235] [drm:sun4i_drv_probe] Adding component /soc/lcd-controller@1c0c000
[ 1.099662] [drm:sun4i_drv_traverse_endpoints] Endpoint is our panel... skipping
[ 1.121843] [drm:compare_of] Comparing of node /soc/display-backend@1e60000 with /soc/display-backend@1e60000
[ 1.131931] [drm:compare_of] Comparing of node /soc/display-backend@1e60000 with /soc/lcd-controller@1c0c000

后来在看到了这份 commit中说的内容,将 .has_channel_1 屏蔽掉,drm 正常工作了

1
2
3
4
5
6
7
8
static const struct sun4i_tcon_quirks suniv_f1c100s_quirks = {
/*
* The F1C100s SoC has a second channel in TCON, but the clock input of
* it is not documented.
*/
.has_channel_0 = true,
/* .has_channel_1 = true, */
};

感谢

非常感谢这两位大神给我的帮助