diff options
author | Eric Anholt <eric@anholt.net> | 2016-03-13 18:16:54 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-22 12:16:12 -0400 |
commit | cd0fa5bff8052b19bde6967c2734f323c9848568 (patch) | |
tree | 0f2cdabdb2f04b4e28de7b0d5c5c391887a9442d /drivers/serial | |
parent | 9a6598daaf0d0681bd423196364b2e4e3959ebbc (diff) |
serial: pl01x: Add support for devices with the rate pre-configured.
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>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_pl01x.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 552c945264..6f83835fa8 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -284,7 +284,10 @@ static int pl01x_serial_setbrg(struct udevice *dev, int baudrate) struct pl01x_serial_platdata *plat = dev_get_platdata(dev); struct pl01x_priv *priv = dev_get_priv(dev); - pl01x_generic_setbrg(priv->regs, priv->type, plat->clock, baudrate); + if (!plat->skip_init) { + pl01x_generic_setbrg(priv->regs, priv->type, plat->clock, + baudrate); + } return 0; } @@ -296,7 +299,10 @@ static int pl01x_serial_probe(struct udevice *dev) priv->regs = (struct pl01x_regs *)plat->base; priv->type = plat->type; - return pl01x_generic_serial_init(priv->regs, priv->type); + if (!plat->skip_init) + return pl01x_generic_serial_init(priv->regs, priv->type); + else + return 0; } static int pl01x_serial_getc(struct udevice *dev) |