mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Drop UART write retry patch from U-Boot (#873)
The patch causes U-Boot freezes in some configurations. The root cause is that U-Boot does not allow to use the bss section in pre-relocation code (which is where the UART is used). Drop the patch as it is not required currently. See also: http://u-boot.10912.n7.nabble.com/RPi4-U-Boot-freeze-td424432.html#a427198
This commit is contained in:
parent
3af31c2265
commit
ebc93692f5
@ -1,49 +0,0 @@
|
|||||||
From 5e960cc9b208c53d5385d5a2f6c7f380e9499d4c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alexandru Costache <alexandru@balena.io>
|
|
||||||
Date: Wed, 18 Mar 2020 16:54:28 +0100
|
|
||||||
Subject: [PATCH] Add a retry limit when writing to uart console
|
|
||||||
|
|
||||||
Seems that if the serial console is incorrectly
|
|
||||||
configured in the dtb, writing to it may block indefinitely,
|
|
||||||
thus preventing the board from booting.
|
|
||||||
|
|
||||||
Let's add a retry count to unblock in such cases.
|
|
||||||
|
|
||||||
Upstream-status: Inappropriate [configuration]
|
|
||||||
Signed-off-by: Alexandru Costache <alexandru@balena.io>
|
|
||||||
---
|
|
||||||
drivers/serial/serial_bcm283x_mu.c | 12 +++++++++---
|
|
||||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c
|
|
||||||
index bd1d89ec83..bd033d14c4 100644
|
|
||||||
--- a/drivers/serial/serial_bcm283x_mu.c
|
|
||||||
+++ b/drivers/serial/serial_bcm283x_mu.c
|
|
||||||
@@ -49,7 +49,7 @@ struct bcm283x_mu_regs {
|
|
||||||
struct bcm283x_mu_priv {
|
|
||||||
struct bcm283x_mu_regs *regs;
|
|
||||||
};
|
|
||||||
-
|
|
||||||
+static uint16_t putc_retry = 0;
|
|
||||||
static int bcm283x_mu_serial_getc(struct udevice *dev);
|
|
||||||
|
|
||||||
static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate)
|
|
||||||
@@ -105,8 +105,14 @@ static int bcm283x_mu_serial_putc(struct udevice *dev, const char data)
|
|
||||||
struct bcm283x_mu_regs *regs = priv->regs;
|
|
||||||
|
|
||||||
/* Wait until there is space in the FIFO */
|
|
||||||
- if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY))
|
|
||||||
- return -EAGAIN;
|
|
||||||
+ if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY)) {
|
|
||||||
+ if (++putc_retry) {
|
|
||||||
+ return -EAGAIN;
|
|
||||||
+ } else {
|
|
||||||
+ /* Couldn't write for too long, drop char */
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
/* Send the character */
|
|
||||||
writel(data, ®s->io);
|
|
||||||
--
|
|
||||||
2.17.1
|
|
Loading…
x
Reference in New Issue
Block a user