Re: [PATCH 13/15] serial: 8250_mxpcie: add break support for RS485 using MUEx50 features
From: Andy Shevchenko
Date: Tue May 05 2026 - 05:32:19 EST
On Mon, May 4, 2026 at 11:51 AM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
>
> On MUEx50, break signaling under RS485 requires a driver-specific
> sequence and cannot be handled correctly by the generic 8250 break
> implementation alone.
>
> Implement a mxpcie break_ctl callback that performs MUEx50-specific
> break handling when RS485 is enabled and fall back to the default 8250
> break handling for other modes.
...
> + uart_port_lock_irqsave(port, &flags);
guard()() ?
> +
> + if (break_state == -1) {
> + serial_out(up, UART_LCR, up->lcr | UART_LCR_DLAB);
> + serial_out(up, UART_DLL, 0);
> + serial_out(up, UART_DLM, 0);
> + serial_out(up, UART_LCR, up->lcr);
Don't we have a helper doing this?
serial_dl_write()
> + serial_out(up, MOXA_PUART_TX_FIFO_MEM, tx_byte);
> +
> + sfr = serial_in(up, MOXA_PUART_SFR);
> + serial_out(up, MOXA_PUART_SFR, sfr | MOXA_PUART_SFR_FORCE_TX);
> +
> + up->lcr |= UART_LCR_SBC;
> + serial_out(up, UART_LCR, up->lcr);
> + } else {
> + up->lcr &= ~UART_LCR_SBC;
> + serial_out(up, UART_LCR, up->lcr);
> +
> + sfr = serial_in(up, MOXA_PUART_SFR);
> + serial_out(up, MOXA_PUART_SFR, sfr &= ~MOXA_PUART_SFR_FORCE_TX);
> +
> + serial_out(up, UART_FCR, UART_FCR_CLEAR_XMIT);
> +
> + baud = tty_get_baud_rate(tty);
> + quot = uart_get_divisor(port, baud);
> + serial8250_do_set_divisor(port, baud, quot);
> + serial_out(up, UART_LCR, up->lcr);
> + }
> + uart_port_unlock_irqrestore(port, flags);
--
With Best Regards,
Andy Shevchenko