[PATCH RFC 05/20] ns16550: Turn on the UME bit if on ARCH_JZ47XX

Lubomir Rintel lkundrak at v3.sk
Tue Nov 17 22:00:03 CET 2020


The jz47xx serial port is essentially a ns16550 with an extra bit that
needs to be turned on. The driver already takes care of it, but not in
the early debug config path.

Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
---
 drivers/serial/ns16550.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 702109b23b6..0cf667c2731 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -326,6 +326,7 @@ static inline void _debug_uart_init(void)
 {
 	struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
 	int baud_divisor;
+	int fcr = UART_FCR_DEFVAL;
 
 	/*
 	 * We copy the code from above because it is already horribly messy.
@@ -335,9 +336,13 @@ static inline void _debug_uart_init(void)
 	 */
 	baud_divisor = ns16550_calc_divisor(com_port, CONFIG_DEBUG_UART_CLOCK,
 					    CONFIG_BAUDRATE);
+
+	if (IS_ENABLED(CONFIG_ARCH_JZ47XX))
+		fcr |= UART_FCR_UME;
+
 	serial_dout(&com_port->ier, CONFIG_SYS_NS16550_IER);
 	serial_dout(&com_port->mcr, UART_MCRVAL);
-	serial_dout(&com_port->fcr, UART_FCR_DEFVAL);
+	serial_dout(&com_port->fcr, fcr);
 
 	serial_dout(&com_port->lcr, UART_LCR_BKSE | UART_LCRVAL);
 	serial_dout(&com_port->dll, baud_divisor & 0xff);
-- 
2.28.0



More information about the U-Boot mailing list