[PATCH v2 00/15] serial: 8250: add Moxa MUEx50 PCIe board support
From: Crescent Hsieh
Date: Tue Jun 30 2026 - 23:43:41 EST
This series consolidates Moxa PCIe multiport serial board support under a
dedicated 8250_mxpcie driver and adds MUEx50 UART support needed by these
boards.
The first part splits the existing Moxa PCIe board handling out of
8250_pci into a separate driver while preserving the existing probe flow
and device IDs. The series then introduces the MUEx50 UART port type and
enables the board-specific UART setup, including enhanced mode and FIFO
trigger programming.
The driver adds hardware-assisted flow control support for MUEx50 UARTs,
including automatic RTS/CTS handling and XON/XOFF offload. It also adds a
custom IRQ path and uses the MUEx50 memory-mapped FIFO windows to improve
RX and TX data movement.
Later patches introduce per-port private state and defer
uart_write_wakeup() out of the interrupt-driven TX path. The driver also
supports switching the serial interface mode through the RS485
configuration path, covering RS232, RS422, and RS485 modes supported by
the boards.
The final part extends 8250 core callbacks where needed so low-level
drivers can override break control and rx_trig_bytes handling. The
8250_mxpcie driver uses these hooks to implement RS485 break handling via
MUEx50 features and to expose the MUEx50 programmable RX trigger level
through the generic rx_trig_bytes sysfs interface.
Changes in v2:
- [PATCH v1 01/15]
- Sort and trim 8250_mxpcie includes, add __counted_by(num_ports),
tidy switch fallbacks and loop counters, use pci_set_drvdata() /
pci_get_drvdata(), and add numbered review links.
- [PATCH v1 03/15]
- Document the repeated FIFO clear sequence and the TX FIFO
read/write pointer clock-domain issue, and declare the FIFO clear
loop counter inside the for loop.
- [PATCH v1 05/15]
- Replace open-coded uart port lock/unlock with
guard(uart_port_lock_irqsave) in throttle() and unthrottle(), and
remove the unused flags variable.
- [PATCH v1 09/15]
- Preserve __counted_by(num_ports) when converting the flexible
array from line[] to per-port port[] storage.
- [PATCH v1 10/15]
- Add per-port workqueue state in pahole-friendly member order.
- [PATCH v1 13/15]
- Use guard(uart_port_lock_irqsave), use serial_dl_write(up, 0)
instead of direct UART_DLL/UART_DLM writes, and avoid modifying
sfr inside the serial_out() argument.
- [PATCH v1 14/15]
- Move get_rxtrig/set_rxtrig near existing getter/setter callbacks
in struct uart_port and in the 8250_core.c callback copy path.
- [PATCH v1 15/15]
- Use named RX trigger constants, serial_port_in/out(), and aligned
get_rxtrig/set_rxtrig ordering in both the implementation and
probe callback assignment.
v1: https://lore.kernel.org/all/20260504084900.22380-1-crescentcy.hsieh@xxxxxxxx/
Crescent Hsieh (15):
serial: 8250: split Moxa PCIe serial board support out of 8250_pci
serial: 8250: add Moxa MUEx50 UART port type
serial: 8250_mxpcie: enable enhanced mode and program FIFO trigger
levels
serial: 8250_mxpcie: enable automatic RTS/CTS flow control
serial: 8250_mxpcie: offload XON/XOFF flow control to MUEx50 hardware
serial: 8250_mxpcie: add custom handle_irq callback
serial: 8250_mxpcie: speed up RX using memory-mapped FIFO window
serial: 8250_mxpcie: speed up TX using memory-mapped FIFO window
serial: 8250_mxpcie: introduce per-port private data structure
serial: 8250_mxpcie: defer uart_write_wakeup() to workqueue
serial: 8250_mxpcie: support serial interface mode switching
serial: 8250: allow low-level drivers to override break control
serial: 8250_mxpcie: add break support for RS485 using MUEx50 features
serial: 8250: allow UART drivers to override rx_trig_bytes handling
serial: 8250_mxpcie: implement rx_trig_bytes callbacks via MUEx50 RTL
drivers/tty/serial/8250/8250_core.c | 6 +
drivers/tty/serial/8250/8250_mxpcie.c | 686 ++++++++++++++++++++++++++
drivers/tty/serial/8250/8250_pci.c | 208 +-------
drivers/tty/serial/8250/8250_port.c | 33 +-
drivers/tty/serial/8250/Kconfig | 11 +
drivers/tty/serial/8250/Makefile | 1 +
include/linux/serial_8250.h | 1 +
include/linux/serial_core.h | 3 +
include/uapi/linux/serial_core.h | 3 +
9 files changed, 744 insertions(+), 208 deletions(-)
create mode 100644 drivers/tty/serial/8250/8250_mxpcie.c
--
2.45.2