diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-08-18 23:20:45 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-08-18 23:20:45 +0000 |
commit | 5ee120b843fa88bf2547b42759b7ef571baecba2 (patch) | |
tree | 8c3342e7fd8fd98c2b4212c0d6f87f73c7a2aed5 /sys/arch/vax/stand/boot/consio.c | |
parent | 87d00f400eaf86a770dc09268649713d4a3d50f4 (diff) |
Now that KA60 support is in, include the proper header files instead of
harcoding defines, and add rpb device type #39 (sii) boot information.
Diffstat (limited to 'sys/arch/vax/stand/boot/consio.c')
-rw-r--r-- | sys/arch/vax/stand/boot/consio.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/sys/arch/vax/stand/boot/consio.c b/sys/arch/vax/stand/boot/consio.c index 46e23807fd4..09ccee06755 100644 --- a/sys/arch/vax/stand/boot/consio.c +++ b/sys/arch/vax/stand/boot/consio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: consio.c,v 1.9 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: consio.c,v 1.10 2008/08/18 23:20:44 miod Exp $ */ /* $NetBSD: consio.c,v 1.13 2002/05/24 21:40:59 ragge Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -43,6 +43,9 @@ #include "data.h" +#include <machine/cvax.h> +#include <arch/vax/mbus/mbusreg.h> + void setup(void); static void (*put_fp)(int) = NULL; @@ -383,26 +386,36 @@ void ka60_consinit(void) extern int mcheck_silent; extern int setjmp(int *); - int mid, modaddr, modtype; + int mid, fbicaddr; + uint32_t modtype, fbicrange; + + for (mid = 0; mid < MBUS_SLOT_MAX; mid++) { + fbicaddr = MBUS_SLOT_BASE(mid) + FBIC_BASE; - mcheck_silent = 1; - for (mid = 0; mid < 8; mid++) { - modaddr = 0x31fffffc + (mid << 25); if (setjmp(jbuf)) { /* this slot is empty */ continue; } - modtype = *(int *)modaddr; - if ((modtype & 0xff) == 0x04) { - ka60_ioslot = mid; + mcheck_silent = 1; + modtype = *(uint32_t *)(fbicaddr + FBIC_MODTYPE); + mcheck_silent = 0; + + if ((modtype & MODTYPE_CLASS_MASK) >> MODTYPE_CLASS_SHIFT != + CLASS_IO) + continue; + + ka60_ioslot = mid; + + fbicrange = *(uint32_t *)(fbicaddr + FBIC_RANGE); + if (fbicrange == + ((HOST_TO_MBUS(CVAX_SSC) & RANGE_MATCH) | RANGE_ENABLE)) break; - } } mcheck_silent = 0; if (ka60_ioslot < 0) { /* - * This shouldn't happen. Try mid #5 (slot #4) as a + * This shouldn't happen. Try mid #5 (enclosure slot #4) as a * supposedly sane default. */ ka60_ioslot = 5; |