* [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag
@ 2026-02-18 14:59 Sébastien Szymanski
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sébastien Szymanski @ 2026-02-18 14:59 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Peng Fan, Andrew Goodbody, Kory Maincent,
Julien Boibessot, Sébastien Szymanski
This couple patches fixes the RXFE filed offset on i.MX9 platforms and handle
the Overrun flag which can prevent user from accessing the U-Boot prompt.
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
Sébastien Szymanski (2):
serial: lpuart: fix RXFE filed offset for i.MX9
serial: lpuart: handle Overrun flag
drivers/serial/serial_lpuart.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
base-commit: 8666b16015d4212facacc514e2eb626f3630dcf0
change-id: 20260218-lpuart-fix-rxfe-offset-f04ef861ae99
Best regards,
--
Sébastien Szymanski <sebastien.szymanski@armadeus.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9
2026-02-18 14:59 [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag Sébastien Szymanski
@ 2026-02-18 14:59 ` Sébastien Szymanski
2026-02-25 2:24 ` Peng Fan (OSS)
2026-02-25 3:32 ` Ye Li
2026-02-18 14:59 ` [PATCH 2/2] serial: lpuart: handle Overrun flag Sébastien Szymanski
2026-02-19 13:28 ` [PATCH 0/2] serial: lpuart: fix RXFE filed offset and " Kory Maincent
2 siblings, 2 replies; 7+ messages in thread
From: Sébastien Szymanski @ 2026-02-18 14:59 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Peng Fan, Andrew Goodbody, Kory Maincent,
Julien Boibessot, Sébastien Szymanski
Like i.MX8 and i.MXRT, on i.MX9, the Receive RX FIFO Enable (RXFE) field
in LPUART FIFO register is bit 3, so set FIFO_RXFE to 0x08 on i.MX9 too.
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
drivers/serial/serial_lpuart.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index 9fdb6503085d..bbce59443388 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -53,7 +53,8 @@
#define FIFO_RXSIZE_MASK 0x7
#define FIFO_RXSIZE_OFF 0
#define FIFO_TXFE 0x80
-#if defined(CONFIG_ARCH_IMX8) || defined(CONFIG_ARCH_IMXRT)
+#if defined(CONFIG_ARCH_IMX8) || defined (CONFIG_ARCH_IMX9) || \
+ defined(CONFIG_ARCH_IMXRT)
#define FIFO_RXFE 0x08
#else
#define FIFO_RXFE 0x40
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] serial: lpuart: handle Overrun flag
2026-02-18 14:59 [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag Sébastien Szymanski
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
@ 2026-02-18 14:59 ` Sébastien Szymanski
2026-02-25 2:24 ` Peng Fan (OSS)
2026-02-19 13:28 ` [PATCH 0/2] serial: lpuart: fix RXFE filed offset and " Kory Maincent
2 siblings, 1 reply; 7+ messages in thread
From: Sébastien Szymanski @ 2026-02-18 14:59 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Peng Fan, Andrew Goodbody, Kory Maincent,
Julien Boibessot, Sébastien Szymanski
The receive FIFO may overflow if data are sent while U-Boot is still
booting. In that case, the Overrun flag (STAT[19]) is set and no
additional data is stored in the receive FIFO and the user cannot get
access to the U-Boot prompt.
Fix this by clearing the Overrun flag in _lpuart32_serial_tstc()
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
drivers/serial/serial_lpuart.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index bbce59443388..0728feccd131 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -367,10 +367,13 @@ static int _lpuart32_serial_putc(struct lpuart_serial_plat *plat,
static int _lpuart32_serial_tstc(struct lpuart_serial_plat *plat)
{
struct lpuart_fsl_reg32 *base = plat->reg;
- u32 water;
+ u32 water, stat;
- lpuart_read32(plat->flags, &base->water, &water);
+ lpuart_read32(plat->flags, &base->stat, &stat);
+ if (stat & STAT_OR)
+ lpuart_write32(plat->flags, &base->stat, STAT_OR);
+ lpuart_read32(plat->flags, &base->water, &water);
if ((water >> 24) == 0)
return 0;
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag
2026-02-18 14:59 [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag Sébastien Szymanski
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
2026-02-18 14:59 ` [PATCH 2/2] serial: lpuart: handle Overrun flag Sébastien Szymanski
@ 2026-02-19 13:28 ` Kory Maincent
2 siblings, 0 replies; 7+ messages in thread
From: Kory Maincent @ 2026-02-19 13:28 UTC (permalink / raw)
To: Sébastien Szymanski
Cc: u-boot, Tom Rini, Peng Fan, Andrew Goodbody, Julien Boibessot
On Wed, 18 Feb 2026 15:59:17 +0100
Sébastien Szymanski <sebastien.szymanski@armadeus.com> wrote:
> This couple patches fixes the RXFE filed offset on i.MX9 platforms and handle
> the Overrun flag which can prevent user from accessing the U-Boot prompt.
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] serial: lpuart: handle Overrun flag
2026-02-18 14:59 ` [PATCH 2/2] serial: lpuart: handle Overrun flag Sébastien Szymanski
@ 2026-02-25 2:24 ` Peng Fan (OSS)
0 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2026-02-25 2:24 UTC (permalink / raw)
To: Sébastien Szymanski, u-boot@lists.denx.de
Cc: Tom Rini, Andrew Goodbody, Kory Maincent, Julien Boibessot
> Subject: [PATCH 2/2] serial: lpuart: handle Overrun flag
>
> The receive FIFO may overflow if data are sent while U-Boot is still
> booting. In that case, the Overrun flag (STAT[19]) is set and no
> additional data is stored in the receive FIFO and the user cannot get
> access to the U-Boot prompt.
>
> Fix this by clearing the Overrun flag in _lpuart32_serial_tstc()
>
> Signed-off-by: Sébastien Szymanski
> <sebastien.szymanski@armadeus.com>
LGTM: Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
@ 2026-02-25 2:24 ` Peng Fan (OSS)
2026-02-25 3:32 ` Ye Li
1 sibling, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2026-02-25 2:24 UTC (permalink / raw)
To: Sébastien Szymanski, u-boot@lists.denx.de
Cc: Tom Rini, Andrew Goodbody, Kory Maincent, Julien Boibessot
> Subject: [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9
>
> Like i.MX8 and i.MXRT, on i.MX9, the Receive RX FIFO Enable (RXFE)
> field in LPUART FIFO register is bit 3, so set FIFO_RXFE to 0x08 on
> i.MX9 too.
>
> Signed-off-by: Sébastien Szymanski
> <sebastien.szymanski@armadeus.com>
LGTM: Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
2026-02-25 2:24 ` Peng Fan (OSS)
@ 2026-02-25 3:32 ` Ye Li
1 sibling, 0 replies; 7+ messages in thread
From: Ye Li @ 2026-02-25 3:32 UTC (permalink / raw)
To: Sébastien Szymanski, u-boot
Cc: Tom Rini, Peng Fan, Andrew Goodbody, Kory Maincent,
Julien Boibessot
On 2/18/2026 10:59 PM, Sébastien Szymanski wrote:
> Like i.MX8 and i.MXRT, on i.MX9, the Receive RX FIFO Enable (RXFE) field
> in LPUART FIFO register is bit 3, so set FIFO_RXFE to 0x08 on i.MX9 too.
>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
> drivers/serial/serial_lpuart.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
> index 9fdb6503085d..bbce59443388 100644
> --- a/drivers/serial/serial_lpuart.c
> +++ b/drivers/serial/serial_lpuart.c
> @@ -53,7 +53,8 @@
> #define FIFO_RXSIZE_MASK 0x7
> #define FIFO_RXSIZE_OFF 0
> #define FIFO_TXFE 0x80
> -#if defined(CONFIG_ARCH_IMX8) || defined(CONFIG_ARCH_IMXRT)
> +#if defined(CONFIG_ARCH_IMX8) || defined (CONFIG_ARCH_IMX9) || \
> + defined(CONFIG_ARCH_IMXRT)
> #define FIFO_RXFE 0x08
> #else
> #define FIFO_RXFE 0x40
Previous value 0x40 is wrong for all platforms. You can directly change
it to 0x08 and remove all ARCH marcos.
Best regards,
Ye Li
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-02-25 3:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 14:59 [PATCH 0/2] serial: lpuart: fix RXFE filed offset and handle Overrun flag Sébastien Szymanski
2026-02-18 14:59 ` [PATCH 1/2] serial: lpuart: fix RXFE filed offset for i.MX9 Sébastien Szymanski
2026-02-25 2:24 ` Peng Fan (OSS)
2026-02-25 3:32 ` Ye Li
2026-02-18 14:59 ` [PATCH 2/2] serial: lpuart: handle Overrun flag Sébastien Szymanski
2026-02-25 2:24 ` Peng Fan (OSS)
2026-02-19 13:28 ` [PATCH 0/2] serial: lpuart: fix RXFE filed offset and " Kory Maincent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox