From 54d016fa72bafcf8d2849e02cab45b09ad098dab Mon Sep 17 00:00:00 2001 From: Stricted Date: Thu, 21 Feb 2019 08:15:47 +0000 Subject: [PATCH] uart... --- arch/arm/configs/ttab_debug_defconfig | 10 +++++----- arch/arm/configs/ttab_defconfig | 10 +++++----- arch/arm/kernel/atags_parse.c | 2 +- arch/arm/mach-mt8127/mt_devs.c | 7 ++++--- drivers/misc/mediatek/mtprof/mt_printk_ctrl.c | 14 ++++++++------ kernel/printk.c | 2 +- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/arch/arm/configs/ttab_debug_defconfig b/arch/arm/configs/ttab_debug_defconfig index 35249fb96da0..cff742b7d88f 100644 --- a/arch/arm/configs/ttab_debug_defconfig +++ b/arch/arm/configs/ttab_debug_defconfig @@ -430,10 +430,10 @@ CONFIG_ATAGS=y CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 # CONFIG_COMPAT_CPUINFO is not set -CONFIG_CMDLINE="console=tty0 console=ttyMT3,921600n1 root=/dev/ram vmalloc=496M slub_max_order=0 slub_debug=O coherent_pool=3240K" -CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_CMDLINE="console=ttyMT0,921600n1 root=/dev/ram vmalloc=496M slub_max_order=0 slub_debug=O coherent_pool=3240K root=/dev/ram androidboot.selinux=permissive loglevel=8 lcm=1-rm72013_wxga_dsi_vdo fps=6119 vram=27262976 bootprof.pl_t=4169 bootprof.lk_t=2057 boot_reason=2 androidboot.serialno=18E3BC284952295 androidboot.bootreason=rtc" +# CONFIG_CMDLINE_FROM_BOOTLOADER is not set # CONFIG_CMDLINE_EXTEND is not set -# CONFIG_CMDLINE_FORCE is not set +CONFIG_CMDLINE_FORCE=y # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set @@ -1374,7 +1374,7 @@ CONFIG_MTK_RTC=y CONFIG_MTK_SERIAL=y CONFIG_MTK_SERIAL_CONSOLE=y # CONFIG_MTK_SERIAL_MODEM_TEST is not set -# CONFIG_MTK_UART_USB_SWITCH is not set +CONFIG_MTK_UART_USB_SWITCH=y CONFIG_MTK_SIM2=y CONFIG_MTK_SOUND=y # CONFIG_MTK_AUDIO_EXTCODEC_SUPPORT is not set @@ -1828,7 +1828,7 @@ CONFIG_CONSOLE_POLL=y # CONFIG_SERIAL_ALTERA_UART is not set # CONFIG_SERIAL_IFX6X60 is not set # CONFIG_SERIAL_ARC is not set -# CONFIG_TTY_PRINTK is not set +CONFIG_TTY_PRINTK=y # CONFIG_HVC_DCC is not set # CONFIG_IPMI_HANDLER is not set # CONFIG_HW_RANDOM is not set diff --git a/arch/arm/configs/ttab_defconfig b/arch/arm/configs/ttab_defconfig index 168234938c17..57c89fbb0e52 100644 --- a/arch/arm/configs/ttab_defconfig +++ b/arch/arm/configs/ttab_defconfig @@ -428,14 +428,14 @@ CONFIG_CC_STACKPROTECTOR=y # Boot options # # CONFIG_USE_OF is not set -CONFIG_ATAGS=y +# CONFIG_ATAGS is not set # CONFIG_DEPRECATED_PARAM_STRUCT is not set CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 # CONFIG_COMPAT_CPUINFO is not set -CONFIG_CMDLINE="console=tty0 console=ttyMT3,921600n1 root=/dev/ram vmalloc=496M slub_max_order=0 slub_debug=O coherent_pool=3240K" -CONFIG_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_CMDLINE_EXTEND is not set +CONFIG_CMDLINE="console=tty0 console=ttyMT3,921600n1 printk.disable_uart=0 root=/dev/ram vmalloc=496M slub_max_order=0 slub_debug=O coherent_pool=3240K androidboot.selinux=permissive" +# CONFIG_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_CMDLINE_EXTEND=y # CONFIG_CMDLINE_FORCE is not set # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set @@ -1250,7 +1250,7 @@ CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR=0x83F00000 # CONFIG_MT_LOCK_DEBUG is not set CONFIG_PRINTK_PROCESS_INFO=y CONFIG_MT_PRINTK_UART_CONSOLE=y -# CONFIG_MT_ENG_BUILD is not set +CONFIG_MT_ENG_BUILD=y CONFIG_RAMDISK_OFFSET=0xF00000 CONFIG_EARLY_LINUX_PORTING=y # CONFIG_MTK_MCI is not set diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c index 883e249eb1e0..90d9ebe9d4fd 100644 --- a/arch/arm/kernel/atags_parse.c +++ b/arch/arm/kernel/atags_parse.c @@ -232,7 +232,7 @@ struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer, } /* parse_early_param needs a boot_command_line */ - strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, default_command_line, COMMAND_LINE_SIZE); return mdesc; } diff --git a/arch/arm/mach-mt8127/mt_devs.c b/arch/arm/mach-mt8127/mt_devs.c index 672e22c5e6c2..199d604cc712 100644 --- a/arch/arm/mach-mt8127/mt_devs.c +++ b/arch/arm/mach-mt8127/mt_devs.c @@ -1101,7 +1101,8 @@ static struct platform_device camera_sysram_dev = { static void cmdline_filter(struct tag *cmdline_tag, char *default_cmdline) { const char *undesired_cmds[] = { - "console=", + "console=ttyMT1,921600n1" + "console=tty0" "root=", "lk_t=", "pl_t=", @@ -1424,7 +1425,7 @@ void mt_fixup(struct tag *tags, char **cmdline, struct meminfo *mi) #endif char *br_ptr; // This function may modify ttyMT3 to ttyMT0 if needed - adjust_kernel_cmd_line_setting_for_console(cmdline_tag->u.cmdline.cmdline, *cmdline); + //adjust_kernel_cmd_line_setting_for_console(cmdline_tag->u.cmdline.cmdline, *cmdline); #ifdef CONFIG_FIQ_DEBUGGER if ((console_ptr=strstr(*cmdline, "ttyMT")) != 0) { @@ -1436,7 +1437,7 @@ void mt_fixup(struct tag *tags, char **cmdline, struct meminfo *mi) } #endif - cmdline_filter(cmdline_tag, *cmdline); + //cmdline_filter(cmdline_tag, *cmdline); if ((br_ptr = strstr(*cmdline, "boot_reason=")) != 0) { /* get boot reason */ g_boot_reason = br_ptr[12] - '0'; diff --git a/drivers/misc/mediatek/mtprof/mt_printk_ctrl.c b/drivers/misc/mediatek/mtprof/mt_printk_ctrl.c index f2acc302f3f5..57fd29d3d746 100644 --- a/drivers/misc/mediatek/mtprof/mt_printk_ctrl.c +++ b/drivers/misc/mediatek/mtprof/mt_printk_ctrl.c @@ -75,7 +75,7 @@ static unsigned long nsec_low(unsigned long long nsec) /* Define Proc entry */ /* --------------------------------------------------- */ MT_DEBUG_ENTRY(printk_ctrl); -int mt_need_uart_console = 0; +int mt_need_uart_console = 1; extern void mt_enable_uart(void); /* printk.c */ extern void mt_disable_uart(void); /* printk.c */ extern bool printk_disable_uart; @@ -119,10 +119,10 @@ static ssize_t mt_printk_ctrl_write(struct file *filp, const char *ubuf, ssize_t //auto reboot after power off void force_enable_uart_log(void) { - if(mt_need_uart_console){ - pr_err("uart log alrady opened!!!!\n"); - return; - } + //if(mt_need_uart_console){ + // pr_err("uart log alrady opened!!!!\n"); + // return; + //} mt_need_uart_console = 1; mt_enable_uart(); @@ -134,7 +134,9 @@ void force_enable_uart_log(void) static int __init init_mt_printk_ctrl(void) { struct proc_dir_entry *pe; - mt_need_uart_console = 0; /* defualt, no uart */ + mt_need_uart_console = 1; /* defualt, no uart */ + mt_enable_uart(); + force_enable_uart_log(); pe = proc_create("mtprintk", 0664, NULL, &mt_printk_ctrl_fops); if (!pe) return -ENOMEM; diff --git a/kernel/printk.c b/kernel/printk.c index e20087156cdb..3a6718af9248 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -927,7 +927,7 @@ static bool printk_time = 1; static bool printk_time; #endif module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); -module_param_named(disable_uart, printk_disable_uart, bool, S_IRUGO | S_IWUSR); +//module_param_named(disable_uart, printk_disable_uart, bool, S_IRUGO | S_IWUSR); static size_t print_time(u64 ts, char *buf) { -- 2.20.1