diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-13 21:29:24 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-13 21:29:24 +0000 |
commit | aa42a0b53d48ba38996905c509a8eebfb4fa4607 (patch) | |
tree | 1c099696583ae515ac0ec4254f53c6047288f9ef /sys | |
parent | e9135ac4cf4c91cfee56c97acc82db98141f6077 (diff) |
Take advantage of the way config(8) works to probe for bugtty last during
autoconf. Bugtty will then not attach if either cl or dart has attached.
Note that, if you boot -c and disable the real console driver for your
board, you lose, because of the early console initialization. This is not
supported anyway.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme88k/conf/files.mvme88k | 13 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/bugtty.c | 42 |
2 files changed, 28 insertions, 27 deletions
diff --git a/sys/arch/mvme88k/conf/files.mvme88k b/sys/arch/mvme88k/conf/files.mvme88k index 89a6a4ca43a..169090baece 100644 --- a/sys/arch/mvme88k/conf/files.mvme88k +++ b/sys/arch/mvme88k/conf/files.mvme88k @@ -1,16 +1,10 @@ -# $OpenBSD: files.mvme88k,v 1.24 2004/01/02 23:35:00 miod Exp $ +# $OpenBSD: files.mvme88k,v 1.25 2004/01/13 21:29:21 miod Exp $ # maxpartitions 16 device mainbus { [addr = -1 ] } attach mainbus at root -# this should be removed after bringup - -device bugtty: tty -attach bugtty at mainbus -file arch/mvme88k/dev/bugtty.c bugtty needs-count - device bussw { [offset = -1], [ ipl = 0 ] } attach bussw at mainbus file arch/mvme88k/dev/bussw.c bussw needs-count @@ -48,6 +42,11 @@ device dart: tty attach dart at syscon file arch/mvme88k/dev/dart.c dart needs-count +# fallback console, only if no cl or dart is available +device bugtty: tty +attach bugtty at mainbus +file arch/mvme88k/dev/bugtty.c bugtty needs-count + include "../../../scsi/files.scsi" major { sd = 4 } diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c index a5177b07116..112e4f778cb 100644 --- a/sys/arch/mvme88k/dev/bugtty.c +++ b/sys/arch/mvme88k/dev/bugtty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bugtty.c,v 1.18 2003/12/22 11:54:48 miod Exp $ */ +/* $OpenBSD: bugtty.c,v 1.19 2004/01/13 21:29:23 miod Exp $ */ /* Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -45,6 +45,8 @@ #include <mvme88k/dev/bugttyfunc.h> #include "bugtty.h" +#include "cl.h" +#include "dart.h" int bugttymatch(struct device *parent, void *self, void *aux); void bugttyattach(struct device *parent, struct device *self, void *aux); @@ -75,8 +77,8 @@ char bugtty_ibuffer[BUGBUF+1]; volatile char *pinchar = bugtty_ibuffer; char bug_obuffer[BUGBUF+1]; -struct tty *bugtty_tty[NBUGTTY]; -int needprom = 1; +#define BUGTTYS 4 +struct tty *bugtty_tty[BUGTTYS]; int bugttymatch(parent, self, aux) @@ -88,15 +90,25 @@ bugttymatch(parent, self, aux) /* * Do not attach if a suitable console driver has been attached. - * XXX but bugtty is probed first! */ - if (needprom == 0) - return (0); +#if NCL > 0 + { + extern struct cfdriver cl_cd; + + if (cl_cd.cd_ndevs != 0) + return (0); + } +#endif +#if NDART > 0 + { + extern struct cfdriver dart_cd; + + if (dart_cd.cd_ndevs != 0) + return (0); + } +#endif - ca->ca_paddr = (void *)0xfff45000; - ca->ca_vaddr = (void *)0xfff45000; ca->ca_ipl = IPL_TTY; - ca->ca_name = "bugtty"; return (1); } @@ -121,7 +133,7 @@ bugttytty(dev) { int unit; unit = BUGTTYUNIT(dev); - if (unit >= 4) { + if (unit >= BUGTTYS) { return (NULL); } return bugtty_tty[unit]; @@ -171,10 +183,6 @@ bugttyopen(dev, flag, mode, p) { int s, unit = BUGTTYUNIT(dev); struct tty *tp; - extern int needprom; - - if (needprom == 0) - return (ENODEV); s = spltty(); if (bugtty_tty[unit]) { @@ -453,12 +461,6 @@ bugttycnprobe(cp) struct consdev *cp; { int maj; - int needprom = 1; - - if (needprom == 0) { - cp->cn_pri = CN_DEAD; - return (0); - } /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) |