本帖最后由 YWXY 于 2020-11-16 13:47 编辑
驱动移植环境:
LCM驱动:ili9881c_hd720_dsi_vdo 主 控:MT6761 内 核:kernel-4.9 工 程:k61v1_64_bsp
1.硬件IO口配置 打开vendor\mediatek\proprietary\scripts\dct\DrvGen.exe工具 配置kernel和vendor的dws文件,路径如下 vendor:vendor\mediatek\proprietary\bootable\bootloader\lk\target\k61v1_64_bsp\dct\dct\codegen.dws kernel:kernel-4.9\drivers\misc\mediatek\dws\mt6761\k61v1_64_bsp.dws 配置相关LCM PWM引脚、RST复位引脚、DISP_PWM引脚和LCM电源控制引脚。本例中dws文件使用的默认配置。
2.文件移植 2.1 将屏驱动代码添加到lk、kernel 目录lcm文件中。路径如下 lk:vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\ili9881c_hd720_dsi_vdo Kernel:kernel-4.9\drivers\misc\mediatek\lcm\ili9881c_hd720_dsi_vdo 2.2 修改配置文件 Lk: 2.2.1 在mt65xx_lcm_list.c文件中添加extern屏驱动设备名并在lcm_driver_list和lcm_name_list中添加屏驱动设备名 路径:vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\mt65xx_lcm_list.c - extern LCM_DRIVER ili9881c_hd720_lcm_drv;
复制代码- LCM_DRIVER *lcm_driver_list[] = {
- #if defined(ILI9881C_HD720_DSI_VDO)
- &ili9881c_hd720_lcm_drv,
- #endif};
复制代码- unsigned char lcm_name_list[][128] = {
- #if defined(ILI9881C_HD720_DSI_VDO)
- "ili9881c_hd720_lcm_drv",
- #endif};
复制代码
2.2.2 vendor\mediatek\proprietary\bootable\bootloader\lk\project\k61v1_64_bsp.mk 配置屏驱动文件: CUSTOM_LK_LCM="ili9881c_hd720_dsi_vdo" 配置对应分辨率logo: BOOT_LOGO := hd720
Kernel : 2.2.3 kernel-4.9\drivers\misc\mediatek\lcm\mt65xx_lcm_list.c 中在lcm_driver_list和lcm_name_list中添加屏驱动设备名 - LCM_DRIVER *lcm_driver_list[] = {
- #if defined(ILI9881C_HD720_DSI_VDO)
- &ili9881c_hd720_lcm_drv,
- #endif };
复制代码- unsigned char lcm_name_list[][128] = {
- #if defined(ILI9881C_HD720_DSI_VDO)
- "ili9881c_hd720_lcm_drv",
- #endif };
复制代码
2.2.4 kernel-4.9\drivers\misc\mediatek\lcm\mt65xx_lcm_list.h中添加extern屏驱动设备名 - extern struct LCM_DRIVER ili9881c_hd720_lcm_drv;
复制代码2.2.5 kernel-4.9\arch\arm64\configs\k61v1_64_bsp_defconfig中配置屏驱动文件 - CONFIG_CUSTOM_KERNEL_LCM="ili9881c_hd720_dsi_vdo"
复制代码2.2.6 device\mediateksample\k61v1_64_bsp\ProjectConfig.mk 配置对应分辨率logo:BOOT_LOGO = hd720 配置对应分辨率: LCM_HEIGHT = 1280 LCM_WIDTH = 720 3.编译 编译通过后,烧录到硬件,上电后观察屏幕是否正常显示。
|