summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-09-11 19:29:02 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-09-11 19:29:02 +0000
commitea6328b138f8eda2a827cd528193b9368db86cb5 (patch)
treef4261df5776b3b89a1bfe4195abddbbd40811097
parent1e08871b64c4e160947cdbadbcd5b2e490584241 (diff)
Define symbolic constants for the addresses of the vsbus devices on
512KB PROM systems (e.g. KA49), or 256KB PROM systems built after KA49 (e.g. KA5[234]), and use them instead of pouring magic numbers all over the (md) tree. No functional change.
-rw-r--r--sys/arch/vax/dec/dzcons.c8
-rw-r--r--sys/arch/vax/include/ka410.h4
-rw-r--r--sys/arch/vax/include/vsbus.h15
-rw-r--r--sys/arch/vax/vsa/asc_vsbus.c18
-rw-r--r--sys/arch/vax/vsa/dz_ibus.c4
-rw-r--r--sys/arch/vax/vsa/vsaudio.c14
-rw-r--r--sys/arch/vax/vsa/vsbus.c4
7 files changed, 37 insertions, 30 deletions
diff --git a/sys/arch/vax/dec/dzcons.c b/sys/arch/vax/dec/dzcons.c
index 79bac467ce9..939336497f3 100644
--- a/sys/arch/vax/dec/dzcons.c
+++ b/sys/arch/vax/dec/dzcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dzcons.c,v 1.4 2008/08/20 19:00:01 miod Exp $ */
+/* $OpenBSD: dzcons.c,v 1.5 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -166,7 +166,7 @@ dzcnprobe(cndev)
{
extern vaddr_t iospace;
int diagcons, major, pri;
- paddr_t ioaddr = 0x200a0000;
+ paddr_t ioaddr = DZ_CSR;
if ((major = getmajor(dzopen)) < 0)
return;
@@ -186,12 +186,12 @@ dzcnprobe(cndev)
break;
case VAX_BTYP_49:
- ioaddr = 0x25000000;
+ ioaddr = DZ_CSR_KA49;
diagcons = (vax_confdata & 8 ? 3 : 0);
break;
case VAX_BTYP_1303:
- ioaddr = 0x25000000;
+ ioaddr = DZ_CSR_KA49;
diagcons = 3;
break;
diff --git a/sys/arch/vax/include/ka410.h b/sys/arch/vax/include/ka410.h
index 7a7b1852b34..a9461641e7c 100644
--- a/sys/arch/vax/include/ka410.h
+++ b/sys/arch/vax/include/ka410.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka410.h,v 1.6 2009/06/20 20:57:39 miod Exp $ */
+/* $OpenBSD: ka410.h,v 1.7 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: ka410.h,v 1.2 1997/02/19 10:06:05 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -71,7 +71,7 @@
#define KA410_SER_BASE 0x200A0000 /* Serial line controller */
#define KA410_SER_END 0x200A000F
#define KA410_SER_SIZE 0x10
-#define KA410_WAT_BASE ((struct ka410_clock *)0x200B0000)/* TOY clock */
+#define KA410_WAT_BASE 0x200B0000 /* TOY clock */
#define KA410_WAT_END 0x200B00FF
#define KA410_WAT_SIZE 0x100
#define KA410_DKC_BASE 0x200C0000 /* Disk Controller Ports */
diff --git a/sys/arch/vax/include/vsbus.h b/sys/arch/vax/include/vsbus.h
index 38d44444cc2..dd4bd09e82b 100644
--- a/sys/arch/vax/include/vsbus.h
+++ b/sys/arch/vax/include/vsbus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsbus.h,v 1.10 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: vsbus.h,v 1.11 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: vsbus.h,v 1.13 2000/06/25 16:00:46 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -61,11 +61,14 @@ struct vsbus_attach_args {
* Some chip addresses and constants, same on all VAXstations.
*/
#define VS_CFGTST 0x20020000 /* config register */
-#define VS_REGS 0x20080000 /* Misc cpu internal regs */
-#define NI_ADDR 0x20090000 /* Ethernet address */
-#define DZ_CSR 0x200a0000 /* DZ11-compatible chip csr */
-#define VS_CLOCK 0x200b0000 /* clock chip address */
-#define SCA_REGS 0x200c0000 /* disk device addresses */
+#define VS_REGS 0x20080000 /* Misc cpu internal regs */
+#define VS_REGS_KA49 0x25c00000 /* ... same, on 512KB ROM systems */
+#define NI_ADDR 0x20090000 /* Ethernet address */
+#define DZ_CSR 0x200a0000 /* DZ11-compatible chip csr */
+#define DZ_CSR_KA49 0x25000000 /* ... same, on 512KB ROM systems */
+#define VS_CLOCK 0x200b0000 /* clock chip address */
+#define SCA_REGS 0x200c0000 /* disk device addresses */
+#define SCA_REGS_KA49 0x26000000 /* ... same, on 512KB ROM systems */
#define NI_BASE 0x200e0000 /* LANCE CSRs */
#define NI_IOSIZE (128 * VAX_NBPG) /* IO address size */
diff --git a/sys/arch/vax/vsa/asc_vsbus.c b/sys/arch/vax/vsa/asc_vsbus.c
index d9251583c2f..c8951a70102 100644
--- a/sys/arch/vax/vsa/asc_vsbus.c
+++ b/sys/arch/vax/vsa/asc_vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asc_vsbus.c,v 1.13 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: asc_vsbus.c,v 1.14 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: asc_vsbus.c,v 1.22 2001/02/04 20:36:32 ragge Exp $ */
/*-
@@ -152,14 +152,18 @@ asc_vsbus_match(struct device *parent, void *conf, void *aux)
if (asc_attached)
return 0;
- if (vax_boardtype == VAX_BTYP_46 || vax_boardtype == VAX_BTYP_48) {
- if (cf->cf_loc[0] != 0x200c0080)
+ switch (vax_boardtype) {
+ case VAX_BTYP_46:
+ case VAX_BTYP_48:
+ if (cf->cf_loc[0] != (SCA_REGS | 0x80))
return 0;
- } else if (vax_boardtype == VAX_BTYP_49 ||
- vax_boardtype == VAX_BTYP_1303) {
- if (cf->cf_loc[0] != 0x26000080)
+ break;
+ case VAX_BTYP_49:
+ case VAX_BTYP_1303:
+ if (cf->cf_loc[0] != (SCA_REGS_KA49 | 0x80))
return 0;
- } else {
+ break;
+ default:
return 0;
}
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c
index df0f64de58c..aab44e9705b 100644
--- a/sys/arch/vax/vsa/dz_ibus.c
+++ b/sys/arch/vax/vsa/dz_ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz_ibus.c,v 1.28 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: dz_ibus.c,v 1.29 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -79,7 +79,7 @@ dz_vsbus_match(parent, cf, aux)
#if VAX53 || VAX49
if (vax_boardtype == VAX_BTYP_49 ||
vax_boardtype == VAX_BTYP_1303)
- if (cf->cf_loc[0] != 0x25000000)
+ if (cf->cf_loc[0] != DZ_CSR_KA49)
return 0; /* don't probe unnecessarily */
#endif
diff --git a/sys/arch/vax/vsa/vsaudio.c b/sys/arch/vax/vsa/vsaudio.c
index 4afaf036098..46ce4f1ce8e 100644
--- a/sys/arch/vax/vsa/vsaudio.c
+++ b/sys/arch/vax/vsa/vsaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsaudio.c,v 1.1 2011/09/03 20:41:31 miod Exp $ */
+/* $OpenBSD: vsaudio.c,v 1.2 2011/09/11 19:29:01 miod Exp $ */
/*
* Copyright (c) 2011 Miodrag Vallat.
@@ -81,8 +81,8 @@
#endif /* AUDIO_DEBUG */
/* physical addresses of the AM79C30 chip */
-#define KA46_KA48_AUDIO_CSR 0x200d0000
-#define KA49_AUDIO_CSR 0x26800000
+#define VSAUDIO_CSR 0x200d0000
+#define VSAUDIO_CSR_KA49 0x26800000
struct vsaudio_softc {
struct am7930_softc sc_am7930; /* base device */
@@ -144,7 +144,7 @@ int vsaudio_start_output(void *, void *, int, void (*)(void *), void *);
int vsaudio_start_input(void *, void *, int, void (*)(void *), void *);
int vsaudio_getdev(void *, struct audio_device *);
-struct audio_hw_if sa_hw_if = {
+struct audio_hw_if vsaudio_hw_if = {
am7930_open,
am7930_close,
NULL,
@@ -194,13 +194,13 @@ vsaudio_match(struct device *parent, void *vcf, void *aux)
#if defined(VAX46) || defined(VAX48)
case VAX_BTYP_46:
case VAX_BTYP_48:
- if (va->va_paddr != KA46_KA48_AUDIO_CSR)
+ if (va->va_paddr != VSAUDIO_CSR)
return 0;
break;
#endif
#if defined(VAX49)
case VAX_BTYP_49:
- if (va->va_paddr != KA49_AUDIO_CSR)
+ if (va->va_paddr != VSAUDIO_CSR_KA49)
return 0;
break;
#endif
@@ -258,7 +258,7 @@ vsaudio_attach(struct device *parent, struct device *self, void *aux)
sc->sc_swintr = softintr_establish(IPL_SOFT, &vsaudio_swintr, sc);
printf("\n");
- audio_attach_mi(&sa_hw_if, sc, &sc->sc_am7930.sc_dev);
+ audio_attach_mi(&vsaudio_hw_if, sc, &sc->sc_am7930.sc_dev);
}
void
diff --git a/sys/arch/vax/vsa/vsbus.c b/sys/arch/vax/vsa/vsbus.c
index c5059de69cf..822be1f3f90 100644
--- a/sys/arch/vax/vsa/vsbus.c
+++ b/sys/arch/vax/vsa/vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsbus.c,v 1.22 2011/08/26 21:47:25 miod Exp $ */
+/* $OpenBSD: vsbus.c,v 1.23 2011/09/11 19:29:01 miod Exp $ */
/* $NetBSD: vsbus.c,v 1.29 2000/06/29 07:14:37 mrg Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
@@ -143,7 +143,7 @@ vsbus_attach(parent, self, aux)
#if VAX49 || VAX53
case VAX_BTYP_1303:
case VAX_BTYP_49:
- sc->sc_vsregs = vax_map_physmem(0x25c00000, 1);
+ sc->sc_vsregs = vax_map_physmem(VS_REGS_KA49, 1);
sc->sc_intreq = (char *)sc->sc_vsregs + 12;
sc->sc_intclr = (char *)sc->sc_vsregs + 12;
sc->sc_intmsk = (char *)sc->sc_vsregs + 8;