[PATCH] tty: serial: fsl_lpuart: increase maximum uart_nr to 12

Sherry Sun posted 1 patch 1 year, 1 month ago
drivers/tty/serial/fsl_lpuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tty: serial: fsl_lpuart: increase maximum uart_nr to 12
Posted by Sherry Sun 1 year, 1 month ago
Some SoCs like the i.MX943 have aliases for up to 12 UARTs, need to
increase UART_NR from 8 to 12 to support lpuart9-12 to avoid
initialization failures.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
---
 drivers/tty/serial/fsl_lpuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 57b0632a3db6..7cb1e36fdaab 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -245,7 +245,7 @@
 
 #define DRIVER_NAME	"fsl-lpuart"
 #define DEV_NAME	"ttyLP"
-#define UART_NR		8
+#define UART_NR		12
 
 /* IMX lpuart has four extra unused regs located at the beginning */
 #define IMX_REG_OFF	0x10
-- 
2.34.1
Re: [PATCH] tty: serial: fsl_lpuart: increase maximum uart_nr to 12
Posted by Greg KH 1 year, 1 month ago
On Fri, Jan 03, 2025 at 03:11:54PM +0800, Sherry Sun wrote:
> Some SoCs like the i.MX943 have aliases for up to 12 UARTs, need to
> increase UART_NR from 8 to 12 to support lpuart9-12 to avoid
> initialization failures.
> 
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> ---
>  drivers/tty/serial/fsl_lpuart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index 57b0632a3db6..7cb1e36fdaab 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -245,7 +245,7 @@
>  
>  #define DRIVER_NAME	"fsl-lpuart"
>  #define DEV_NAME	"ttyLP"
> -#define UART_NR		8
> +#define UART_NR		12

Why not fix this properly and make this dynamic and get rid of the
static array causing all of this problem?  That way when you get a
system with 13 uarts, you will be ok :)

thanks,

greg k-h