MTK平臺uart log 抓取及8 秒重啟、開機震動功能總結
阿新 • • 發佈:2019-01-25
MTK平臺串列埠log抓取
作為一名驅動工程師,有時候必須要抓取uart log來分析故障,查詢及驗證後,發現一下方法確認能夠穩定及正常抓取MTK平臺uart log。
1.preloader 中配置串列埠號 bootable/bootloader/preloader/custom/aus6753_65u_l1/cust_bldr.mak 如: CFG_UART_LOG :=UART1 CFG_UART_META :=UART1 改為:(修改成需要的串列埠號碼,並在PCB上將對應串列埠Tx引出) CFG_UART_LOG :=UART3 CFG_UART_META :=UART3 2.lk中設定cmdline裡不去關串列埠int boot_linux_fdt(void *kernel, unsigned *tags,
char *cmdline, unsigned machtype,
void *ramdisk, unsigned ramdisk_size)
{ ......
#ifdef USER_BUILD
//sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=1"); //預設是這句配置,關閉uart
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0"); //default open uart log by zhangliang
#else
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\"");
#endif
......
}
3.讓kernel中到console後不去關閉串列埠log
kernel-3.10/kernel/printk.c
inline void mt_disable_uart(void)
{
if (mt_need_uart_console == 0) {
printk("<< printk console disable >>\n");
printk_disable_uart = 1; //0: uart log always on,改為0 即串列埠log常開
} else {
printk("<< printk console can't be disabled >>\n");
}
}
MTK 平臺新增開機震動功能
在bootable\bootloader\lk\platform\mt6735\platform.c中的 platform_init()函式裡面新增下面程式碼。
vibr_Enable_HW();
mdelay(300);
vibr_Disable_HW();
開機能夠振動。但關機後再開機不會振動,原因在於開啟了快速開機(IPO)功能。
解決方案:上層修改,將快速開機功能預設關閉,底層在LK中新增開機震動程式碼。
MTK 平臺新增 8 秒重啟功能
在main/kernel-3.10/drivers/misc/mediatek/mach/mt6735/len6753_66t_vo/keypad/mtk_kpd.h檔案中,修成如下程式碼: //#define ONEKEY_REBOOT_NORMAL_MODE //#define TWOKEY_REBOOT_NORMAL_MODE #define ONEKEY_REBOOT_OTHER_MODE //#define TWOKEY_REBOOT_OTHER_MODE /* KPD_PMIC_RSTKEY_MAP is defined in cust_kpd.h */ #define KPD_PMIC_LPRST_TD 1 /* timeout period. 0: 8sec; 1: 11sec; 2: 14sec; 3: 5sec */ 然後從新build load、先format,然後再download即可