David Hendricks has submitted this change. ( 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71992 Reviewed-by: Marc Jones marc@marcjonesconsulting.com Reviewed-by: David Hendricks david.hendricks@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Jonathan Zhang jonzhang@fb.com --- M src/drivers/ocp/vpd/loglevel_vpd.c 1 file changed, 32 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Marc Jones: Looks good to me, approved David Hendricks: Looks good to me, approved Jonathan Zhang: Looks good to me, approved
diff --git a/src/drivers/ocp/vpd/loglevel_vpd.c b/src/drivers/ocp/vpd/loglevel_vpd.c index 7a6db57..65bb4d1 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