summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-12-23 17:50:25 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-12-23 17:50:25 +0000
commit3a940ca2a75e83e0d9495b3bfe79d40558be6476 (patch)
treea2acdfa68c5519a4281a169dc545cf467fbebe95 /sys
parent67ef202a25aac6aae8bb74628a3080c3fe0441dd (diff)
make com[123] work for console on i386, but allow override with CONADDR/CONUNIT
ok mickey, deraadt
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/isa/pccom.c13
-rw-r--r--sys/arch/i386/stand/boot/boot.85
-rw-r--r--sys/dev/ic/comreg.h4
3 files changed, 16 insertions, 6 deletions
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c
index d5bb57fbf25..09d9eea6bd0 100644
--- a/sys/arch/i386/isa/pccom.c
+++ b/sys/arch/i386/isa/pccom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccom.c,v 1.45 2003/10/03 16:44:49 miod Exp $ */
+/* $OpenBSD: pccom.c,v 1.46 2004/12/23 17:50:24 markus Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -1947,7 +1947,18 @@ comcninit(cp)
XXX NEEDS TO BE FIXED XXX
comconsiot = ???;
#endif
+
+#ifdef CONADDR_OVERRIDE
comconsaddr = CONADDR;
+#else
+ const int comports[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
+ int unit = minor(cp->cn_dev);
+
+ if (unit >= 0 && unit < 4)
+ comconsaddr = comports[unit];
+ else
+ comconsaddr = CONADDR;
+#endif
if (bus_space_map(comconsiot, comconsaddr, COM_NPORTS, 0, &comconsioh))
panic("comcninit: mapping failed");
diff --git a/sys/arch/i386/stand/boot/boot.8 b/sys/arch/i386/stand/boot/boot.8
index cfcf54a6b88..a41236e9a2f 100644
--- a/sys/arch/i386/stand/boot/boot.8
+++ b/sys/arch/i386/stand/boot/boot.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: boot.8,v 1.39 2004/04/03 10:15:37 jmc Exp $
+.\" $OpenBSD: boot.8,v 1.40 2004/12/23 17:50:24 markus Exp $
.\"
.\" Copyright (c) 1997-2001 Michael Shalayeff
.\" All rights reserved.
@@ -282,9 +282,6 @@ Active console device name (e.g.,
.Li com0 ,
.Li com1 ,
.Li pc0 ) .
-Currently, only the first serial port
-.Pq Li com0
-is supported for console on i386.
.El
.It stty Op Ar device Op Ar speed
Displays or sets the
diff --git a/sys/dev/ic/comreg.h b/sys/dev/ic/comreg.h
index 9d7fde56892..4d778fd42f0 100644
--- a/sys/dev/ic/comreg.h
+++ b/sys/dev/ic/comreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: comreg.h,v 1.11 2003/06/03 21:09:02 deraadt Exp $ */
+/* $OpenBSD: comreg.h,v 1.12 2004/12/23 17:50:24 markus Exp $ */
/* $NetBSD: comreg.h,v 1.8 1996/02/05 23:01:50 scottr Exp $ */
/*
@@ -177,6 +177,8 @@
*/
#ifndef CONADDR
#define CONADDR (0x3f8)
+#else
+#define CONADDR_OVERRIDE
#endif
#ifndef CONUNIT
#define CONUNIT (0)