1.在lk中,进入目录:
vendor/mediatek/proprietary/bootable/bootloader/lk/app/mt_boot/mt_boot.c
在这个文件中,找到以下ifdef USER_BUILD位置(有两处),进行修改:
#ifdef USER_BUILD
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=1");
#else
if (!strcmp(PLATFORM,"mt6757") || !strcmp(PLATFORM,"MT6757")) {
if (g_is_64bit_kernel == 1) {
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 earlycon=uartmtk,mmio32,0x11002000,921600n8 ddebug_query=\" file *mediatek* +p ; file *gpu* =_\"");
} else {
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 earlyprintk=mt6757,0x11002000 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\"");
}
} else {
dprintf(CRITICAL,"boot linux fdt platform name is %s\n", PLATFORM);
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\"");
}
#endif
改为:
#if 0
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=1");
#else
if (!strcmp(PLATFORM,"mt6757") || !strcmp(PLATFORM,"MT6757")) {
if (g_is_64bit_kernel == 1) {
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 earlycon=uartmtk,mmio32,0x11002000,921600n8 ddebug_query=\" file *mediatek* +p ; file *gpu* =_\"");
} else {
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 earlyprintk=mt6757,0x11002000 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\"");
}
} else {
dprintf(CRITICAL,"boot linux fdt platform name is %s\n", PLATFORM);
sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\"");
}
#endif
之后还在kernel目录中进行设置,路径如下:
android/kernel-4.4/kernel/printk/printk.c
在文件中找到(有多处赋值)
printk_disable_uart=1 ,将其1改为0,即可。