From: Peter Hurley <peter@hurleysoftware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Rob Herring <robh@kernel.org>,
Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH v2 -next 07/13] serial: 8250_early: Assume uart already initialized if no baud option
Date: Sun, 1 Mar 2015 11:05:52 -0500 [thread overview]
Message-ID: <1425225958-17908-8-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1425225958-17908-1-git-send-email-peter@hurleysoftware.com>
The <baud><parity><bit> option string is not supplied if the earlycon
is started via devicetree and OF_EARLYCON_DECLARE(). The option string
is also not required if started via kernel command line parameters of
the form:
earlycon=uart,mmio,<addr>
console=uart,mmio,<addr>
If earlycon_device->baud is 0, then an option string was not supplied.
In this case, assume the uart has already been initialized by the
bootloader or firmware.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
drivers/tty/serial/8250/8250_early.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index d7b831b..1701d00 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -149,12 +149,18 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
return 0;
if (!device->baud) {
+ struct uart_port *port = &device->port;
+ unsigned int ier;
+
device->baud = probe_baud(&device->port);
snprintf(device->options, sizeof(device->options), "%u",
device->baud);
- }
- init_port(device);
+ /* assume the device was initialized, only mask interrupts */
+ ier = serial8250_early_in(port, UART_IER);
+ serial8250_early_out(port, UART_IER, ier & UART_IER_UUE);
+ } else
+ init_port(device);
device->con->write = early_serial8250_write;
return 0;
--
2.3.0
next prev parent reply other threads:[~2015-03-01 16:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-01 16:05 [PATCH v2 -next 00/13] Extensible console matching & direct earlycon Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 01/13] serial: earlycon: Refactor parse_options into serial core Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 02/13] console: Preserve index after console setup() Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 03/13] console: Add extensible console matching Peter Hurley
2015-03-07 2:57 ` Greg Kroah-Hartman
2015-03-07 13:00 ` Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 04/13] serial: core: Fix kernel doc for uart_console_write() Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 05/13] serial: 8250_early: Remove early_device variable Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 06/13] serial: earlycon: Move ->uartclk initialize Peter Hurley
2015-03-01 16:05 ` Peter Hurley [this message]
2015-03-01 16:05 ` [PATCH v2 -next 08/13] serial: 8250_early: Fix setup() error code Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 09/13] serial: earlycon: Ignore parse_options() " Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 10/13] serial: earlycon: Allow earlycon params with name only Peter Hurley
2015-03-05 15:46 ` Rob Herring
2015-03-05 15:53 ` Peter Hurley
2015-03-05 16:07 ` Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 11/13] serial: earlycon: Refactor earlycon registration Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 12/13] serial: earlycon: Enable earlycon without command line param Peter Hurley
2015-03-01 16:05 ` [PATCH v2 -next 13/13] serial: 8250_early: Remove setup_early_serial8250_console() Peter Hurley
2015-03-05 16:11 ` [PATCH v2 -next 00/13] Extensible console matching & direct earlycon Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425225958-17908-8-git-send-email-peter@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).