1. 簡介
- 本文是基于RK3588平臺,SDK版本:RK3588_ANDROID12.0 RK628D調(diào)試總結(jié)。
- 視頻橋接芯片:RK628D
- 驅(qū)動代碼:"kernel-5.10driversmisc
k628"(驅(qū)動用的是rk628-for-all-v21版本) - 本次調(diào)試的方案功能:從SOC出來的HDMITX通過RK628D轉(zhuǎn)成雙路LVDS信號接LVDS屏幕。
2. 視頻橋接芯片RK628D調(diào)試
2.1 RK628驅(qū)動介紹
RK628 分為 Display 通路和 HDMI IN 通路,SDK 版本 Display 通路基于DRM框架,HDMI IN 通路基于
V4L2框架。
RK628-For-All 版本驅(qū)動一樣也分為Display 通路和 HDMI IN 通路,Display 通路的驅(qū)動于drivers/misc/rk628/
下,HDMI IN 通路的驅(qū)動于drivers/media/i2c/rk628/下。本文采用RK628-For-All 版本Display 通路:MISC
2.2 調(diào)試總覽,調(diào)試步驟分析
- 步驟 ① 移植RK628D_For_All_V21的驅(qū)動代碼
- 步驟 ② dts配置
- 步驟 ③ 編譯,燒寫。
2.3 調(diào)試過程
- 步驟 ① :移植RK628D_For_All_V21的驅(qū)動代碼
1.聯(lián)系RK業(yè)務(wù)拿到最新的RK628-for-all版本代碼 。
本文是基于RK628-for-all-v21版本。要移植RK628D_For_All的驅(qū)動代碼。
采取手動打補丁的方式移植:因為自動打補丁會因為SDK版本差異,代碼不一致導(dǎo)致報錯。
2.rockchip_defconfig,Kconfig,Makefile配置
rockchip_defconfig配置 :關(guān)閉SDK系統(tǒng)自帶的rk628d配置,開啟rk628-for-all版本的配置:
CONFIG_DRM=y(系統(tǒng)默認是打開)
CONFIG_RK628_MISC=y
CONFIG_ROCKCHIP_THUNDER_BOOT_RK628=y
(下面兩項在"kernel-5.10driversmisc
k628Kconfig"已經(jīng)默認設(shè)置為y了,可以不用在rockchip_defconfig中再配置)
MISC配置如下 :
將rk628驅(qū)動添加進編譯規(guī)則。
Kconfig配置 :添加 source "drivers/misc/rk628/Kconfig"
Kconfig路徑 :"kernel-5.10driversmiscKconfig"
Makefile配置 :添加 obj-y += rk628/
Makefile路徑 :"kernel-5.10driversmiscKconfig"
rk628-for-all版本驅(qū)動配置如下:
Kconfig配置 :添加 config RK628_MISC 和 config ROCKCHIP_THUNDER_BOOT_RK628說明
Kconfig路徑 :"kernel-5.10driversmisc
k628Kconfig"
Makefile配置 :添加RK628_MISC驅(qū)動和obj-$(CONFIG_DRM) += rk628_hdmitx.o
Makefile路徑 :"kernel-5.10driversmisc
k628Makefile"
3.驅(qū)動手動打補?。?/strong>
① 將rk628文件夾復(fù)制到"kernel-5.10driversmisc
k628"
② kernel-5.10driversgpu hdmi強制輸出固定分辨率 繞過讀edid流程
kernel-5.10\\drivers\\i2c 提前i2c設(shè)備的注冊 以加快rk628的初始化
kernel-5.10\\drivers\\base 增加宏主要是為了實現(xiàn)regmap文件結(jié)點可以寫628寄存器
kernel-5.10\\drivers\\pwm 提前pwm設(shè)備的注冊 以加快rk628的初始化
kernel-5.10\\drivers\\video 提前backlight設(shè)備的注冊 以加快rk628的初始化
注意: driversgpudrmridgesynopsysdw-hdmi-qp.c 此c文件的第一組分辨率改成你要固定的分辨率 1920*1080
- 步驟 ② dts配置
- rk628-for-all的dts配置
&i2c6 {
//clock-frequency = < 400 >;
pinctrl-names = "default";
pinctrl-0 = < &i2c6m0_xfer >;
status = "okay";
rk628: rk628@50 {
compatible = "rockchip,rk628";
reg = < 0x50 >;
interrupt-parent = < &gpio4 >;
interrupts = < 22 IRQ_TYPE_LEVEL_HIGH >;
//pinctrl-names = "default";
//pinctrl-0 = < &rk628power >;
enable-gpios = < &gpio4 RK_PD5 GPIO_ACTIVE_HIGH >;
reset-gpios = < &gpio2 RK_PB6 GPIO_ACTIVE_LOW >;
//panel-enable-gpios = < &gpio2 RK_PC1 GPIO_ACTIVE_HIGH >;
panel-backlight = < &backlight_lvds >;
status = "okay";
rk628,hdmi-in;
rk628-lvds{
/* "jeida_18","vesa_24","vesa_18" */
bus-format = "vesa_24";
//bus-format = "jeida_18";
/* "dual_link_odd_even_pixels"
* "dual_link_even_odd_pixels"
* "dual_link_left_right_pixels"
* "dual_link_right_left_pixels"
*/
link-type = "dual_link_even_odd_pixels";
//link-type = "dual_link_odd_even_pixels";
status = "okay";
};
display-timings {
src-timing {
clock-frequency = < 148500000 >;
hactive = < 1920 >;
vactive = < 1080 >;
hback-porch = < 148 >;
hfront-porch = < 88 >;
vback-porch = < 6 >;
vfront-porch = < 4 >;
hsync-len = < 44 >;
vsync-len = < 5 >;
hsync-active = < 0 >;
vsync-active = < 0 >;
de-active = < 0 >;
pixelclk-active = < 0 >;
};
dst-timing {
clock-frequency = < 148500000 >;
hactive = < 1920 >;
vactive = < 1080 >;
hback-porch = < 148 >;
hfront-porch = < 88 >;
vback-porch = < 6 >;
vfront-porch = < 4 >;
hsync-len = < 44 >;
vsync-len = < 5 >;
hsync-active = < 0 >;
vsync-active = < 0 >;
de-active = < 0 >;
pixelclk-active = < 0 >;
};
};
};
};