summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-01-04 01:14:07 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-01-04 01:14:07 +0000
commit2d9a70b11af0bd00f770544466013f69fc1b6e75 (patch)
tree8921ef79f0699b0f24d27b0c2874f57c46d3ef9e /sys/arch/mvme88k/dev
parentbd21960d4481f62d9a884fc34553a984ef01dcff (diff)
Working kluge to ``enable'' the on-board SCSI controller on 187 and 197, if
it is not the boot device and has not been expliictely ``enabled'' in the BUG. Will definitely help netboot installations...
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r--sys/arch/mvme88k/dev/bugio.c11
-rw-r--r--sys/arch/mvme88k/dev/ssh.c20
2 files changed, 28 insertions, 3 deletions
diff --git a/sys/arch/mvme88k/dev/bugio.c b/sys/arch/mvme88k/dev/bugio.c
index a8ae21fcf9f..6aa80ba0dc3 100644
--- a/sys/arch/mvme88k/dev/bugio.c
+++ b/sys/arch/mvme88k/dev/bugio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugio.c,v 1.10 2003/09/01 19:14:01 miod Exp $ */
+/* $OpenBSD: bugio.c,v 1.11 2004/01/04 01:14:04 miod Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr. */
#include <sys/param.h>
@@ -173,3 +173,12 @@ bugbrdid(struct mvmeprom_brdid *id)
bcopy(ptr, id, sizeof(struct mvmeprom_brdid));
}
+
+void
+bugdiskrd(struct mvmeprom_dskio *dio)
+{
+ BUGCTXT();
+ __asm__ __volatile__ ("or r2, r0, %0" : : "r" (dio));
+ MVMEPROM_CALL(MVMEPROM_DSKRD);
+ OSCTXT();
+}
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index d9b6bc732b5..1a2bd72f0d5 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.21 2004/01/02 23:48:01 miod Exp $ */
+/* $OpenBSD: ssh.c,v 1.22 2004/01/04 01:14:04 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -52,6 +52,8 @@
#include <machine/autoconf.h>
#include <machine/cmmu.h>
#include <machine/pmap.h>
+#include <machine/bugio.h>
+#include <machine/prom.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -216,9 +218,23 @@ sshmatch(pdp, vcf, args)
* For some reason, if the SCSI hardware is not ``warmed'' by the
* BUG (netboot or boot from external SCSI controller), badvaddr()
* will always fail, although the hardware is there.
+ * Since the BUG will do the right thing, we'll defer a dummy read
+ * from the controller and retry.
*/
if (brdtyp == BRD_187 || brdtyp == BRD_197) {
- /* do something to enable the controller??? */
+ struct mvmeprom_dskio dio;
+ char buf[MVMEPROM_BLOCK_SIZE];
+
+#ifdef DEBUG
+ printf("sshmatch: trying to warm up controller\n");
+#endif
+ bzero(&dio, sizeof dio);
+ dio.pbuffer = buf;
+ dio.blk_cnt = 1;
+ bugdiskrd(&dio);
+
+ if (badvaddr((vaddr_t)IIOV(ca->ca_vaddr), 4) == 0)
+ return (1);
}
return (0);