rk3288w android9.0 MIPI屏幕

2020/12/09 21:19:29

Rockchip显示操作---MIPI屏幕

uboot驱动

/*核心驱动*/
drivers/video/drm/rockchip_display.c
drivers/video/drm/rockchip_panel.c
/*MIPI-DSI*/
drivers/video/drm/rockchip_mipi_dsi.c
drivers/video/drm/rockchip-dw-mipi-dsi.c
/*Panel*/
drivers/video/drm/rockchip_dsi_panel.c
drivers/video/drm/panel_simple.c

接口说明

  1. void rockchip_show_logo(void)
    显示uboot logo和kernel logo
  2. void rockchip_show_bmp(const char *bmp)
    显示指定的bmp图片,目前只要用于uboot logo充电的显示
  3. rockchip_display_fixup(void *blob)
    将uboot中确定的一些变量通过dtb文件传递给内核,包括kernel logo的大小,地址,格式,输出扫描时序以及过扫描的配置等信息

kernel 驱动

driver/gpu/drm/panel/panel_simple.c
  1. 驱动一般不需要更改,但需注意函数static int panel_simple_prepare(struct drm_panel *panel)需要与屏幕规格书中保持一致
  2. dts配置如下参考
&dsi0 {
   
	status = "okay";
	rockchip,lane-rate = <750>;

	panel: panel {
   
		compatible = "simple-panel-dsi";
		reg = <0>;
		backlight = <&backlight>;
		enable-gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM)>;
		dsi,format = <MIPI_DSI_FMT_RGB888>;
		dsi,lanes = <4>;
		reset-delay-ms = <50>;
		init-delay-ms = <120>;
		enable-delay-ms = <50>;
		prepare-delay-ms = <50>;
		status = "okay";

		panel-init-sequence = [
			29 00 04 FF 98 81 03
			13 00 02 cb 63
			13 00 02 cc 18
			13 00 02 cd 16
			13 00 02 ce 4d
			13 00 02 cf 1f
			13 00 02 d0 2a
			13 00 02 d1 4f
			13 00 02 d2 5f
			13 00 02 d3 39
			29 00 04 ff 98 81 00
			05 78 01 11
			05 14 01 29
		];

		panel-exit-sequence = [
			05 14 01 28
			05 78 01 10
		];

		disp_timings: display-timings {
   
			native-mode = <&timing0>;

			timing0: timing0 {
   
				clock-frequency = <68800000>;
				hactive = <800>;
				vactive = <1280>;
				hback-porch = <20>;
				hfront-porch = <20>;
				vback-porch = <20>;
				vfront-porch = <30>;
				hsync-len = <20>;
				vsync-len = <4>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <0>;
				pixelclk-active = <0>;
			};
		};
	};
};

&route_dsi0 {
   
	status = "okay";
};

&dsi0_in_vopl {
   
	status = "okay";
};

&dsi0_in_vopb {
   
	status = "disabled";
};

panel-init-sequence中的29,13,05表示包名,一般为39,15,05,具体情况需要看屏幕规格书

常用的debug手段

cat d/dri/0/summary
查看vop的打开在状态以及屏幕接口
cat /sys/kernel/debug/gpio
查看gpio状态,确认gpio配置是否正常

第一次发表文章,也不知道怎么写比较合适,若有缘看见,望指正