All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
@ 2018-04-10 13:33 ` Michal Simek
  0 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2018-04-10 13:33 UTC (permalink / raw)
  To: linux-kernel, monstr
  Cc: Jiri Slaby, linux-serial, Greg Kroah-Hartman, linux-arm-kernel

Baudrate calculation depends on requested baudrate and uart clock.
This patch is checking that uartclk is also passed.

The same logic is used 8250_early.c/init_port function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/tty/serial/xilinx_uartps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index b9b2bc76bcac..a654cda203c7 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
 	/* only set baud if specified on command line - otherwise
 	 * assume it has been initialized by a boot loader.
 	 */
-	if (device->baud) {
+	if (port->uartclk && device->baud) {
 		u32 cd = 0, bdiv = 0;
 		u32 mr;
 		int div8;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-23  8:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 13:33 [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed Michal Simek
2018-04-10 13:33 ` Michal Simek
2018-04-23  8:06 ` Greg Kroah-Hartman
2018-04-23  8:06   ` Greg Kroah-Hartman
2018-04-23  8:37   ` Michal Simek
2018-04-23  8:37     ` Michal Simek
2018-04-23  8:48     ` Greg Kroah-Hartman
2018-04-23  8:48       ` Greg Kroah-Hartman
2018-04-23  8:52       ` Michal Simek
2018-04-23  8:52         ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.