Re-do the previous check for the RSC console:

Do the check in sabtty_console_flags() and set a flag if we are an RSC port.
If we are an RSC port, note that the baud rate is 115200, but don't write a
new value to the baud rate generator register, as this stops the console
working.
This commit is contained in:
jdc 2010-01-18 09:58:20 +00:00
parent e684a7b22f
commit 2cdec76aad
1 changed files with 17 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sab.c,v 1.43 2009/12/30 21:03:48 jdc Exp $ */
/* $NetBSD: sab.c,v 1.44 2010/01/18 09:58:20 jdc Exp $ */
/* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */
/*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.43 2009/12/30 21:03:48 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.44 2010/01/18 09:58:20 jdc Exp $");
#include "opt_kgdb.h"
#include <sys/types.h>
@ -104,14 +104,15 @@ struct sabtty_softc {
u_char * sc_txp;
int sc_txc;
int sc_flags;
#define SABTTYF_STOP 0x01
#define SABTTYF_DONE 0x02
#define SABTTYF_RINGOVERFLOW 0x04
#define SABTTYF_CDCHG 0x08
#define SABTTYF_CONS_IN 0x10
#define SABTTYF_CONS_OUT 0x20
#define SABTTYF_TXDRAIN 0x40
#define SABTTYF_DONTDDB 0x80
#define SABTTYF_STOP 0x0001
#define SABTTYF_DONE 0x0002
#define SABTTYF_RINGOVERFLOW 0x0004
#define SABTTYF_CDCHG 0x0008
#define SABTTYF_CONS_IN 0x0010
#define SABTTYF_CONS_OUT 0x0020
#define SABTTYF_TXDRAIN 0x0040
#define SABTTYF_DONTDDB 0x0080
#define SABTTYF_IS_RSC 0x0100
uint8_t sc_rbuf[SABTTY_RBUF_SIZE];
uint8_t *sc_rend, *sc_rput, *sc_rget;
uint8_t sc_polling, sc_pollrfc;
@ -375,7 +376,6 @@ sabtty_attach(struct device *parent, struct device *self, void *aux)
struct sabtty_attach_args *sa = aux;
int r;
int maj;
int node;
int is_kgdb = 0;
#ifdef KGDB
@ -443,10 +443,7 @@ sabtty_attach(struct device *parent, struct device *self, void *aux)
}
t.c_ispeed= 0;
node = sc->sc_parent->sc_node;
/* Are we connected to an E250 RSC? */
if (sc->sc_portno == prom_getpropint(node, "ssp-console", -1) ||
sc->sc_portno == prom_getpropint(node, "ssp-control", -1))
if (sc->sc_flags & SABTTYF_IS_RSC)
t.c_ospeed = 115200;
else
t.c_ospeed = 9600;
@ -1039,7 +1036,7 @@ sabttyparam(struct sabtty_softc *sc, struct tty *tp, struct termios *t)
dafo |= SAB_DAFO_PAR_NONE;
SAB_WRITE(sc, SAB_DAFO, dafo);
if (ospeed != 0) {
if (!(sc->sc_flags & SABTTYF_IS_RSC) && ospeed != 0) {
SAB_WRITE(sc, SAB_BGR, ospeed & 0xff);
r = SAB_READ(sc, SAB_CCR2);
r &= ~(SAB_CCR2_BR9 | SAB_CCR2_BR8);
@ -1306,6 +1303,10 @@ sabtty_console_flags(struct sabtty_softc *sc)
if (channel == cookie)
sc->sc_flags |= SABTTYF_CONS_OUT;
}
/* Are we connected to an E250 RSC? */
if (channel == prom_getpropint(node, "ssp-console", -1) ||
channel == prom_getpropint(node, "ssp-control", -1))
sc->sc_flags |= SABTTYF_IS_RSC;
}
void