coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
uart.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <types.h>
4
#include <
console/uart.h
>
5
#include <
boot/coreboot_tables.h
>
6
7
static
uint8_t
*
buf
= (
void
*)0;
8
uintptr_t
uart_platform_base
(
unsigned
int
idx)
9
{
10
return
(
uintptr_t
)
buf
;
11
}
12
13
void
uart_init
(
unsigned
int
idx)
14
{
15
}
16
17
unsigned
char
uart_rx_byte
(
unsigned
int
idx)
18
{
19
return
0;
20
}
21
22
void
uart_tx_byte
(
unsigned
int
idx,
unsigned
char
data)
23
{
24
25
}
26
27
void
uart_tx_flush
(
unsigned
int
idx)
28
{
29
}
30
31
void
uart_fill_lb
(
void
*data)
32
{
33
struct
lb_serial
serial
;
34
35
serial
.type =
LB_SERIAL_TYPE_MEMORY_MAPPED
;
36
serial
.baseaddr = 0;
37
serial
.baud = 115200;
38
serial
.regwidth = 1;
39
serial
.input_hertz =
uart_platform_refclk
();
40
serial
.uart_pci_addr = CONFIG_UART_PCI_ADDR;
41
lb_add_serial
(&
serial
, data);
42
43
lb_add_console
(
LB_TAG_CONSOLE_SERIAL8250MEM
, data);
44
}
LB_TAG_CONSOLE_SERIAL8250MEM
#define LB_TAG_CONSOLE_SERIAL8250MEM
Definition:
coreboot_tables.h:213
LB_SERIAL_TYPE_MEMORY_MAPPED
#define LB_SERIAL_TYPE_MEMORY_MAPPED
Definition:
coreboot_tables.h:179
coreboot_tables.h
lb_add_console
void lb_add_console(uint16_t consoletype, void *data)
Definition:
coreboot_table.c:110
lb_add_serial
void lb_add_serial(struct lb_serial *serial, void *data)
Definition:
coreboot_table.c:94
uart.h
serial
unsigned int serial
Definition:
edid.c:52
buf
static uint8_t * buf
Definition:
uart.c:7
uart_init
void uart_init(unsigned int idx)
Definition:
uart.c:13
uart_tx_flush
void uart_tx_flush(unsigned int idx)
Definition:
uart.c:27
uart_platform_base
uintptr_t uart_platform_base(unsigned int idx)
Definition:
uart.c:8
uart_rx_byte
unsigned char uart_rx_byte(unsigned int idx)
Definition:
uart.c:17
uart_fill_lb
void uart_fill_lb(void *data)
Definition:
uart.c:31
uart_tx_byte
void uart_tx_byte(unsigned int idx, unsigned char data)
Definition:
uart.c:22
uart_platform_refclk
unsigned int uart_platform_refclk(void)
Definition:
uart.c:85
uintptr_t
unsigned long uintptr_t
Definition:
stdint.h:21
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
lb_serial
Definition:
coreboot_tables.h:175
src
mainboard
emulation
qemu-power8
uart.c
Generated by
1.9.1