Johnny Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71992 )
Change subject: drivers/ocp/vpd: Override mainboard_set_smm_log_level ......................................................................
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 johnny_lin@wiwynn.com --- M src/drivers/ocp/vpd/loglevel_vpd.c 1 file changed, 27 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/71992/1
diff --git a/src/drivers/ocp/vpd/loglevel_vpd.c b/src/drivers/ocp/vpd/loglevel_vpd.c index 7a6db57..048c3a7 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 <cpu/x86/smm.h> #include <console/console.h> #include <drivers/vpd/vpd.h> #include <drivers/ocp/include/vpd.h> @@ -19,3 +20,11 @@ { 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