blob: aa85cb9d5796987cf69ba7d4586f960dab391397 [file] [log] [blame]
Johnny Line6139172020-09-12 23:13:50 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <console/console.h>
4#include <drivers/vpd/vpd.h>
Johnny Line6139172020-09-12 23:13:50 +08005
6#include "vpd.h"
7
8int get_console_loglevel(void)
9{
10 int log_level = COREBOOT_LOG_LEVEL_DEFAULT;
Johnny Line6139172020-09-12 23:13:50 +080011
Johnny Lin9918c342020-12-25 13:43:45 +080012 if (vpd_get_int(COREBOOT_LOG_LEVEL, VPD_RW_THEN_RO, &log_level)) {
Johnny Line6139172020-09-12 23:13:50 +080013 if (log_level < 0 || log_level >= BIOS_NEVER)
14 log_level = COREBOOT_LOG_LEVEL_DEFAULT;
15 }
16 return log_level;
17}