From 9fb89e33bc59b97c9d9314098288db7f6fb082c9 Mon Sep 17 00:00:00 2001 From: Johnny Lin Date: Mon, 16 Jan 2023 22:16:41 +0800 Subject: [PATCH] drivers/ocp/vpd: Override mainboard_set_smm_log_level VPD variable 'smm_log_level' can be read and passed to SMM for overriding SMM log level. By default it's zero therefore it disables most of the SMM log. When we need to see SMM log we can set this VPD to a larger value to enable it. Implement mainboard_set_smm_log_level() that reads VPD variables for SMM log level. Change-Id: I90d471d1d070d9a0f1a82ca9da8a2c034c9fd574 Signed-off-by: Johnny Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/71992 Reviewed-by: Marc Jones Reviewed-by: David Hendricks Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Zhang --- src/drivers/ocp/vpd/loglevel_vpd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/drivers/ocp/vpd/loglevel_vpd.c b/src/drivers/ocp/vpd/loglevel_vpd.c index 7a6db5750f..65bb4d168e 100644 --- a/src/drivers/ocp/vpd/loglevel_vpd.c +++ b/src/drivers/ocp/vpd/loglevel_vpd.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include #include @@ -19,3 +20,11 @@ int get_console_loglevel(void) { return get_loglevel_from_vpd(COREBOOT_LOG_LEVEL, COREBOOT_LOG_LEVEL_DEFAULT); } + +#if ENV_RAMSTAGE && CONFIG(RUNTIME_CONFIGURABLE_SMM_LOGLEVEL) +/* Read VPD for SMM settings in ramstage because we don't want to do this in SMM */ +int mainboard_set_smm_log_level(void) +{ + return get_loglevel_from_vpd(SMM_LOG_LEVEL, SMM_LOG_LEVEL_DEFAULT); +} +#endif