From 4e6107b8b34588ceac388a217f6575425495118e Mon Sep 17 00:00:00 2001 From: zhangh12 Date: Fri, 22 Feb 2019 17:03:04 +0800 Subject: [PATCH] secure: tee log will be enabled via debug token Change-Id: I85336d9b5e9a975c7742c2484e533ca5977a4014 Signed-off-by: zhangh12 Reviewed-on: https://gerrit.mot.com/1313150 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- .../gud/gud-exynos9610/MobiCoreDriver/logging.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gud/gud-exynos9610/MobiCoreDriver/logging.c b/drivers/gud/gud-exynos9610/MobiCoreDriver/logging.c index 676115283b5a..ab9be820369d 100755 --- a/drivers/gud/gud-exynos9610/MobiCoreDriver/logging.c +++ b/drivers/gud/gud-exynos9610/MobiCoreDriver/logging.c @@ -49,6 +49,9 @@ #define LOG_CPUID_MASK (0xF000) #define LOG_CPUID_SHIFT 12 +#define TEE_COMMANDLINE_PARAM_LENGTH 10 +static char teedebugenable[TEE_COMMANDLINE_PARAM_LENGTH]; + struct mc_logmsg { u16 ctrl; /* Type and format of data */ u16 source; /* Unique value for each event source */ @@ -84,6 +87,14 @@ static struct logging_ctx { bool dead; } log_ctx; +static int __init tee_debug_enable_param(char *line) +{ + strlcpy(teedebugenable, line, sizeof(teedebugenable)); + return 1; +} + +__setup("androidboot.teedebugenable=", tee_debug_enable_param); + static inline void log_eol(u16 source, u32 cpuid) { if (!log_ctx.line_len) @@ -245,7 +256,10 @@ int logging_init(phys_addr_t *buffer, u32 *size) #ifdef CONFIG_TRUSTONIC_TEE_DEBUG log_ctx.enabled = true; #else - log_ctx.enabled = false; + if(!strncmp(teedebugenable, "enable", sizeof("enable"))) + log_ctx.enabled = true; + else + log_ctx.enabled = false; #endif debugfs_create_bool("swd_debug", 0600, g_ctx.debug_dir, &log_ctx.enabled); -- 2.20.1