通过工具:
mediatek/source/dct/DrvGen.exe
配置并替换dws文件:
mediatek/custom/bbk75_emmc_gb2/kernel/dct/dct/codegen.dws
1、在下面文件的MTK6575标签栏添加对应的flash芯片型号信息:
mediatek/build/tools/emigen/MT6575/MemoryDeviceList_MT6575.xls
2、从以下文件获取flash芯片对应的序号(从第1列为0,开始数,如到第L列则为11): mediatek/build/tools/ptgen/emmc_region.xls
3、mediatek/custom/bbk15_td_ics/preloader/inc/custom_MemoryDevice.h
#define BOARD_ID LENOVO75 #define CS_PART_NUMBER[0] KMSJS000KM_B308
将上面的宏更改为MemoryDeviceList_MT6575.xls中对应的内容
4、mediatek/config/bbk15_td_ics/ProjectConfig.mk
将EMMC_CHIP更改为第2步获取的数值,如EMMC_CHIP = 11。
(1)、配置mediatek/config/bbk15_td_ics/ProjectConfig.mk
CUSTOM_KERNEL_LCM = sharp_S6D05A1X12_mcu CUSTOM_UBOOT_LCM = sharp_S6D05A1X12_mcu LCM_WIDTH = 320 LCM_HEIGHT = 480 BOOT_LOGO = cmcc_hvga
(2)、增加 lcm 驱动目录及文件
mediatek/custom/common/kernel/lcm/sharp_S6D05A1X12_mcu/
#ifdef BUILD_UBOOT #include <asm/arch/mt6573_gpio.h> #define print(x...) printf(x) #else #include <mach/mt6573_gpio.h> #define print(x...) printk(x) #endif
#ifdef BUILD_UBOOT #include <asm/arch/mt6575_gpio.h> #define print(x...) printf(x) #else #include <mach/mt6575_gpio.h> #define print(x...) printk(x) #endif
(3)、修改 mt65xx_lcm_list.c 使支持刚添加的驱动
mediatek/custom/common/kernel/lcm/mt65xx_lcm_list.c
extern LCM_DRIVER sharp_S6D05A1X12_mcu_drv; ... #if defined(SHARP_S6D05A1X12_MCU) &sharp_S6D05A1X12_mcu_drv, #endif
打开 mediatek/custom/common/kernel/lcm/sharp_S6D05A1X12_mcu/sharp_S6D05A1X12_mcu.c,根据BB管脚定义和实际硬件连接,更改如下GPIO宏定义:
#define LSA0_GPIO_PIN (GPIO49) #define LSCE_GPIO_PIN (GPIO47) #define LSCK_GPIO_PIN (GPIO51) #define LSDA_GPIO_PIN (GPIO52) #define DPICK_GPIO_PIN (GPIO41) #define DPIDE_GPIO_PIN (GPIO30) #define DPIVSYNC_GPIO_PIN (GPIO21) #define DPIHSYNC_GPIO_PIN (GPIO19)
背光配置包括uboot和kernal中的文件:
mediatek/custom/bbk15_td_ics/kernel/leds/mt65xx/cust_leds.c
mediatek/custom/bbk15_td_ics/uboot/cust_leds.c
主要配置
... {"lcd-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight}, ...
中的响应函数"Cust_SetBacklight",在其中要保证背光能亮,由于是打版软件,这里只先配置成gpio让其保持最亮。
查背光IC datasheet可知,只需设置VFB为低、CE为高即可:
... //GPIO162->BL_EN->CE mt_set_gpio_mode(GPIO162,GPIO_MODE_00); mt_set_gpio_dir(GPIO162,GPIO_DIR_OUT); mt_set_gpio_out(GPIO162,GPIO_OUT_ONE); //GPIO67->PWM1->VFB mt_set_gpio_mode(GPIO67,GPIO_MODE_00); mt_set_gpio_dir(GPIO67,GPIO_DIR_OUT); mt_set_gpio_out(GPIO67,GPIO_OUT_ZERO); ...
如:
#define GPIO_CTP_RST_PIN GPIO100 #define GPIO_CTP_RST_PIN_M_GPIO GPIO_MODE_00 #define GPIO_CTP_EINT_PIN GPIO75 #define GPIO_CTP_EINT_PIN_M_GPIO GPIO_MODE_00 #define GPIO_CTP_EINT_PIN_M_EINT GPIO_MODE_01 #define GPIO_CTP_EINT_PIN_M_PWM GPIO_MODE_02
CUSTOM_KERNEL_TOUCHPANEL = qt602240
添加头文件:
mediatek/custom/bbk15_td_ics/kernel/touchpanel/qt602240/
添加C文件:
mediatek/custom/common/kernel/touchpanel/qt602240/
mediatek/custom/bbk15_td_ics/kernel/touchpanel/qt602240/
更改以下宏定义为对应平台:
#define TPD_POWER_SOURCE MT6575_POWER_VGP2
check触摸屏驱动ic的i2c地址,确保代码与datasheet中保持一致:
static unsigned short force[] = {3, 0x4a, I2C_CLIENT_END,I2C_CLIENT_END}; //0x4a则为i2c地址
另外注意check一下此头文件中的其他宏定义信息,确保触屏与LCM适配,如:
//#define TPD_RES_X 480 //#define TPD_RES_Y 800 //#define TPD_CALIBRATION_MATRIX {962,0,0,0,1600,0,0,0}; #define TPD_CALIBRATION_MATRIX {320*2,0,0,0,480*2,0,0,0};
一般在对应的.detect(重新供电操作), .suspend(关闭供电操作), .resume(打开供电操作)中添加进行相关操作,供电功能函数如下:
hwPowerDown(TPD_POWER_SOURCE,"TP"); //停止供电 hwPowerOn(TPD_POWER_SOURCE,VOL_2800,"TP"); //开始供电
另外也可直接在pmic的probe函数中配置(注意找对对应的pm电压输出口和电压大小):
mediatek/platform/mt6575/kernel/drivers/power/pmic_mt6329.c
static int mt6329_driver_probe(struct i2c_client *client, const struct i2c_device_id *id) { ... pmic_ldo_enable(MT65XX_POWER_LDO_VGP2,KAL_TRUE); pmic_ldo_vol_sel(MT65XX_POWER_LDO_VGP2,UPMU_VOLT_2_8_0_0_V); ... }
在配置完音量键后,每次开机都会进入recovery mode(这一点在显示屏无显示时可通过串口抓打印消息验证,显示屏能显示时当然就一目了然了)。
刚开始怀疑是硬件上的有问题,是不是哪里将音量键拉低了,因为我们是配置成开机时按住音量键才会进入recovery的,但电子的同事测试波形之后反馈说只有开机一小段时间输出低,后续便输出高了,于是再次将目光转到软件上来,后来我们查看dct得知连接volume的输入线芯片默认是内部拉低的,于是用dct将其配置成pull up,再开机,一切ok.
方法一:在force中进行i2c id的指定,然后用i2c_add_driver挂载到对应的i2c总线上去:
static unsigned short force[] = {3, 0x4a, I2C_CLIENT_END,I2C_CLIENT_END};
方法二:在mediatek/platform/mt6575/kernel/core/mt6575_devs.c中进行设置:
static struct i2c_board_info __initdata i2c_devs0[]={ { I2C_BOARD_INFO("fan5405", (0xd4>>1)),}, { I2C_BOARD_INFO("qt602240ts", (0x94>>1)),}, };
qt602240ts在配置完成时默认是使用鼠标模式,此时可将以下文件push到 /system/usr/idc/ 即可设置为点触模式:
out/target/product/bbk15_td_ics/system/usr/idc/qt602240ts.idc
# Basic Parameters touch.deviceType = touchScreen touch.orientationAware = 1 # Size touch.size.calibration = diameter touch.size.scale = 10 touch.size.bias = 0 touch.size.isSummed = 0 # Pressure # Driver reports signal strength as pressure. # # A normal thumb touch typically registers about 200 signal strength # units although we don't expect these values to be accurate. touch.pressure.calibration = amplitude touch.pressure.scale = 0.005 # Orientation touch.orientation.calibration = none
将modem编译生成的bin档放在
mediatek/custom/common/modem
调试时,可能需要配置使preloader的log从串口1输出,可更改文件:
mediatek/custom/bbk17_td3001_ics2/preloader/inc/cust_bldr.h