From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Schwierzeck Date: Tue, 17 Nov 2020 23:29:01 +0100 Subject: [PATCH RFC 05/20] ns16550: Turn on the UME bit if on ARCH_JZ47XX In-Reply-To: <20201117210018.751469-6-lkundrak@v3.sk> References: <20201117210018.751469-1-lkundrak@v3.sk> <20201117210018.751469-6-lkundrak@v3.sk> Message-ID: <98d89414fbfb1472c607e053b3ef300434f87288.camel@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am Dienstag, den 17.11.2020, 22:00 +0100 schrieb Lubomir Rintel: > 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 > --- > 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; do you use that driver without CONFIG_OF_CONTROL? There is already code for UME bit on JS4780 when you use the compatible "ingenic,jz4780-uart": plat->fcr = UART_FCR_DEFVAL; if (port_type == PORT_JZ4780) plat->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); -- - Daniel