Angel Pons | 585495e | 2020-04-03 01:21:38 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 2 | |
| 3 | #include <types.h> |
| 4 | #include <console/uart.h> |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 5 | #include <boot/coreboot_tables.h> |
| 6 | |
| 7 | static uint8_t *buf = (void *)0; |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 8 | uintptr_t uart_platform_base(unsigned int idx) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 9 | { |
| 10 | return (uintptr_t) buf; |
| 11 | } |
| 12 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 13 | void uart_init(unsigned int idx) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 14 | { |
| 15 | } |
| 16 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 17 | unsigned char uart_rx_byte(unsigned int idx) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 18 | { |
| 19 | return 0; |
| 20 | } |
| 21 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 22 | void uart_tx_byte(unsigned int idx, unsigned char data) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 23 | { |
| 24 | |
| 25 | } |
| 26 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 27 | void uart_tx_flush(unsigned int idx) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 28 | { |
| 29 | } |
| 30 | |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 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; |
Jacob Garber | 7839827 | 2019-07-24 11:12:09 -0600 | [diff] [blame] | 39 | serial.input_hertz = uart_platform_refclk(); |
| 40 | serial.uart_pci_addr = CONFIG_UART_PCI_ADDR; |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 41 | lb_add_serial(&serial, data); |
Jacob Garber | 7839827 | 2019-07-24 11:12:09 -0600 | [diff] [blame] | 42 | |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 43 | lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); |
| 44 | } |