[PATCH v1 10/31] serial: 8250: add MUEx50 UART configuration

Crescent Hsieh posted 31 patches 1 day, 11 hours ago
[PATCH v1 10/31] serial: 8250: add MUEx50 UART configuration
Posted by Crescent Hsieh 1 day, 11 hours ago
The MUEx50 UART does not fully conform to PORT_16550A or other standard
UART configurations.

This patch introduces a new UART configuration to accurately represent
the MUEx50 hardware capabilities and applies it to Moxa PCIe serial
boards.

Signed-off-by: Crescent Hsieh <crescentcy.hsieh@moxa.com>

s
---
 drivers/tty/serial/8250/8250_mxpcie.c | 3 ++-
 drivers/tty/serial/8250/8250_port.c   | 8 ++++++++
 include/uapi/linux/serial_core.h      | 3 +++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_mxpcie.c b/drivers/tty/serial/8250/8250_mxpcie.c
index 2e26307a9fee..f38684d11a90 100644
--- a/drivers/tty/serial/8250/8250_mxpcie.c
+++ b/drivers/tty/serial/8250/8250_mxpcie.c
@@ -207,7 +207,8 @@ static int mxpcie8250_probe(struct pci_dev *pdev, const struct pci_device_id *id
 	up.port.dev = &pdev->dev;
 	up.port.irq = pdev->irq;
 	up.port.uartclk = MOXA_PUART_BASE_BAUD * 16;
-	up.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
+	up.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ | UPF_FIXED_TYPE;
+	up.port.type = PORT_MUEX50;
 
 	for (i = 0; i < num_ports; i++) {
 		if (mxpcie8250_setup(pdev, priv, &up, i))
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 7d022315b3aa..38825bb80749 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -327,6 +327,14 @@ static const struct serial8250_config uart_config[] = {
 		.rxtrig_bytes	= {1, 4, 8, 14},
 		.flags		= UART_CAP_FIFO,
 	},
+	[PORT_MUEX50] = {
+		.name		= "Moxa MUEx50 UART",
+		.fifo_size	= 128,
+		.tx_loadsz	= 128,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+		.rxtrig_bytes	= {15, 31, 63, 111},
+		.flags		= UART_CAP_FIFO,
+	},
 };
 
 /* Uart divisor latch read */
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 49c2fcb2e24c..9410402721e4 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -103,6 +103,9 @@
 /* Moxa MU860 UART */
 #define PORT_MU860      65
 
+/* Moxa MUEx50 UART */
+#define PORT_MUEX50     66
+
 /*Digi jsm */
 #define PORT_JSM        69
 
-- 
2.45.2
Re: [PATCH v1 10/31] serial: 8250: add MUEx50 UART configuration
Posted by Andy Shevchenko 1 day, 2 hours ago
On Sun, Nov 30, 2025 at 12:44 PM Crescent Hsieh
<crescentcy.hsieh@moxa.com> wrote:
>
> The MUEx50 UART does not fully conform to PORT_16550A or other standard
> UART configurations.

Same Q, what are the differences?

> This patch introduces a new UART configuration to accurately represent

Imperative voice.

> the MUEx50 hardware capabilities and applies it to Moxa PCIe serial
> boards.
>
> Signed-off-by: Crescent Hsieh <crescentcy.hsieh@moxa.com>

>
> s

Stray line.

> ---

-- 
With Best Regards,
Andy Shevchenko