diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/vax/boot/boot/autoconf.c | 27 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/conf.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/consio.c | 33 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/if_le.c | 16 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/autoconf.c | 27 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/conf.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/consio.c | 33 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/if_le.c | 16 |
8 files changed, 110 insertions, 50 deletions
diff --git a/sys/arch/vax/boot/boot/autoconf.c b/sys/arch/vax/boot/boot/autoconf.c index 9ddc286b3b1..356b0038f35 100644 --- a/sys/arch/vax/boot/boot/autoconf.c +++ b/sys/arch/vax/boot/boot/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.12 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.13 2008/08/18 23:20:43 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.19 2002/06/01 15:33:22 ragge Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -38,11 +38,13 @@ #include <lib/libsa/stand.h> -#include "../../include/mtpr.h" -#include "../../include/sid.h" -#include "../../include/intr.h" -#include "../../include/rpb.h" -#include "../../include/scb.h" +#include <machine/mtpr.h> +#include <machine/sid.h> +#include <machine/intr.h> +#include <machine/rpb.h> +#include <machine/scb.h> +#include <arch/vax/mbus/mbusreg.h> +#include <arch/vax/mbus/fwioreg.h> #include "vaxstand.h" void autoconf(void); @@ -52,6 +54,7 @@ void scbinit(void); void clkstart(void); int getsecs(void); void scb_stray(void *); +void scb_silent(void *); void longjmp(int *); void rtimer(void *); @@ -181,6 +184,8 @@ scbinit(void) scb_vec[i].ev = NULL; } scb_vec[4/4].hoppaddr = mcheck; + if (vax_boardtype == VAX_BTYP_60) + scb_vec[0x60/4].hoppaddr = scb_silent; } void @@ -195,8 +200,8 @@ clkstart(void) extern int ka60_ioslot; /* enable M-Bus clock in IOCSR */ - *(unsigned int *)(0x30800000 + (ka60_ioslot << 25)) |= - 0x20000000; /* CLKIEN */ + *(unsigned int *)(MBUS_SLOT_BASE(ka60_ioslot) + + FWIO_IOCSR_OFFSET) |= FWIO_IOCSR_CLKIEN; } mtpr(20, PR_IPL); @@ -267,3 +272,9 @@ scb_stray(void *arg) vector = (int) arg; printf("stray interrupt: vector 0x%x, ipl %d\n", vector, ipl); } + +void +scb_silent(void *arg) +{ + /* nothing */ +} diff --git a/sys/arch/vax/boot/boot/conf.c b/sys/arch/vax/boot/boot/conf.c index c08626642ec..544d19ae36c 100644 --- a/sys/arch/vax/boot/boot/conf.c +++ b/sys/arch/vax/boot/boot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.3 2002/06/11 09:36:23 hugh Exp $ */ +/* $OpenBSD: conf.c,v 1.4 2008/08/18 23:20:44 miod Exp $ */ /* $NetBSD: conf.c,v 1.10 2000/06/15 19:53:23 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -59,6 +59,7 @@ struct devsw devsw[]={ SADEV("hd",mfmstrategy, mfmopen, nullsys, noioctl), SADEV("sd",romstrategy, romopen, nullsys, noioctl), SADEV("sd",romstrategy, romopen, nullsys, noioctl), /* SDN */ + SADEV("sd",romstrategy, romopen, nullsys, noioctl), /* SDS */ SADEV("st",nullsys, nullsys, nullsys, noioctl), SADEV("le",nostrategy, leopen, leclose, noioctl), /* LANCE */ SADEV("ze",nostrategy, zeopen, zeclose, noioctl), /* SGEC */ @@ -77,6 +78,7 @@ int cnvtab[] = { BDEV_RD, BDEV_SD, BDEV_SDN, + BDEV_SDS, BDEV_ST, BDEV_LE, BDEV_ZE, diff --git a/sys/arch/vax/boot/boot/consio.c b/sys/arch/vax/boot/boot/consio.c index 46e23807fd4..09ccee06755 100644 --- a/sys/arch/vax/boot/boot/consio.c +++ b/sys/arch/vax/boot/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; diff --git a/sys/arch/vax/boot/boot/if_le.c b/sys/arch/vax/boot/boot/if_le.c index abc436252a7..e7860d97762 100644 --- a/sys/arch/vax/boot/boot/if_le.c +++ b/sys/arch/vax/boot/boot/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.5 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.6 2008/08/18 23:20:44 miod Exp $ */ /* $NetBSD: if_le.c,v 1.6 2000/05/20 13:30:03 ragge Exp $ */ /* * Copyright (c) 1997, 1999 Ludd, University of Lule}, Sweden. @@ -46,12 +46,15 @@ #include <netinet/in_systm.h> #include <netinet/if_ether.h> -#include <../include/sid.h> -#include <../include/rpb.h> +#include <machine/sid.h> +#include <machine/rpb.h> #include <lib/libsa/netif.h> #include <lib/libsa/stand.h> +#include <arch/vax/mbus/mbusreg.h> +#include <arch/vax/mbus/fwioreg.h> + #include <dev/ic/am7990reg.h> #include "vaxstand.h" @@ -151,14 +154,15 @@ leopen(struct open_file *f, int adapt, int ctlr, int unit, int part) nireg = (void *)0x20084400; } else if (vax_boardtype == VAX_BTYP_60) { extern int ka60_ioslot; - lebufaddr = 0x30a00000 + (ka60_ioslot << 25); - ea = (int *)(0x30800000 + (ka60_ioslot << 25)); + lebufaddr = MBUS_SLOT_BASE(ka60_ioslot) + FWIO_LANCE_BUF_OFFSET; + ea = (int *)(MBUS_SLOT_BASE(ka60_ioslot) + FWIO_ESAR_OFFSET); for (i = 0; i < 6; i++) { eaddr[i] = *(u_char *)((int)ea + 2); ea++; } ea = NULL; - nireg = (void *)(0x30200000 + (ka60_ioslot << 25)); + nireg = (void *)(MBUS_SLOT_BASE(ka60_ioslot) + + FWIO_LANCE_REG_OFFSET); } else { *(int *)0x20080014 = 0; /* Be sure we do DMA in low 16MB */ ea = (void *)0x20090000; /* XXX Ethernet address */ diff --git a/sys/arch/vax/stand/boot/autoconf.c b/sys/arch/vax/stand/boot/autoconf.c index 9ddc286b3b1..356b0038f35 100644 --- a/sys/arch/vax/stand/boot/autoconf.c +++ b/sys/arch/vax/stand/boot/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.12 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.13 2008/08/18 23:20:43 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.19 2002/06/01 15:33:22 ragge Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -38,11 +38,13 @@ #include <lib/libsa/stand.h> -#include "../../include/mtpr.h" -#include "../../include/sid.h" -#include "../../include/intr.h" -#include "../../include/rpb.h" -#include "../../include/scb.h" +#include <machine/mtpr.h> +#include <machine/sid.h> +#include <machine/intr.h> +#include <machine/rpb.h> +#include <machine/scb.h> +#include <arch/vax/mbus/mbusreg.h> +#include <arch/vax/mbus/fwioreg.h> #include "vaxstand.h" void autoconf(void); @@ -52,6 +54,7 @@ void scbinit(void); void clkstart(void); int getsecs(void); void scb_stray(void *); +void scb_silent(void *); void longjmp(int *); void rtimer(void *); @@ -181,6 +184,8 @@ scbinit(void) scb_vec[i].ev = NULL; } scb_vec[4/4].hoppaddr = mcheck; + if (vax_boardtype == VAX_BTYP_60) + scb_vec[0x60/4].hoppaddr = scb_silent; } void @@ -195,8 +200,8 @@ clkstart(void) extern int ka60_ioslot; /* enable M-Bus clock in IOCSR */ - *(unsigned int *)(0x30800000 + (ka60_ioslot << 25)) |= - 0x20000000; /* CLKIEN */ + *(unsigned int *)(MBUS_SLOT_BASE(ka60_ioslot) + + FWIO_IOCSR_OFFSET) |= FWIO_IOCSR_CLKIEN; } mtpr(20, PR_IPL); @@ -267,3 +272,9 @@ scb_stray(void *arg) vector = (int) arg; printf("stray interrupt: vector 0x%x, ipl %d\n", vector, ipl); } + +void +scb_silent(void *arg) +{ + /* nothing */ +} diff --git a/sys/arch/vax/stand/boot/conf.c b/sys/arch/vax/stand/boot/conf.c index c08626642ec..544d19ae36c 100644 --- a/sys/arch/vax/stand/boot/conf.c +++ b/sys/arch/vax/stand/boot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.3 2002/06/11 09:36:23 hugh Exp $ */ +/* $OpenBSD: conf.c,v 1.4 2008/08/18 23:20:44 miod Exp $ */ /* $NetBSD: conf.c,v 1.10 2000/06/15 19:53:23 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -59,6 +59,7 @@ struct devsw devsw[]={ SADEV("hd",mfmstrategy, mfmopen, nullsys, noioctl), SADEV("sd",romstrategy, romopen, nullsys, noioctl), SADEV("sd",romstrategy, romopen, nullsys, noioctl), /* SDN */ + SADEV("sd",romstrategy, romopen, nullsys, noioctl), /* SDS */ SADEV("st",nullsys, nullsys, nullsys, noioctl), SADEV("le",nostrategy, leopen, leclose, noioctl), /* LANCE */ SADEV("ze",nostrategy, zeopen, zeclose, noioctl), /* SGEC */ @@ -77,6 +78,7 @@ int cnvtab[] = { BDEV_RD, BDEV_SD, BDEV_SDN, + BDEV_SDS, BDEV_ST, BDEV_LE, BDEV_ZE, 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; diff --git a/sys/arch/vax/stand/boot/if_le.c b/sys/arch/vax/stand/boot/if_le.c index abc436252a7..e7860d97762 100644 --- a/sys/arch/vax/stand/boot/if_le.c +++ b/sys/arch/vax/stand/boot/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.5 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.6 2008/08/18 23:20:44 miod Exp $ */ /* $NetBSD: if_le.c,v 1.6 2000/05/20 13:30:03 ragge Exp $ */ /* * Copyright (c) 1997, 1999 Ludd, University of Lule}, Sweden. @@ -46,12 +46,15 @@ #include <netinet/in_systm.h> #include <netinet/if_ether.h> -#include <../include/sid.h> -#include <../include/rpb.h> +#include <machine/sid.h> +#include <machine/rpb.h> #include <lib/libsa/netif.h> #include <lib/libsa/stand.h> +#include <arch/vax/mbus/mbusreg.h> +#include <arch/vax/mbus/fwioreg.h> + #include <dev/ic/am7990reg.h> #include "vaxstand.h" @@ -151,14 +154,15 @@ leopen(struct open_file *f, int adapt, int ctlr, int unit, int part) nireg = (void *)0x20084400; } else if (vax_boardtype == VAX_BTYP_60) { extern int ka60_ioslot; - lebufaddr = 0x30a00000 + (ka60_ioslot << 25); - ea = (int *)(0x30800000 + (ka60_ioslot << 25)); + lebufaddr = MBUS_SLOT_BASE(ka60_ioslot) + FWIO_LANCE_BUF_OFFSET; + ea = (int *)(MBUS_SLOT_BASE(ka60_ioslot) + FWIO_ESAR_OFFSET); for (i = 0; i < 6; i++) { eaddr[i] = *(u_char *)((int)ea + 2); ea++; } ea = NULL; - nireg = (void *)(0x30200000 + (ka60_ioslot << 25)); + nireg = (void *)(MBUS_SLOT_BASE(ka60_ioslot) + + FWIO_LANCE_REG_OFFSET); } else { *(int *)0x20080014 = 0; /* Be sure we do DMA in low 16MB */ ea = (void *)0x20090000; /* XXX Ethernet address */ |