summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/dev/bugio.c11
-rw-r--r--sys/arch/mvme88k/dev/ssh.c20
-rw-r--r--sys/arch/mvme88k/include/bugio.h3
3 files changed, 30 insertions, 4 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);
diff --git a/sys/arch/mvme88k/include/bugio.h b/sys/arch/mvme88k/include/bugio.h
index 2f58b700b47..cdc62d71d66 100644
--- a/sys/arch/mvme88k/include/bugio.h
+++ b/sys/arch/mvme88k/include/bugio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugio.h,v 1.13 2002/03/14 01:26:39 millert Exp $ */
+/* $OpenBSD: bugio.h,v 1.14 2004/01/04 01:14:06 miod Exp $ */
#ifndef __MACHINE_BUGIO_H__
#define __MACHINE_BUGIO_H__
@@ -15,5 +15,6 @@ void bugoutstr(char *, char *);
void bugrtcrd(struct mvmeprom_time *);
void bugreturn(void);
void bugbrdid(struct mvmeprom_brdid *);
+void bugdiskrd(struct mvmeprom_dskio *);
#endif /* __MACHINE_BUGIO_H__ */