[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcN3R3PcWD7x5+8mVi48fRaUnghtT-2Bh94FcFLkQizLQ@mail.gmail.com>
Date: Sun, 30 Nov 2025 19:13:44 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Crescent Hsieh <crescentcy.hsieh@...a.com>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v1 03/31] serial: 8250_mxupci: enable enhanced mode and
custom FIFO trigger levels
On Sun, Nov 30, 2025 at 12:43 PM Crescent Hsieh
<crescentcy.hsieh@...a.com> 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
Powered by blists - more mailing lists