Don't force a fixed baud rate if the parent zs driver has already determined

the baud rate set by the PROM.
This commit is contained in:
pk 2001-09-28 14:34:49 +00:00
parent 984d30ac45
commit fd12ba4f30
2 changed files with 17 additions and 5 deletions

View File

@ -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);

View File

@ -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);