blob: d6447f1f1881261bb1e6b5944b3e52f1fd5754fd [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-only */
T Michael Turney99bf4362019-08-07 14:25:58 -07002
3#include <console/uart.h>
4#include <gpio.h>
T Michael Turney99bf4362019-08-07 14:25:58 -07005#include <boot/coreboot_tables.h>
Ravi Kumar Bokkab01b4762020-11-06 11:28:01 +05306#include <soc/uart.h>
T Michael Turney99bf4362019-08-07 14:25:58 -07007
Arthur Heymans9948c522022-10-24 14:37:40 +02008enum cb_err fill_lb_serial(struct lb_serial *serial)
T Michael Turney99bf4362019-08-07 14:25:58 -07009{
Arthur Heymans9948c522022-10-24 14:37:40 +020010 return CB_ERR;
T Michael Turney99bf4362019-08-07 14:25:58 -070011}
12
13static void set_tx(int line_state)
14{
15 gpio_set(UART_TX_PIN, line_state);
16}
17
Felix Helde3a12472020-09-11 15:47:09 +020018void uart_init(unsigned int idx)
T Michael Turney99bf4362019-08-07 14:25:58 -070019{
20 gpio_output(UART_TX_PIN, 1);
21}
22
Felix Helde3a12472020-09-11 15:47:09 +020023void uart_tx_byte(unsigned int idx, unsigned char data)
T Michael Turney99bf4362019-08-07 14:25:58 -070024{
25 uart_bitbang_tx_byte(data, set_tx);
26}
27
Felix Helde3a12472020-09-11 15:47:09 +020028void uart_tx_flush(unsigned int idx)
T Michael Turney99bf4362019-08-07 14:25:58 -070029{
30 /* unnecessary, PIO Tx means transaction is over when tx_byte returns */
31}
32
Felix Helde3a12472020-09-11 15:47:09 +020033unsigned char uart_rx_byte(unsigned int idx)
T Michael Turney99bf4362019-08-07 14:25:58 -070034{
35 return 0; /* not implemented */
36}