blob: 8d7138e5d146c35264c0c2b777e48c3c1972a870 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Julius Werner90f025b22018-04-24 16:39:20 -07002
3#include <console/uart.h>
4#include <gpio.h>
Julius Werner90f025b22018-04-24 16:39:20 -07005
6#define UART_TX_PIN GPIO(4)
7
8static void set_tx(int line_state)
9{
10 gpio_set(UART_TX_PIN, line_state);
11}
12
Felix Helde3a12472020-09-11 15:47:09 +020013void uart_init(unsigned int idx)
Julius Werner90f025b22018-04-24 16:39:20 -070014{
15 gpio_output(UART_TX_PIN, 1);
16}
17
Felix Helde3a12472020-09-11 15:47:09 +020018void uart_tx_byte(unsigned int idx, unsigned char data)
Julius Werner90f025b22018-04-24 16:39:20 -070019{
20 uart_bitbang_tx_byte(data, set_tx);
21}
22
Felix Helde3a12472020-09-11 15:47:09 +020023void uart_tx_flush(unsigned int idx)
Julius Werner90f025b22018-04-24 16:39:20 -070024{
25 /* unnecessary, PIO Tx means transaction is over when tx_byte returns */
26}
27
Felix Helde3a12472020-09-11 15:47:09 +020028unsigned char uart_rx_byte(unsigned int idx)
Julius Werner90f025b22018-04-24 16:39:20 -070029{
30 return 0; /* not implemented */
31}