LCM driver porting work is divided into two parts: LK LCM configuration and kernel LCM configuration.
1 LK LCM Configuration
1.1 Add your <LCM driver>
–Add your <LCM driver> into the following path:
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm
–Take <boe_fhd_vdo> for example:
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\boe_fhd_vdo\
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\boe_fhd_vdo\boe_fhd_vdo.c
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\boe_fhd_vdo\Makefile
1.2 Add your <LCM config> in <project>.mk
–Add your <LCM confing> in <project>.mk
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\project\amt6797_64_open.mk
–Take <boe_fhd_vdo> for example:
CUSTOM_LK_LCM="boe_fhd_vdo"
or
CUSTOM_LK_LCM="nt35695_fhd_dsi_cmd_truly_nt50358 boe_fhd_vdo"
1.3 Add your <LCM main structure> into lcm list
–Add your <lcm main structure> into lcm list in
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\dev\lcm\mt65xx_lcm_list.c
–Take < boe_fhd_vdo> for example:
extern LCM_DRIVER boe_fhd_vdo_lcm_drv;
LCM_DRIVER *lcm_driver_list[] = {
..........
#if defined(BOE_FHD_VDO)
&boe_fhd_vdo_lcm_drv,
#endif
..........
};
1.4 Switch logo if LCM resolution is different
–Modify define marco of BOOT_LOGO in
alps\vendor\mediatek\proprietary\bootable\bootloader\lk\project\amt6797_64_open.mk
–Take <boe_fhd_vdo> for example:
BOOT_LOGO := fhd
1.5 Rebuild LK
–Rebuild lk and re-download lk.bin.
2. Kernel LCM Configuration
2.1 Add your <LCM driver>
–Add your <LCM driver> into the following path:
alps\kernel-3.18\drivers\misc\mediatek\lcm\
–Take <boe_fhd_vdo> for example:
alps\kernel-3.18\drivers\misc\mediatek\lcm\boe_fhd_vdo\
alps\kernel-3.18\drivers\misc\mediatek\lcm\boe_fhd_vdo\boe_fhd_vdo.c
alps\kernel-3.18\drivers\misc\mediatek\lcm\boe_fhd_vdo\Makefile
2.2 Link your <LCM object>
–Link your compiled <LCM object> in
alps\kernel-3.18\drivers\misc\mediatek\lcm<lcm>\Makefile
–Take < boe_fhd_vdo> for example:
obj-y += boe_fhd_vdo.o
ccflags-$(CONFIG_MTK_LCM) += -I$(srctree)/drivers/misc/mediatek/lcm/inc
2.3 Add your <LCM main structure> into lcm list
–Add your <LCM main structure> into lcm list in
alps\kernel-3.18\drivers\misc\mediatek\lcm\mt65xx_lcm_list.c
–Take <boe_fhd_vdo> for example:
LCM_DRIVER *lcm_driver_list[] = {
..........
#if defined(BOE_FHD_VDO)
&boe_fhd_vdo_lcm_drv,
#endif
..........
};
–alps\kernel-3.10\drivers\misc\mediatek\lcm\inc\mt65xx_lcm_list.h
extern LCM_DRIVER boe_fhd_vdo_lcm_drv;
2.4 Add your <LCM config> in <project>_debug_defconfig
–Add your <LCM confing> in <project>_debug_defconfig
alps\kernel-3.18\arch\arm64\configs\amt6797_64_open_debug_defconfig
–Take <boe_fhd_vdo> for example:
CONFIG_CUSTOM_KERNEL_LCM="boe_fhd_vdo"
or
CONFIG_CUSTOM_KERNEL_LCM="nt35695_fhd_dsi_cmd_truly_nt50358 boe_fhd_vdo"
2.5 Rebuild Kernel and Bootimage
–Return to alps folder in console.
–Rebuild kernel and bootimage, and re-download boot.img
Working