diff options
author | Johnny Lin <johnny_lin@wiwynn.com> | 2020-09-12 23:13:50 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-10-26 06:53:06 +0000 |
commit | e61391738ff55243e14d1692dd4746d4345e63ce (patch) | |
tree | 209e2c08f565793bb0ae9a41a1be6e59d8f00325 | |
parent | e874b1c1794406aa9adcd00a06cdb713b50b88ff (diff) | |
download | coreboot-e61391738ff55243e14d1692dd4746d4345e63ce.tar.xz |
mb/ocp/deltalake: Override coreboot log level via VPD
Tested=On OCP Delta Lake, log level can be changed via VPD.
Change-Id: I36d4b01b6fb6acc726749641df089cb3f9a4dc3e
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45326
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
-rw-r--r-- | src/mainboard/ocp/deltalake/Kconfig | 1 | ||||
-rw-r--r-- | src/mainboard/ocp/deltalake/Makefile.inc | 2 | ||||
-rw-r--r-- | src/mainboard/ocp/deltalake/loglevel_vpd.c | 20 | ||||
-rw-r--r-- | src/mainboard/ocp/deltalake/vpd.h | 4 |
4 files changed, 26 insertions, 1 deletions
diff --git a/src/mainboard/ocp/deltalake/Kconfig b/src/mainboard/ocp/deltalake/Kconfig index ff5599c007..bb907f1af7 100644 --- a/src/mainboard/ocp/deltalake/Kconfig +++ b/src/mainboard/ocp/deltalake/Kconfig @@ -3,6 +3,7 @@ if BOARD_OCP_DELTALAKE config BOARD_SPECIFIC_OPTIONS def_bool y select BOARD_ROMSIZE_KB_65536 + select CONSOLE_OVERRIDE_LOGLEVEL select HAVE_ACPI_TABLES select MAINBOARD_USES_FSP2_0 select SOC_INTEL_COOPERLAKE_SP diff --git a/src/mainboard/ocp/deltalake/Makefile.inc b/src/mainboard/ocp/deltalake/Makefile.inc index be6af246ed..e961a3423a 100644 --- a/src/mainboard/ocp/deltalake/Makefile.inc +++ b/src/mainboard/ocp/deltalake/Makefile.inc @@ -7,6 +7,6 @@ romstage-$(CONFIG_IPMI_KCS_ROMSTAGE) += ipmi.c ramstage-y += ramstage.c ipmi.c ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c - +all-$(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL) += loglevel_vpd.c CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include CPPFLAGS_common += -I$(CONFIG_FSP_HEADER_PATH) diff --git a/src/mainboard/ocp/deltalake/loglevel_vpd.c b/src/mainboard/ocp/deltalake/loglevel_vpd.c new file mode 100644 index 0000000000..3faf37a0ea --- /dev/null +++ b/src/mainboard/ocp/deltalake/loglevel_vpd.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <drivers/vpd/vpd.h> +#include <string.h> + +#include "vpd.h" + +int get_console_loglevel(void) +{ + int log_level = COREBOOT_LOG_LEVEL_DEFAULT; + char val_str[VPD_LEN]; + + if (vpd_gets(COREBOOT_LOG_LEVEL, val_str, VPD_LEN, VPD_RW_THEN_RO)) { + log_level = (int)atol(val_str); + if (log_level < 0 || log_level >= BIOS_NEVER) + log_level = COREBOOT_LOG_LEVEL_DEFAULT; + } + return log_level; +} diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h index ae2099d025..43070c2a16 100644 --- a/src/mainboard/ocp/deltalake/vpd.h +++ b/src/mainboard/ocp/deltalake/vpd.h @@ -32,4 +32,8 @@ #define FSP_DCI "fsp_dci_enable" /* 1 or 0: enable or disable DCI */ #define FSP_DCI_DEFAULT 0 /* Default value when the VPD variable is not found */ +/* coreboot log level */ +#define COREBOOT_LOG_LEVEL "coreboot_log_level" +#define COREBOOT_LOG_LEVEL_DEFAULT 4 + #endif |