public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] serial: pl01x: Add support for devices with the rate pre-configured.
@ 2016-02-05 21:43 Eric Anholt
  2016-02-06  4:19 ` Stephen Warren
  2016-02-06 20:44 ` Simon Glass
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Anholt @ 2016-02-05 21:43 UTC (permalink / raw)
  To: u-boot

For Raspberry Pi, we had the input clock rate to the pl011 fixed in
the rpi.c file, but it may be changed by firmware due to user changes
to config.txt.  Since the firmware always sets up the uart (default
115200 output unless the user changes it), we can just skip our own
uart init to simplify the boot process and more reliably get serial
output.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 board/raspberrypi/rpi/rpi.c             | 3 +--
 drivers/serial/serial_pl01x.c           | 4 ++++
 include/dm/platform_data/serial_pl01x.h | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 4b80d7b..1fd3f97 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -35,8 +35,7 @@ static const struct pl01x_serial_platdata serial_platdata = {
 #else
 	.base = 0x20201000,
 #endif
-	.type = TYPE_PL011,
-	.clock = 3000000,
+	.type = TYPE_PL01X_PRECONFIGURED,
 };
 
 U_BOOT_DEVICE(bcm2835_serials) = {
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 552c945..7d4d214 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -83,6 +83,8 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,
 		/* disable everything */
 		writel(0, &regs->pl011_cr);
 		break;
+	case TYPE_PL01X_PRECONFIGURED:
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -172,6 +174,8 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
 		writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
 		       UART_PL011_CR_RXE | UART_PL011_CR_RTS, &regs->pl011_cr);
 		break;
+	case TYPE_PL01X_PRECONFIGURED:
+		break;
 	}
 	default:
 		return -EINVAL;
diff --git a/include/dm/platform_data/serial_pl01x.h b/include/dm/platform_data/serial_pl01x.h
index 5e068f3..ae1bf31 100644
--- a/include/dm/platform_data/serial_pl01x.h
+++ b/include/dm/platform_data/serial_pl01x.h
@@ -9,6 +9,7 @@
 enum pl01x_type {
 	TYPE_PL010,
 	TYPE_PL011,
+	TYPE_PL01X_PRECONFIGURED,
 };
 
 /*
-- 
2.7.0

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

end of thread, other threads:[~2016-03-08 23:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05 21:43 [U-Boot] [PATCH] serial: pl01x: Add support for devices with the rate pre-configured Eric Anholt
2016-02-06  4:19 ` Stephen Warren
2016-03-06  6:26   ` Stephen Warren
2016-03-07  2:38     ` Simon Glass
2016-03-07 23:37       ` Tom Rini
2016-03-08 23:33         ` Simon Glass
2016-02-06 20:44 ` Simon Glass
2016-02-08 19:26   ` Sergei Temerkhanov
2016-02-08 19:45     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox