Module Name: src
Committed By: riz
Date: Sat Nov 20 00:47:56 UTC 2010
Modified Files:
src/sys/arch/atari/conf [netbsd-5]: GENERIC.in
src/sys/arch/atari/dev [netbsd-5]: ser.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1368):
sys/arch/atari/dev/ser.c: revision 1.49
sys/arch/atari/conf/GENERIC.in: revision 1.86
Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
serconsole(0x23bac4): 0x00000001 (1), at offset 0x23bb44 in /netbsd
new value: 0x00000000 (0)
---
May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
Disable options SERCONSOLE (force serial console if DCD is detected)
because now it's patchable by binpatch(8).
Enabling serial console by DCD signal could be problematic
on some earlier TT030 (with revision A board), and it's also
annoying for users who connect an active device on the serial port
as mentioned in PR port-atari/39849.
XXX: Eventually serial console should be enabled by MD bootloader flags,
XXX: but I have no idea how to build bootloader binaries for TOS.
To generate a diff of this commit:
cvs rdiff -u -r1.73.4.7 -r1.73.4.8 src/sys/arch/atari/conf/GENERIC.in
cvs rdiff -u -r1.39 -r1.39.6.1 src/sys/arch/atari/dev/ser.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/atari/conf/GENERIC.in
diff -u src/sys/arch/atari/conf/GENERIC.in:1.73.4.7 src/sys/arch/atari/conf/GENERIC.in:1.73.4.8
--- src/sys/arch/atari/conf/GENERIC.in:1.73.4.7 Sat Nov 20 00:33:46 2010
+++ src/sys/arch/atari/conf/GENERIC.in Sat Nov 20 00:47:55 2010
@@ -1,5 +1,5 @@
#
-# $NetBSD: GENERIC.in,v 1.73.4.7 2010/11/20 00:33:46 riz Exp $
+# $NetBSD: GENERIC.in,v 1.73.4.8 2010/11/20 00:47:55 riz Exp $
#
# Generic atari
#
@@ -231,7 +231,7 @@
options DISKLABEL_AHDI # NetBSD/AHDI disklabels
#if !defined(SMALL030_KERNEL)
#if !defined(FALCON_KERNEL)
-options SERCONSOLE # modem1 console support, breaks Falcon
+#options SERCONSOLE # modem1 console support, breaks Falcon
#endif /* !FALCON_KERNEL */
options RELOC_KERNEL # TT/Falcon: relocate kernel to TT-RAM
options MSGBUFSIZE=32768 # size of kernel msg. buffer
Index: src/sys/arch/atari/dev/ser.c
diff -u src/sys/arch/atari/dev/ser.c:1.39 src/sys/arch/atari/dev/ser.c:1.39.6.1
--- src/sys/arch/atari/dev/ser.c:1.39 Wed Jun 11 14:35:53 2008
+++ src/sys/arch/atari/dev/ser.c Sat Nov 20 00:47:55 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ser.c,v 1.39 2008/06/11 14:35:53 tsutsui Exp $ */
+/* $NetBSD: ser.c,v 1.39.6.1 2010/11/20 00:47:55 riz Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.39 2008/06/11 14:35:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.39.6.1 2010/11/20 00:47:55 riz Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@@ -262,6 +262,11 @@
serstop, sertty, serpoll, nommap, ttykqfilter, D_TTY
};
+#ifndef SERCONSOLE
+#define SERCONSOLE 0
+#endif
+int serconsole = SERCONSOLE; /* patchable */
+
/*ARGSUSED*/
static int
sermatch(pdp, cfp, auxp)
@@ -316,13 +321,13 @@
callout_init(&sc->sc_diag_ch, 0);
-#if SERCONSOLE > 0
- /*
- * Activate serial console when DCD present...
- */
- if (!(MFP->mf_gpip & MCR_DCD))
- SET(sc->sc_hwflags, SER_HW_CONSOLE);
-#endif /* SERCONSOLE > 0 */
+ if (serconsole) {
+ /*
+ * Activate serial console when DCD present...
+ */
+ if (!(MFP->mf_gpip & MCR_DCD))
+ SET(sc->sc_hwflags, SER_HW_CONSOLE);
+ }
printf("\n");
if (ISSET(sc->sc_hwflags, SER_HW_CONSOLE)) {
@@ -1416,11 +1421,10 @@
/* initialize required fields */
/* XXX: LWP What unit? */
cp->cn_dev = makedev(cdevsw_lookup_major(&ser_cdevsw), 0);
-#if SERCONSOLE > 0
- cp->cn_pri = CN_REMOTE; /* Force a serial port console */
-#else
- cp->cn_pri = CN_NORMAL;
-#endif /* SERCONSOLE > 0 */
+ if (serconsole)
+ cp->cn_pri = CN_REMOTE; /* Force a serial port console */
+ else
+ cp->cn_pri = CN_NORMAL;
}
void