From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 6/6] x86/boot: Support nocfg parameter for earlyprintk
Date: Sun, 14 Jan 2018 16:32:54 +0200 [thread overview]
Message-ID: <20180114143254.15429-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20180114143254.15429-1-andriy.shevchenko@linux.intel.com>
If by BIOS or by other means serial port is configured user might want to
skip reconfiguration in the boot code.
Add support of 'nocfg' parameter to earlyprintk.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/x86/boot/early_serial_console.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index ef10926ab9e5..f4759f485d8e 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -67,7 +67,7 @@ static void early_serial_configure(unsigned long port, int baud)
serial_out(port, LCR, c & ~DLAB);
}
-static void early_serial_init(unsigned long port, int baud)
+static void early_serial_init(unsigned long port, int baud, bool configure)
{
/* Assign serial I/O accessors */
if (port > IO_SPACE_LIMIT) {
@@ -82,7 +82,8 @@ static void early_serial_init(unsigned long port, int baud)
return;
}
- early_serial_configure(port, baud);
+ if (configure)
+ early_serial_configure(port, baud);
early_serial_base = port;
}
@@ -93,6 +94,7 @@ static void parse_earlyprintk(void)
char arg[64];
int pos = 0;
unsigned long port = 0;
+ bool configure = true;
if (cmdline_find_option("earlyprintk", arg, sizeof arg) > 0) {
char *e;
@@ -133,12 +135,16 @@ static void parse_earlyprintk(void)
if (arg[pos] == ',')
pos++;
- baud = simple_strtoull(arg + pos, &e, 0);
- if (baud == 0 || arg + pos == e)
- baud = DEFAULT_BAUD;
+ if (strncmp(arg + pos, "nocfg", 5)) {
+ baud = simple_strtoull(arg + pos, &e, 0);
+ if (baud == 0 || arg + pos == e)
+ baud = DEFAULT_BAUD;
+ } else {
+ configure = false;
+ }
}
- early_serial_init(port, baud);
+ early_serial_init(port, baud, configure);
}
#define BASE_BAUD (1843200/16)
@@ -162,6 +168,7 @@ static void parse_console_uart8250(void)
char optstr[64], *options;
int baud = DEFAULT_BAUD;
unsigned long port = 0;
+ bool configure = true;
/*
* console=uart8250,io,0x3f8,115200n8
@@ -179,12 +186,16 @@ static void parse_console_uart8250(void)
else
return;
- if (options && (options[0] == ','))
- baud = simple_strtoull(options + 1, &options, 0);
- else
+ if (options[0] == ',') {
+ if (strncmp(options + 1, "nocfg", 5))
+ baud = simple_strtoull(options + 1, &options, 0);
+ else
+ configure = false;
+ } else {
baud = probe_baud(port);
+ }
- early_serial_init(port, baud);
+ early_serial_init(port, baud, configure);
}
void console_init(void)
--
2.15.1
next prev parent reply other threads:[~2018-01-14 14:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-14 14:32 [PATCH v1 1/6] x86/boot: Convert early_serial_base to unsigned long Andy Shevchenko
2018-01-14 14:32 ` [PATCH v1 2/6] x86/boot: Introduce helpers for serial I/O Andy Shevchenko
2018-01-14 14:32 ` [PATCH v1 3/6] x86/boot: Add MMIO byte accessors Andy Shevchenko
2018-01-14 14:32 ` [PATCH v1 4/6] x86/boot: Assume MMIO if serial base address supplied via earlyprintk Andy Shevchenko
2018-01-16 3:13 ` Ingo Molnar
2018-01-16 10:55 ` Andy Shevchenko
2018-01-16 15:55 ` Ingo Molnar
2018-05-03 10:45 ` Andy Shevchenko
2018-01-14 14:32 ` [PATCH v1 5/6] x86/boot: Allow longer parameter list for earlyprintk Andy Shevchenko
2018-01-16 3:11 ` Ingo Molnar
2018-01-16 10:57 ` Andy Shevchenko
2018-01-16 15:51 ` Ingo Molnar
2018-05-03 11:48 ` Andy Shevchenko
2018-01-14 14:32 ` Andy Shevchenko [this message]
2018-01-16 3:12 ` [PATCH v1 6/6] x86/boot: Support nocfg parameter " Ingo Molnar
2018-01-16 11:00 ` Andy Shevchenko
2018-01-16 15:53 ` Ingo Molnar
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=20180114143254.15429-6-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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 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.