问题:根据官网LCD使用修改5寸屏幕不显示 Android SDK下载来源:(成功完成公版编译HDMI和MIPI_DSI 10.1寸屏) 依据官网LCD使用进行配置:主要修改了以下两个文件(kernel/arch/arm64/boot/dts/rockchip/rk3566-roc-pc-mipi101_M101014_BE45_A1.dts和kernel/drivers/gpu/drm/panel/panel-simple.c) 迁移屏幕参数如下: Display resolution:720*1280 params->dsi.vertical_sync_active=6 params->dsi.vertical_backporch=10 params->dsi.vertical_frontporch=20 params->dsi.horizontal_sync_active=6 params->dsi.horizontal_backporch=20 params->dsi.horizontal_frontporch=50 params->RGB_CLOCK=(63) 【MHZ】 Frame Rate=60HZ dsi,lanes = <4> 屏幕要求:HS,VSH是低脉冲有效,DE是高有效 pixelclk-active:0(上升沿锁存数据) RESET要用单独的GPIO来提供,其波形要满足下图的要求 接下来将依据官网LCD使用文档进行修改 (https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/driver_lcd.html) 引脚配置: 首先,屏幕没有enable-io,所以enable-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;【gpio 0没有接线】 然后将转接板Reset端口为13 对应在kernel/include/dt-bindings/pinctrl/rockchip.h找到端口RK_PB5 所以端口reset-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>; 背光配置 修改kernel/arch/arm64/boot/dts/rockchip/rk3566-roc-pc-mipi101_M101014_BE45_A1.dts: 背光仅修改了enable-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; 显示时序配置 Power on/off sequence 上下电时序: 修改kernel/drivers/gpu/drm/panel/panel-simple.c: 根据上图屏幕上下电时序要求: 在 panel_simple_prepare方程中(reset-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>;): reset-gpios首先被拉高:gpiod_direction_output(p->reset_gpio, 0); 接着延迟1ms:panel_simple_sleep(p->desc->delay.reset); 然后再拉低:gpiod_direction_output(p->reset_gpio, 1); 再接着延迟10ms:panel_simple_sleep(p->desc->delay.init); 然后再拉高:gpiod_direction_output(p->reset_gpio, 0); 最后延迟120ms: panel_simple_sleep(12*(p->desc->delay.init)); 开始initial code: if (p->desc->init_seq) { if (p->dsi) panel_simple_xfer_dsi_cmd_seq(p, p->desc->init_seq); else if (p->cmd_type == CMD_TYPE_SPI) err = panel_simple_xfer_spi_cmd_seq(p, p->desc->init_seq); if (err) dev_err(panel->dev, "failed to send init cmds seq\n"); } if(p->desc->delay.mipi_data){ panel_simple_sleep(p->desc->delay.mipi_data); } p->prepared = true; 接着修改kernel/arch/arm64/boot/dts/rockchip/rk3566-roc-pc-mipi101_M101014_BE45_A1.dts: 节点信息更新 dsi0_panel: panel@0 { status = "okay"; compatible = "simple-panel-dsi"; reg = <0>; backlight = <&backlight>; reset-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>; enable-on-always = <0>; enable-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; //根据panel-simple.c文件里的panel_simple_prepare方程的改写:先拉高reset delay 1ms 然后拉低reset delay 10ms 最后拉高12*10 = 120ms reset-delay-ms = <1>; init-delay-ms = <10>; size,width = <120>; size,height = <170>; dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>; dsi,format = <MIPI_DSI_FMT_RGB888>; dsi,lanes = <4>; 接着将屏幕初始化指令转换成rk的命令格式 (多次检查确保转换没有问题) Display-Timings 修改kernel/arch/arm64/boot/dts/rockchip/rk3566-roc-pc-mipi101_M101014_BE45_A1.dts: 根据屏幕参数 Display resolution:720*1280 params->dsi.vertical_sync_active=6 params->dsi.vertical_backporch=10 params->dsi.vertical_frontporch=20 params->dsi.horizontal_sync_active=6 params->dsi.horizontal_backporch=20 params->dsi.horizontal_frontporch=50 params->RGB_CLOCK=(63) 【MHZ】 Frame Rate=60HZ dsi,lanes = <4> 屏幕要求:HS,VSH是低脉冲有效,DE是高有效 pixelclk-active:0(上升沿锁存数据) 配置为1:上升沿驱动像素数据/下降沿采样数据 配置为0:下降沿驱动像素数据/上升沿采样数据 以上为修改的地方,按照步骤可复现问题,请问能帮我看看问题出在哪里吗?谢谢! |
-
17.4 KB, 下载次数: 0, 下载积分: 灯泡 -1 , 经验 -1