summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-07-24 16:38:09 -0400
committerTom Rini <[email protected]>2021-07-24 16:39:36 -0400
commit7d4ce5ea53bdf4be8a951154c65ceef4b389fea7 (patch)
treee84e326d3b8553b10bc3e6b9df655a8b17d06429 /drivers/serial
parentedecc15eb9593b94dcd6a5f4f5ea5f134125b6a0 (diff)
parent91a043896dfb8544db00496bee08bcf59e449dc9 (diff)
Merge branch '2021-07-24-arm-and-platform-updates'
- dragonboard410c, synquacer, aspeed fixes / updates - pl011 serial driver fixes - Two generic arm bugfixes
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/serial_msm.c4
-rw-r--r--drivers/serial/serial_pl01x.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
index d8dd5c1104b..ac4d0824b98 100644
--- a/drivers/serial/serial_msm.c
+++ b/drivers/serial/serial_msm.c
@@ -18,6 +18,7 @@
#include <asm/global_data.h>
#include <asm/io.h>
#include <linux/compiler.h>
+#include <linux/delay.h>
#include <dm/pinctrl.h>
/* Serial registers - this driver works in uartdm mode*/
@@ -193,6 +194,9 @@ static int msm_uart_clk_init(struct udevice *dev)
static void uart_dm_init(struct msm_serial_data *priv)
{
+ /* Delay initialization for a bit to let pins stabilize if necessary */
+ mdelay(5);
+
writel(priv->clk_bit_rate, priv->base + UARTDM_CSR);
writel(0x0, priv->base + UARTDM_MR1);
writel(MSM_BOOT_UART_DM_8_N_1_MODE, priv->base + UARTDM_MR2);
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 76b96ad414c..67caa063c9a 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -404,8 +404,12 @@ static void _debug_uart_init(void)
{
#ifndef CONFIG_DEBUG_UART_SKIP_INIT
struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
- enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
- TYPE_PL011 : TYPE_PL010;
+ enum pl01x_type type;
+
+ if (IS_ENABLED(CONFIG_DEBUG_UART_PL011))
+ type = TYPE_PL011;
+ else
+ type = TYPE_PL010;
pl01x_generic_serial_init(regs, type);
pl01x_generic_setbrg(regs, type,
@@ -417,7 +421,8 @@ static inline void _debug_uart_putc(int ch)
{
struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
- pl01x_putc(regs, ch);
+ while (pl01x_putc(regs, ch) == -EAGAIN)
+ ;
}
DEBUG_UART_FUNCS