转载地址: http://greedyhao.cc/2019/07/26/工作-Linux-2019-07-26-drm设备不工作/
日期: 2019-07-26
作者: greedyhao
离线
在设备升级新版内核后,发现没有 fb0 设备,开机没有打印 drm 相关的信息
首先是检查设备树,确认加入 panel 节点
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 系列的驱动
CONFIG_DRM_SUN4I=y
CONFIG_DRM_SUN4I_HDMI=y
CONFIG_DRM_SUN4I_BACKEND=y
不过在检查完上面两个地方没有问题后,还是没有解决问题
为了获取 drm 启动过程中的更多信息,在 uboot 的 bootargs 中加入 drm.debug=0x1f debug,让内核打印 drm 的更多信息
[ 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 口
static const struct sun4i_tcon_quirks suniv_quirks = {
.has_channel_0 = true,
.has_channel_1 = true,
};
重新编译烧录后,drm 的启动信息如下。内核没有再去挂载 /panel 节点了,不过 drm 的启动还是没有成功
[ 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 正常工作了
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, */
};
感谢
非常感谢这两位大神给我的帮助
Icenowy
libunko
离线
原来是这样, 当初按这个没有搞定: https://whycan.cn/t_2032.html
离线
好消息
离线
标记一下 在 uboot 的 bootargs 中加入 drm.debug=0x1f debug,让内核打印 drm 的更多信息
离线
标记一下
离线
离线
标记一下,后面用的到
离线
标记一下,先切换到4.19去折腾下usb otg
离线
我就想要个usb能用的,到底要用哪个版本?不折腾的,拉下来,编译下就能用的
离线
@晕哥
楼主,我用licheepi zero(V3S)。在主线5.19.3的内核中尝试初始化LCD的时候,也遇到了fb0设备不出现的问题。
按照你的方法打印了drm的初始化log
[ 0.056344] [drm:0xc070eda1] Initialized
[ 0.056506] [drm:0xc02a4577] Adding component /soc/mixer@1100000
[ 0.056609] [drm:0xc02a4577] Adding component /soc/lcd-controller@1c0c000
[ 0.056676] [drm:0xc02a43ff] Endpoint is our panel... skipping
[ 0.060684] panel-simple panel: supply power not found, using dummy regulator
[ 0.060947] panel-simple panel: Specify missing connector_type
能帮着分析一下是什么原因导致的吗?还是说V3S DE设备的初始化只能在v5.2内核版本下工作?
吊诡的是,panel设备不出现,对应的backlight设备也没有出现在设备树当中。
我用的dts文件是参照licheepi zero官方的修改而来,官方的内核版本是v5.2
[ backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 1000000 0>;
brightness-levels = <0 30 40 50 60 70 100>;
default-brightness-level = <6>;
};
panel: panel {
compatible = "urt,umsh-8596md-t", "simple-panel";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
backlight = <&backlight>;
#address-cells = <1>;
#size-cells = <0>;
panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};
&de {
status = "okay";
};
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pins>;
status = "okay";
};
&tcon0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins_a>;
status = "okay";
};
&tcon0_out {
tcon0_out_lcd: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_input>;
};
};
]
官方的v5.2版本,fb设备初始化成功的时候,还有下面的打印信息,我这边就没有
[
[ 1.259771] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 1.272296] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc0773d40)
[ 1.279881] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc07 7103c)
[ 1.287569] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.294258] [drm] No driver support for vblank timestamp query.
[ 1.301264] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on
]
最近编辑记录 wuyu (2022-11-17 18:09:15)
离线