xref: /aosp_15_r20/external/coreboot/src/soc/qualcomm/common/uart_bitbang.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/uart.h>
4 #include <gpio.h>
5 #include <boot/coreboot_tables.h>
6 #include <soc/uart.h>
7 
fill_lb_serial(struct lb_serial * serial)8 enum cb_err fill_lb_serial(struct lb_serial *serial)
9 {
10 	return CB_ERR;
11 }
12 
set_tx(int line_state)13 static void set_tx(int line_state)
14 {
15 	gpio_set(UART_TX_PIN, line_state);
16 }
17 
uart_init(unsigned int idx)18 void uart_init(unsigned int idx)
19 {
20 	gpio_output(UART_TX_PIN, 1);
21 }
22 
uart_tx_byte(unsigned int idx,unsigned char data)23 void uart_tx_byte(unsigned int idx, unsigned char data)
24 {
25 	uart_bitbang_tx_byte(data, set_tx);
26 }
27 
uart_tx_flush(unsigned int idx)28 void uart_tx_flush(unsigned int idx)
29 {
30 	/* unnecessary, PIO Tx means transaction is over when tx_byte returns */
31 }
32 
uart_rx_byte(unsigned int idx)33 unsigned char uart_rx_byte(unsigned int idx)
34 {
35 	return 0;	/* not implemented */
36 }
37