Johnny Lin has uploaded this change for review.
mb/ocp/deltalake: Set coreboot log level via VPD variable
If the VPD variable 'coreboot_log_level' is not found, will
set to COREBOOT_LOG_LEVEL_DEFAULT.
Tested=On OCP Delta Lake, coreboot log level can be changed
via VPD.
Change-Id: I278e392bed178df7a8cdb90685963c1fedf0bcc4
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
---
M src/mainboard/ocp/deltalake/Kconfig
M src/mainboard/ocp/deltalake/Makefile.inc
A src/mainboard/ocp/deltalake/loglevel.c
M src/mainboard/ocp/deltalake/vpd.h
4 files changed, 31 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/45134/1
diff --git a/src/mainboard/ocp/deltalake/Kconfig b/src/mainboard/ocp/deltalake/Kconfig
index b229c94..9d8f5d8 100644
--- a/src/mainboard/ocp/deltalake/Kconfig
+++ b/src/mainboard/ocp/deltalake/Kconfig
@@ -3,6 +3,7 @@
config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_65536
+ select CONSOLE_OVERRIDE_LOGLEVEL
select FSP_CAR
select HAVE_ACPI_TABLES
select MAINBOARD_USES_FSP2_0
diff --git a/src/mainboard/ocp/deltalake/Makefile.inc b/src/mainboard/ocp/deltalake/Makefile.inc
index be6af24..262d6c0 100644
--- a/src/mainboard/ocp/deltalake/Makefile.inc
+++ b/src/mainboard/ocp/deltalake/Makefile.inc
@@ -1,11 +1,14 @@
## SPDX-License-Identifier: GPL-2.0-or-later
bootblock-y += bootblock.c
-
+bootblock-$(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL) += loglevel.c
+postcar-$(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL) += loglevel.c
romstage-y += romstage.c
+romstage-$(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL) += loglevel.c
romstage-$(CONFIG_IPMI_KCS_ROMSTAGE) += ipmi.c
ramstage-y += ramstage.c ipmi.c
+ramstage-$(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL) += loglevel.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
diff --git a/src/mainboard/ocp/deltalake/loglevel.c b/src/mainboard/ocp/deltalake/loglevel.c
new file mode 100644
index 0000000..fb00f8d
--- /dev/null
+++ b/src/mainboard/ocp/deltalake/loglevel.c
@@ -0,0 +1,22 @@
+/* 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)
+{
+ uint8_t val;
+ char val_str[VPD_LEN];
+
+ if (vpd_gets(COREBOOT_LOG_LEVEL, val_str, VPD_LEN, VPD_RW_THEN_RO)) {
+ val = (uint8_t)atol(val_str);
+ if (val > 8)
+ return COREBOOT_LOG_LEVEL_DEFAULT;
+ return val;
+ } else {
+ return COREBOOT_LOG_LEVEL_DEFAULT;
+ }
+}
diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h
index ae2099d..43070c2 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
To view, visit change 45134. To unsubscribe, or for help writing mail filters, visit settings.