summaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/common
diff options
context:
space:
mode:
authorRavi Kumar Bokka <rbokka@codeaurora.org>2020-11-06 11:28:01 +0530
committerShelley Chen <shchen@google.com>2021-07-22 06:40:06 +0000
commitb01b47654677ddb7d14023f2e233b3151a287aa3 (patch)
treef20aa268f06991ec37d954ce9c473c74c5fc83dc /src/soc/qualcomm/common
parentcd1257a1359450194a514ca0184131bcf23d2094 (diff)
soc/qualcomm: move uart_bitbang UART w/gpio code to common
BUG=b:182963902 TEST=Validated on qualcomm sc7280 development board Change-Id: Ic6c70f917a59e233f6ea518d9c39f73fe84991c3 Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47284 Reviewed-by: Shelley Chen <shchen@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/qualcomm/common')
-rw-r--r--src/soc/qualcomm/common/uart_bitbang.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/soc/qualcomm/common/uart_bitbang.c b/src/soc/qualcomm/common/uart_bitbang.c
new file mode 100644
index 0000000000..943dcf8a06
--- /dev/null
+++ b/src/soc/qualcomm/common/uart_bitbang.c
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/uart.h>
+#include <gpio.h>
+#include <boot/coreboot_tables.h>
+#include <soc/uart.h>
+
+void uart_fill_lb(void *data)
+{
+
+}
+
+static void set_tx(int line_state)
+{
+ gpio_set(UART_TX_PIN, line_state);
+}
+
+void uart_init(unsigned int idx)
+{
+ gpio_output(UART_TX_PIN, 1);
+}
+
+void uart_tx_byte(unsigned int idx, unsigned char data)
+{
+ uart_bitbang_tx_byte(data, set_tx);
+}
+
+void uart_tx_flush(unsigned int idx)
+{
+ /* unnecessary, PIO Tx means transaction is over when tx_byte returns */
+}
+
+unsigned char uart_rx_byte(unsigned int idx)
+{
+ return 0; /* not implemented */
+}