coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
uartio_vpd.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <drivers/vpd/vpd.h>
4 #include <console/uart.h>
5 
6 #include "vpd.h"
7 
8 unsigned int get_uart_for_console(void)
9 {
10  int val_int = COREBOOT_UART_IO_DEFAULT;
11 
12  if (vpd_get_int(COREBOOT_UART_IO, VPD_RW_THEN_RO, (int *const) &val_int)) {
13  if (val_int > 3)
14  val_int = COREBOOT_UART_IO_DEFAULT;
15  }
16  return val_int;
17 }
@ VPD_RW_THEN_RO
Definition: vpd.h:14
#define COREBOOT_UART_IO
Definition: vpd.h:41
#define COREBOOT_UART_IO_DEFAULT
Definition: vpd.h:42
unsigned int get_uart_for_console(void)
Definition: uartio_vpd.c:8
bool vpd_get_int(const char *const key, const enum vpd_region region, int *const val)
Definition: vpd.c:284