serial: 8250_em: Add serial8250_em_{reg_update(),out_helper()}
authorBiju Das <biju.das.jz@bp.renesas.com>
Mon, 27 Feb 2023 11:41:52 +0000 (11:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2023 16:21:54 +0000 (17:21 +0100)
commitb22ea7df56b2ee1f9a0212210b51f83a3c2c75c6
treebde4286a3e7475b1da754d3970b4cbec911a61c3
parent59d6558fb5fd750777edfde028ea1f9e7eed8a46
serial: 8250_em: Add serial8250_em_{reg_update(),out_helper()}

As per RZ/V2M hardware manual(Rev.1.30 Jun, 2022), UART IP has a
restriction as mentioned below.

40.6.1 Point for Caution when Changing the Register Settings:

When changing the settings of the following registers, a PRESETn master
reset or FIFO reset + SW reset (FCR[2],FCR[1], HCR0[7]) must be input to
re-initialize them.

Target Registers: FCR, LCR, MCR, DLL, DLM, HCR0.

Add serial8250_em_reg_update() and serial8250_em_serial_out_helper() to
handle this restriction. serial8250_em_serial_out_helper() is identical to
previous serial8250_em_serial_out() except that UART_FCR macro is removed
from serial8250_em_serial_out_helper() as it is now handled by serial8250_
em_serial_out().

DLL/DLM register can be updated only by setting LCR[7]. So the
updation of LCR[7] will perform reset for DLL/DLM register changes.

EMMA mobile has the same register set as RZ/V2M and this patch is tested on
EMEV2 board. So, there is no harm in applying the same restriction here as
well as the HW manual for EMMA mobile is not updated for a long time.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230227114152.22265-8-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_em.c