lkml.org 
[lkml]   [2015]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86: Fix earlyprintk ttyS2/3
Date
Quite a few platforms use ttyS2 for their serial-over-LAN, so fix early
printk support for ttyS2 and 3, avoiding the need to hard-code the IO port.

Signed-off-by: Daniel J Blueman <daniel@numascale.com>
---
arch/x86/boot/early_serial_console.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index 5df2869..4f4c2e6 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -71,15 +71,16 @@ static void parse_earlyprintk(void)
else
pos = e - arg;
} else if (!strncmp(arg + pos, "ttyS", 4)) {
- static const int bases[] = { 0x3f8, 0x2f8 };
- int idx = 0;
+ static const int bases[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8};
+ unsigned idx = 0;

if (!strncmp(arg + pos, "ttyS", 4))
pos += 4;

- if (arg[pos++] == '1')
- idx = 1;
+ if ((arg[pos] - '0') < (sizeof(bases) / sizeof(bases[0])))
+ idx = arg[pos] - '0';

+ pos++;
port = bases[idx];
}

--
2.1.0

\
 
 \ /
  Last update: 2015-04-07 17:01    [W:0.036 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site