Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 2 | |
| 3 | #include <console/uart.h> |
| 4 | #include <gpio.h> |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 5 | #include <boot/coreboot_tables.h> |
| 6 | |
| 7 | #define UART_TX_PIN GPIO(44) |
| 8 | |
| 9 | void uart_fill_lb(void *data) |
| 10 | { |
| 11 | |
| 12 | } |
| 13 | |
| 14 | static void set_tx(int line_state) |
| 15 | { |
| 16 | gpio_set(UART_TX_PIN, line_state); |
| 17 | } |
| 18 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 19 | void uart_init(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 20 | { |
| 21 | gpio_output(UART_TX_PIN, 1); |
| 22 | } |
| 23 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 24 | void uart_tx_byte(unsigned int idx, unsigned char data) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 25 | { |
| 26 | uart_bitbang_tx_byte(data, set_tx); |
| 27 | } |
| 28 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 29 | void uart_tx_flush(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 30 | { |
| 31 | /* unnecessary, PIO Tx means transaction is over when tx_byte returns */ |
| 32 | } |
| 33 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 34 | unsigned char uart_rx_byte(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 35 | { |
| 36 | return 0; /* not implemented */ |
| 37 | } |