[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190319184325.72807-8-andriy.shevchenko@linux.intel.com>
Date: Tue, 19 Mar 2019 21:43:25 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v2 7/7] x86/boot: Support nocfg parameter for earlyprintk
If by BIOS or by other means the 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@...ux.intel.com>
---
arch/x86/boot/early_serial_console.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index cfc9e55cd68a..5b4a81bf5d0e 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -80,9 +80,10 @@ static void early_serial_use_mmio_accessors(void)
serial_out = mem8_serial_out;
}
-static void early_serial_init(unsigned long port, int baud)
+static void early_serial_init(unsigned long port, int baud, bool configure)
{
- early_serial_configure(port, baud);
+ if (configure)
+ early_serial_configure(port, baud);
early_serial_base = port;
}
@@ -101,12 +102,22 @@ static unsigned long parse_serial_port(const char *arg, int off, int *pos)
return port;
}
+static bool parse_serial_configure(const char *arg, int off, int *pos)
+{
+ if (strncmp(arg + off, "nocfg", 5))
+ return true;
+
+ *pos = off + 5;
+ return false;
+}
+
static void parse_earlyprintk(void)
{
int baud = DEFAULT_BAUD;
char arg[64];
int pos = 0;
unsigned long port = 0;
+ bool configure = true;
if (cmdline_find_option("earlyprintk", arg, sizeof(arg)) > 0) {
char *e;
@@ -146,6 +157,11 @@ static void parse_earlyprintk(void)
early_serial_use_io_accessors();
}
+ if (arg[pos] == ',')
+ pos++;
+
+ configure = parse_serial_configure(arg, pos, &pos);
+
if (arg[pos] == ',')
pos++;
@@ -155,7 +171,7 @@ static void parse_earlyprintk(void)
}
if (port)
- early_serial_init(port, baud);
+ early_serial_init(port, baud, configure);
}
#define BASE_BAUD (1843200/16)
@@ -179,6 +195,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
@@ -204,7 +221,7 @@ static void parse_console_uart8250(void)
baud = probe_baud(port);
if (port)
- early_serial_init(port, baud);
+ early_serial_init(port, baud, configure);
}
void console_init(void)
--
2.20.1
Powered by blists - more mailing lists