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> |
Ravi Kumar Bokka | b01b476 | 2020-11-06 11:28:01 +0530 | [diff] [blame] | 6 | #include <soc/uart.h> |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 7 | |
Arthur Heymans | 9948c52 | 2022-10-24 14:37:40 +0200 | [diff] [blame] | 8 | enum cb_err fill_lb_serial(struct lb_serial *serial) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 9 | { |
Arthur Heymans | 9948c52 | 2022-10-24 14:37:40 +0200 | [diff] [blame] | 10 | return CB_ERR; |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 11 | } |
| 12 | |
| 13 | static void set_tx(int line_state) |
| 14 | { |
| 15 | gpio_set(UART_TX_PIN, line_state); |
| 16 | } |
| 17 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 18 | void uart_init(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 19 | { |
| 20 | gpio_output(UART_TX_PIN, 1); |
| 21 | } |
| 22 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 23 | void uart_tx_byte(unsigned int idx, unsigned char data) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 24 | { |
| 25 | uart_bitbang_tx_byte(data, set_tx); |
| 26 | } |
| 27 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 28 | void uart_tx_flush(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 29 | { |
| 30 | /* unnecessary, PIO Tx means transaction is over when tx_byte returns */ |
| 31 | } |
| 32 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 33 | unsigned char uart_rx_byte(unsigned int idx) |
T Michael Turney | 99bf436 | 2019-08-07 14:25:58 -0700 | [diff] [blame] | 34 | { |
| 35 | return 0; /* not implemented */ |
| 36 | } |