From 107e7aa0f58f79ee5719f82c7147e53d7d9fa218 Mon Sep 17 00:00:00 2001 From: Johnny Lin Date: Thu, 14 Jan 2021 17:49:08 +0800 Subject: cpu/x86/smm: Enable setting SMM console log level from mainboard Add a Kconfig RUNTIME_CONFIGURABLE_SMM_LOGLEVEL that enables mainboard to override mainboard_set_smm_log_level for SMM log level. This can let SMM have different log level than other stages for more flexibility. Another reason is that getting certain data that requires searching from flash VPD or CMOS is not very ideal to be done in SMM, so in this change the value can be passed via the member variable in struct smm_runtime and be referenced directly in SMM. One example is that mainboard can get the desired SMM log level from VPD/CMOS, and pass SMM console log level via the variable and in SMM it can be referenced in get_console_loglevel() override function directly. Tested=On OCP Delta Lake, verified SMM log level can be overridden. Change-Id: I81722a4f1bf75ec942cc06e403ad702dfe938e71 Signed-off-by: Johnny Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/49460 Reviewed-by: David Hendricks Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Zhang --- src/cpu/x86/smm/smm_module_handler.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/cpu/x86/smm/smm_module_handler.c') diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index a976521e65..1b3c93b780 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -52,6 +52,13 @@ static void smi_release_lock(void) ); } +#if CONFIG(RUNTIME_CONFIGURABLE_SMM_LOGLEVEL) +int get_console_loglevel(void) +{ + return smm_runtime.smm_log_level; +} +#endif + void smm_get_cbmemc_buffer(void **buffer_out, size_t *size_out) { *buffer_out = smm_runtime.cbmemc; -- cgit v1.2.3