summaryrefslogtreecommitdiff
path: root/sys/dev/sun
diff options
context:
space:
mode:
authorpk <pk@NetBSD.org>2001-09-28 14:34:49 +0000
committerpk <pk@NetBSD.org>2001-09-28 14:34:49 +0000
commitfd12ba4f30dc7a9f3e949b370ff3a7efd84fee4c (patch)
treea57d992bdebb748f2841a14550eb3996a1bdcc7d /sys/dev/sun
parent984d30ac454e7881012653dda594b16fb1b118b5 (diff)
Don't force a fixed baud rate if the parent zs driver has already determined
the baud rate set by the PROM.
Diffstat (limited to 'sys/dev/sun')
-rw-r--r--sys/dev/sun/kbd_zs.c12
-rw-r--r--sys/dev/sun/ms_zs.c10
2 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/sun/kbd_zs.c b/sys/dev/sun/kbd_zs.c
index e6371cbbac2..48d2733b3c2 100644
--- a/sys/dev/sun/kbd_zs.c
+++ b/sys/dev/sun/kbd_zs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd_zs.c,v 1.7 2001/06/12 15:17:26 wiz Exp $ */
+/* $NetBSD: kbd_zs.c,v 1.8 2001/09/28 14:34:49 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -102,6 +102,9 @@ struct cfattach kbd_zs_ca = {
sizeof(struct kbd_softc), kbd_zs_match, kbd_zs_attach
};
+/* Fall-back baud rate */
+int kbd_zs_bps = KBD_BPS;
+
/*
* kbd_zs_match: how is this zs channel configured?
*/
@@ -133,6 +136,7 @@ kbd_zs_attach(parent, self, aux)
struct cfdata *cf;
int channel, kbd_unit;
int reset, s;
+ int bps;
cf = k->k_dev.dv_cfdata;
kbd_unit = k->k_dev.dv_unit;
@@ -142,6 +146,10 @@ kbd_zs_attach(parent, self, aux)
cs->cs_ops = &zsops_kbd;
k->k_cs = cs;
k->k_write_data = kbd_zs_write_data;
+ if ((bps = cs->cs_defspeed) == 0)
+ bps = kbd_zs_bps;
+
+ printf(": baud rate %d", bps);
if ((args->hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0) {
/*
@@ -176,7 +184,7 @@ kbd_zs_attach(parent, self, aux)
/* These are OK as set by zscc: WR3, WR4, WR5 */
/* We don't care about status interrupts. */
cs->cs_preg[1] = ZSWR1_RIE | ZSWR1_TIE;
- (void) zs_set_speed(cs, KBD_BPS);
+ (void) zs_set_speed(cs, bps);
zs_loadchannelregs(cs);
splx(s);
diff --git a/sys/dev/sun/ms_zs.c b/sys/dev/sun/ms_zs.c
index afb89965b7a..3b4c1c428d4 100644
--- a/sys/dev/sun/ms_zs.c
+++ b/sys/dev/sun/ms_zs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ms_zs.c,v 1.3 2000/03/30 12:45:42 augustss Exp $ */
+/* $NetBSD: ms_zs.c,v 1.4 2001/09/28 14:34:49 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -87,6 +87,7 @@ struct zsops zsops_ms = {
ms_zs_softint, /* process software interrupt */
};
+/* Fall-back baud rate */
int ms_zs_bps = MS_BPS;
static int ms_zs_match(struct device *, struct cfdata *, void *);
@@ -130,6 +131,7 @@ ms_zs_attach(parent, self, aux)
struct cfdata *cf;
int channel, ms_unit;
int reset, s;
+ int bps;
cf = ms->ms_dev.dv_cfdata;
ms_unit = ms->ms_dev.dv_unit;
@@ -138,8 +140,10 @@ ms_zs_attach(parent, self, aux)
cs->cs_private = ms;
cs->cs_ops = &zsops_ms;
ms->ms_cs = cs;
+ if ((bps = cs->cs_defspeed) == 0)
+ bps = ms_zs_bps;
- printf("\n");
+ printf(": baud rate %d\n", bps);
/* Initialize the speed, etc. */
s = splzs();
@@ -150,7 +154,7 @@ ms_zs_attach(parent, self, aux)
/* These are OK as set by zscc: WR3, WR4, WR5 */
/* We don't care about status or tx interrupts. */
cs->cs_preg[1] = ZSWR1_RIE;
- (void) zs_set_speed(cs, ms_zs_bps);
+ (void) zs_set_speed(cs, bps);
zs_loadchannelregs(cs);
splx(s);