From 2d9a70b11af0bd00f770544466013f69fc1b6e75 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 4 Jan 2004 01:14:07 +0000 Subject: 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... --- sys/arch/mvme88k/dev/bugio.c | 11 ++++++++++- sys/arch/mvme88k/dev/ssh.c | 20 ++++++++++++++++++-- sys/arch/mvme88k/include/bugio.h | 3 ++- 3 files changed, 30 insertions(+), 4 deletions(-) (limited to 'sys/arch') 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 @@ -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 #include #include +#include +#include #include #include @@ -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__ */ -- cgit v1.2.3