From ebc93692f5a4a6280f78628db2d6a918abee17d3 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 24 Sep 2020 13:37:44 +0200 Subject: [PATCH] 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 --- .../uboot/0002-avoid-block-uart-write.patch | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 buildroot-external/board/raspberrypi/patches/uboot/0002-avoid-block-uart-write.patch diff --git a/buildroot-external/board/raspberrypi/patches/uboot/0002-avoid-block-uart-write.patch b/buildroot-external/board/raspberrypi/patches/uboot/0002-avoid-block-uart-write.patch deleted file mode 100644 index 2b5cbb4a0..000000000 --- a/buildroot-external/board/raspberrypi/patches/uboot/0002-avoid-block-uart-write.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 5e960cc9b208c53d5385d5a2f6c7f380e9499d4c Mon Sep 17 00:00:00 2001 -From: Alexandru Costache -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 ---- - 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