diff --git a/src/drivers/uart/Kconfig b/src/drivers/uart/Kconfig index dcdd5bc170..f323d14be4 100644 --- a/src/drivers/uart/Kconfig +++ b/src/drivers/uart/Kconfig @@ -35,6 +35,14 @@ config UART_OVERRIDE_REFCLK Set to "y" when the platform overrides the uart_platform_refclk routine. +config UART_BITBANG_TX_DELAY_MS + int + default 5 + help + This option sets a delay in milliseconds after configuring the + UART TX pin. This can help stabilize the line and prevent + corruption of the first character transmitted. + config DRIVERS_UART_8250MEM bool default n diff --git a/src/soc/qualcomm/common/uart_bitbang.c b/src/soc/qualcomm/common/uart_bitbang.c index d6447f1f18..448b00c055 100644 --- a/src/soc/qualcomm/common/uart_bitbang.c +++ b/src/soc/qualcomm/common/uart_bitbang.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -18,6 +19,8 @@ static void set_tx(int line_state) void uart_init(unsigned int idx) { gpio_output(UART_TX_PIN, 1); + + mdelay(CONFIG_UART_BITBANG_TX_DELAY_MS); } void uart_tx_byte(unsigned int idx, unsigned char data)