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>
This commit is contained in:
Johnny Lin 2023-01-16 22:16:41 +08:00 committed by David Hendricks
parent be0590c3e1
commit 9fb89e33bc
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <cpu/x86/smm.h>
#include <console/console.h> #include <console/console.h>
#include <drivers/vpd/vpd.h> #include <drivers/vpd/vpd.h>
#include <drivers/ocp/include/vpd.h> #include <drivers/ocp/include/vpd.h>
@ -19,3 +20,11 @@ int get_console_loglevel(void)
{ {
return get_loglevel_from_vpd(COREBOOT_LOG_LEVEL, COREBOOT_LOG_LEVEL_DEFAULT); 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