diff options
author | Johnny Lin <johnny_lin@wiwynn.com> | 2023-01-16 22:16:41 +0800 |
---|---|---|
committer | David Hendricks <david.hendricks@gmail.com> | 2023-02-16 00:47:11 +0000 |
commit | 9fb89e33bc59b97c9d9314098288db7f6fb082c9 (patch) | |
tree | b9c9c56c93acedbba63e681d035c0e09d729e376 /src/drivers/ocp | |
parent | be0590c3e17ea2e6adc6d9c718318a9885c5bce3 (diff) |
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>
Diffstat (limited to 'src/drivers/ocp')
-rw-r--r-- | src/drivers/ocp/vpd/loglevel_vpd.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 <cpu/x86/smm.h> #include <console/console.h> #include <drivers/vpd/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); } + +#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 |