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>
This commit is contained in:
Johnny Lin 2020-09-12 23:13:50 +08:00 committed by Patrick Georgi
parent e874b1c179
commit e61391738f
4 changed files with 26 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;
}

View File

@ -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