Re: [PATCH v1 03/31] serial: 8250_mxupci: enable enhanced mode and custom FIFO trigger levels
From: Andy Shevchenko
Date: Sun Nov 30 2025 - 12:14:22 EST
On Sun, Nov 30, 2025 at 12:43 PM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
>
> Add support for enabling enhanced mode and configuring custom FIFO trigger
> levels on Moxa UPCI serial boards.
>
> Enhanced mode is activated via EFR, which also provides access to three
> configuration pages selected through EFR[7:6].
> These pages allow fine-tuning of advanced UART feature such as Rx/Tx
features
> interrupt trigger levels and flow control thresholds.
...
> +static int mxupci8250_startup(struct uart_port *port)
> +{
> + struct uart_8250_port *up = up_to_u8250p(port);
> + int ret;
> + u8 efr;
> +
> + ret = serial8250_do_startup(port);
This needs a very good comment on why it is okay to continue even in
error cases.
> + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
> +
> + efr = serial_in(up, UART_EFR);
> + efr |= UART_EFR_ECB;
> + serial_out(up, UART_EFR, efr);
> +
> + efr &= ~MOXA_UART_EFR_PAGE_MASK;
> + efr |= MOXA_UART_EFR_PAGE_1;
> + serial_out(up, UART_EFR, efr);
> +
> + serial_out(up, MOXA_UART_THRTL, 0);
> + serial_out(up, MOXA_UART_RBRTI, 96);
> + serial_out(up, MOXA_UART_RBRTL, 32);
> + serial_out(up, MOXA_UART_RBRTH, 96);
> +
> + serial_out(up, UART_LCR, up->lcr);
> +
> + return ret;
> +}
--
With Best Regards,
Andy Shevchenko