Debian Codegraph @

src/soc/qualcomm/common/uart_bitbang.c

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