Johnny Lin | e613917 | 2020-09-12 23:13:50 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <drivers/vpd/vpd.h> |
Johnny Lin | e613917 | 2020-09-12 23:13:50 +0800 | [diff] [blame] | 5 | |
| 6 | #include "vpd.h" |
| 7 | |
| 8 | int get_console_loglevel(void) |
| 9 | { |
| 10 | int log_level = COREBOOT_LOG_LEVEL_DEFAULT; |
Johnny Lin | e613917 | 2020-09-12 23:13:50 +0800 | [diff] [blame] | 11 | |
Johnny Lin | 9918c34 | 2020-12-25 13:43:45 +0800 | [diff] [blame] | 12 | if (vpd_get_int(COREBOOT_LOG_LEVEL, VPD_RW_THEN_RO, &log_level)) { |
Johnny Lin | e613917 | 2020-09-12 23:13:50 +0800 | [diff] [blame] | 13 | if (log_level < 0 || log_level >= BIOS_NEVER) |
| 14 | log_level = COREBOOT_LOG_LEVEL_DEFAULT; |
| 15 | } |
| 16 | return log_level; |
| 17 | } |