diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme88k/dev/cl.c | 11 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 35 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/autoconf.c | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 21 |
4 files changed, 46 insertions, 42 deletions
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c index c1f6af2fdd4..f3c827ea752 100644 --- a/sys/arch/mvme88k/dev/cl.c +++ b/sys/arch/mvme88k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.39 2004/02/10 10:30:25 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.40 2004/02/11 20:41:07 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -254,9 +254,12 @@ clattach(parent, self, aux) sc->cl_reg = (struct clreg *)ca->ca_vaddr; sc->sc_pcctwo = ca->ca_master; - if ((u_char *)ca->ca_paddr == (u_char *)cl_cons.cl_paddr) { - /* if this device is configured as console, - * line cl_cons.channel is the console */ + if ((paddr_t)ca->ca_paddr == CD2400_BASE_ADDR) { + /* + * Although we are still running using the BUG routines, + * this device will be elected as the console after + * autoconf. Mark it as such. + */ sc->sc_cl[0].cl_consio = 1; printf(": console "); } else { diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index 32f1835cd10..46dcc7661c0 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.29 2004/02/10 10:30:25 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.30 2004/02/11 20:41:07 miod Exp $ */ /* * Mach Operating System @@ -94,7 +94,8 @@ struct cfdriver dart_cd = { NULL, "dart", DV_TTY }; -int dart_cons = -1; +/* console is on the first port */ +#define CONS_PORT A_PORT /* prototypes */ cons_decl(dart); @@ -237,9 +238,14 @@ dartattach(parent, self, aux) /* Enable input port change interrupt */ dart_sv_reg.sv_imr = IIPCHG; - if (dart_cons >= 0) { - printf(": console (tty%s) ", dart_cons == 0 ? "a" : "b"); - } + /* + * Although we are still running using the BUG routines, + * this device will be elected as the console after + * autoconf. + * We do not even test since we know we are an MVME188 and + * console is always on the first port. + */ + printf(": console"); dprintf(("\ndartattach: resetting port A\n")); @@ -349,7 +355,7 @@ dartstart(tp) dprintf(("dartstart: dev(%d, %d)\n", major(dev), minor(dev))); - if (port != dart_cons) + if (port != CONS_PORT) dprintf(("dartstart: ptaddr = 0x%08x from uart at 0x%08x\n", ptaddr, addr)); @@ -363,12 +369,12 @@ dartstart(tp) c = getc(&tp->t_outq); cc--; if (tp->t_flags & CS8 || c <= 0177) { - if (port != dart_cons) + if (port != CONS_PORT) dprintf(("dartstart: writing char \"%c\" (0x%02x) to port %d\n", c & 0xff, c & 0xff, port)); ptaddr->write.wr_tb = c & 0xff; - if (port != dart_cons) + if (port != CONS_PORT) dprintf(("dartstart: enabling Tx int\n")); if (port == A_PORT) dart_sv_reg.sv_imr = dart_sv_reg.sv_imr | ITXRDYA; @@ -378,7 +384,7 @@ dartstart(tp) } else { tp->t_state &= ~TS_BUSY; - if (port != dart_cons) + if (port != CONS_PORT) dprintf(("dartxint: timing out char \"%c\" (0x%02x)\n", c & 0xff, c % 0xff)); timeout_add(&tp->t_rstrt_to, 1); @@ -603,7 +609,7 @@ dartioctl(dev, cmd, data, flag, p) /* *(int *)data = dartmctl(dev, 0, DMGET);*/ break; case TIOCGFLAGS: - if (dart_cons == port) + if (CONS_PORT == port) dart->dart_swflags |= TIOCFLAG_SOFTCAR; *(int *)data = dart->dart_swflags; break; @@ -613,7 +619,7 @@ dartioctl(dev, cmd, data, flag, p) return(EPERM); dart->dart_swflags = *(int *)data; - if (dart_cons == port) + if (CONS_PORT == port) dart->dart_swflags |= TIOCFLAG_SOFTCAR; dart->dart_swflags &= /* only allow valid flags */ (TIOCFLAG_SOFTCAR | TIOCFLAG_CLOCAL | TIOCFLAG_CRTSCTS); @@ -664,7 +670,7 @@ dartparam(tp, t) /* disable Tx and Rx */ dprintf(("dartparam: disabling Tx and Rx int\n")); - if (dart_cons == port) { + if (CONS_PORT == port) { dprintf(("dartparam: skipping console init\n")); } else { if (port == A_PORT) @@ -846,7 +852,7 @@ dartopen (dev, flag, mode, p) tp->t_lflag = TTYDEF_LFLAG; tp->t_ispeed = tp->t_ospeed = B9600; dartparam(tp, &tp->t_termios); - if (port == dart_cons) { + if (port == CONS_PORT) { /* console is 8N1 */ tp->t_cflag = (CREAD | CS8 | HUPCL); } else { @@ -975,7 +981,7 @@ dartrint(sc, port) dprintf(("dartrint: read char \"%c\" (0x%02x) tp = 0x%x\n", data, data, tp)); - if ((tp->t_state & (TS_ISOPEN|TS_WOPEN)) == 0 && dart_cons != port) { + if ((tp->t_state & (TS_ISOPEN|TS_WOPEN)) == 0 && CONS_PORT != port) { return; } @@ -1163,7 +1169,6 @@ void dartcninit(cp) struct consdev *cp; { - dart_cons = A_PORT; } void diff --git a/sys/arch/mvme88k/mvme88k/autoconf.c b/sys/arch/mvme88k/mvme88k/autoconf.c index 9dc7c8fb5a9..4de7791ba13 100644 --- a/sys/arch/mvme88k/mvme88k/autoconf.c +++ b/sys/arch/mvme88k/mvme88k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.24 2003/10/05 20:25:08 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.25 2004/02/11 20:41:08 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -61,7 +61,8 @@ void swapconf(void); char buginchr(void); void dumpconf(void); int findblkmajor(struct device *); -struct device *getdisk(char *, int, int, dev_t *); +struct device *getdisk(char *, int, int, dev_t *); +struct device *getdevunit(char *name, int unit); int cold = 1; /* 1 if still booting */ @@ -75,8 +76,6 @@ struct device *bootdv; /* set by device drivers (if found) */ void cpu_configure() { - struct consdev *temp; - extern struct consdev bootcons; if (config_rootfound("mainbus", "mainbus") == 0) panic("no mainbus found"); @@ -85,19 +84,19 @@ cpu_configure() * Turn external interrupts on. * * XXX We have a race here. If we enable interrupts after setroot(), - * the kernel dies. If we enable interrupts here, console on cl does - * not work (for boot -a). So we switch to the boot console for the - * time being... + * the kernel dies. */ - temp = cn_tab; - cn_tab = &bootcons; - enable_interrupt(); spl0(); setroot(); swapconf(); - cn_tab = temp; + /* + * Finally switch to the real console driver, + * and say goodbye to the BUG! + */ + cn_tab = NULL; + cninit(); cold = 0; } diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 7d53cd19ff1..a27687d43ca 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.133 2004/01/14 11:49:49 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.134 2004/02/11 20:41:08 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -248,8 +248,10 @@ extern struct pcb *curpcb; extern struct user *proc0paddr; /* - * XXX this is to fake out the console routines, while - * booting. New and improved! :-) smurph + * This is to fake out the console routines, while booting. + * We could use directly the bugtty console, but we want to be able to + * configure a kernel without bugtty since we do not necessarily need a + * full-blown console driver. */ cons_decl(boot); #define bootcnpollc nullcnpollc @@ -266,20 +268,15 @@ struct consdev bootcons = { }; /* - * Console initialization: called early on from main, - * before vm init or startup. Do enough configuration - * to choose and initialize a console. + * Early console initialization: called early on from main, before vm init. + * We want to stick to the BUG routines for now, and we'll switch to the + * real console in cpu_startup(). */ void consinit() { - extern struct consdev *cn_tab; - /* - * Initialize the console before we print anything out. - */ - cn_tab = NULL; - cninit(); + cn_tab = &bootcons; #if defined(DDB) db_machine_init(); |