diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-01 15:27:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-01 15:27:13 +0000 |
commit | ba62b525326d293a5e73ab10a6b385a4fb00e597 (patch) | |
tree | d1598e9adabba0288fb8ba51c8c3c1a408f6be22 /sys/arch/vax | |
parent | bb848bf4cf927d6381d1912216d44b5b47e4ecf3 (diff) |
Gather the scattered (and sometimes duplicated) qbus address and size defines
to a single place. Get rid of the unused defines pertaining to older vax
models we dropped support for years ago.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/if/if_de.c | 3 | ||||
-rw-r--r-- | sys/arch/vax/include/ka650.h | 11 | ||||
-rw-r--r-- | sys/arch/vax/mbus/uba_mbus.c | 6 | ||||
-rw-r--r-- | sys/arch/vax/qbus/uba.c | 3 | ||||
-rw-r--r-- | sys/arch/vax/qbus/ubavar.h | 3 | ||||
-rw-r--r-- | sys/arch/vax/uba/uba_common.h | 36 | ||||
-rw-r--r-- | sys/arch/vax/uba/uba_ibus.c | 11 | ||||
-rw-r--r-- | sys/arch/vax/uba/ubareg.h | 69 | ||||
-rw-r--r-- | sys/arch/vax/vax/autoconf.c | 4 |
9 files changed, 19 insertions, 127 deletions
diff --git a/sys/arch/vax/if/if_de.c b/sys/arch/vax/if/if_de.c index a4a69a9e020..832e018025a 100644 --- a/sys/arch/vax/if/if_de.c +++ b/sys/arch/vax/if/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.26 2014/12/22 02:26:54 tedu Exp $ */ +/* $OpenBSD: if_de.c,v 1.27 2015/02/01 15:27:11 miod Exp $ */ /* $NetBSD: if_de.c,v 1.27 1997/04/19 15:02:29 ragge Exp $ */ /* @@ -68,7 +68,6 @@ #include <vax/if/if_dereg.h> #include <vax/if/if_uba.h> -#include <vax/uba/ubareg.h> #include <vax/uba/ubavar.h> #define NXMT 3 /* number of transmit buffers */ diff --git a/sys/arch/vax/include/ka650.h b/sys/arch/vax/include/ka650.h index d9ec7c72b92..d24b055badf 100644 --- a/sys/arch/vax/include/ka650.h +++ b/sys/arch/vax/include/ka650.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ka650.h,v 1.12 2011/09/19 21:53:02 miod Exp $ */ +/* $OpenBSD: ka650.h,v 1.13 2015/02/01 15:27:11 miod Exp $ */ /* $NetBSD: ka650.h,v 1.6 1997/07/26 10:12:43 ragge Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -144,15 +144,6 @@ struct ka650_ipcr { #endif /* _LOCORE */ /* - * Physical start address of the Qbus memory. - * The q-bus memory size is 4 meg. - * Physical start address of the I/O space (where the 8Kbyte I/O page is). - */ -#define KA650_QMEM 0x30000000 -#define KA650_QMEMSIZE (512*8192) -#define KA650_QDEVADDR 0x20000000 - -/* * Mapping info for Cache Entries, including * Size (in bytes) of 2nd Level Cache for cache flush operation */ diff --git a/sys/arch/vax/mbus/uba_mbus.c b/sys/arch/vax/mbus/uba_mbus.c index 9cf49269870..0c3258ded9d 100644 --- a/sys/arch/vax/mbus/uba_mbus.c +++ b/sys/arch/vax/mbus/uba_mbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uba_mbus.c,v 1.4 2015/02/01 13:18:32 miod Exp $ */ +/* $OpenBSD: uba_mbus.c,v 1.5 2015/02/01 15:27:11 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -61,11 +61,9 @@ #include <vax/mbus/mbusreg.h> #include <vax/mbus/mbusvar.h> +#include <arch/vax/uba/ubareg.h> #include <arch/vax/qbus/ubavar.h> #include <arch/vax/uba/uba_common.h> -#include <arch/vax/uba/ubareg.h> - -#define QBASIZE (8192 * VAX_NBPG) void uba_mbus_attach(struct device *, struct device *, void *); int uba_mbus_match(struct device *, void *, void *); diff --git a/sys/arch/vax/qbus/uba.c b/sys/arch/vax/qbus/uba.c index 36f118ba841..59b8ed02303 100644 --- a/sys/arch/vax/qbus/uba.c +++ b/sys/arch/vax/qbus/uba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uba.c,v 1.13 2010/11/18 21:13:19 miod Exp $ */ +/* $OpenBSD: uba.c,v 1.14 2015/02/01 15:27:11 miod Exp $ */ /* $NetBSD: uba.c,v 1.57 2001/04/26 19:16:07 ragge Exp $ */ /* * Copyright (c) 1996 Jonathan Stone. @@ -51,6 +51,7 @@ #include <machine/scb.h> #include <machine/cpu.h> +#include <arch/vax/uba/ubareg.h> #include <arch/vax/qbus/ubavar.h> static int ubasearch (struct device *, struct cfdata *, void *); diff --git a/sys/arch/vax/qbus/ubavar.h b/sys/arch/vax/qbus/ubavar.h index 7001bc294b5..76dfc731345 100644 --- a/sys/arch/vax/qbus/ubavar.h +++ b/sys/arch/vax/qbus/ubavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ubavar.h,v 1.8 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: ubavar.h,v 1.9 2015/02/01 15:27:11 miod Exp $ */ /* $NetBSD: ubavar.h,v 1.31 2001/04/26 19:16:07 ragge Exp $ */ /* @@ -144,7 +144,6 @@ struct ubinfo { /* * Some common defines for all subtypes of U/Q-buses/adapters. */ -#define UBAIOSIZE (8*1024) /* 8K I/O space */ #define ubdevreg(addr) ((addr) & 017777) #ifdef _KERNEL diff --git a/sys/arch/vax/uba/uba_common.h b/sys/arch/vax/uba/uba_common.h index 0ee09891e58..8f7df024270 100644 --- a/sys/arch/vax/uba/uba_common.h +++ b/sys/arch/vax/uba/uba_common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uba_common.h,v 1.5 2008/08/18 23:10:39 miod Exp $ */ +/* $OpenBSD: uba_common.h,v 1.6 2015/02/01 15:27:12 miod Exp $ */ /* $NetBSD: uba_common.h,v 1.2 1999/06/21 16:23:01 ragge Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. @@ -39,7 +39,6 @@ /* * VAX-specific parts of the Unibus softc. */ -struct uba_regs; struct uba_vsoftc { struct uba_softc uv_sc;/* Common vars from arch/vax/qbus/ubavar.h */ @@ -47,39 +46,6 @@ struct uba_vsoftc { struct vax_sgmap uv_sgmap; int uv_size; /* Size of UBA addressable memory */ paddr_t uv_addr; /* Physical address of map registers */ - struct uba_regs *uv_uba;/* Where applicable */ - int uh_ibase; - int uh_zvtime; - int uh_zvtotal; - int uh_zvcnt; }; -/* - * Size of unibus memory address space in pages - * (also number of map registers). - */ -#define UBAPAGES 496 -#define UBAIOADDR 0760000 /* start of I/O page */ -#define UBAIOPAGES 16 - -/* - * DW780/DW750 hardware registers - */ -struct uba_regs { - int uba_cnfgr; /* configuration register */ - int uba_cr; /* control register */ - int uba_sr; /* status register */ - int uba_dcr; /* diagnostic control register */ - int uba_fmer; /* failed map entry register */ - int uba_fubar; /* failed UNIBUS address register */ - int pad1[2]; - int uba_brsvr[4]; - int uba_brrvr[4]; /* receive vector registers */ - int uba_dpr[16]; /* buffered data path register */ - int pad2[480]; - pt_entry_t uba_map[UBAPAGES]; /* unibus map register */ - int pad3[UBAIOPAGES]; /* no maps for device address space */ -}; -#define UBA_REGS_DEFINED - void uba_dma_init(struct uba_vsoftc *); diff --git a/sys/arch/vax/uba/uba_ibus.c b/sys/arch/vax/uba/uba_ibus.c index 42a7c9a1325..d8dc289d877 100644 --- a/sys/arch/vax/uba/uba_ibus.c +++ b/sys/arch/vax/uba/uba_ibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uba_ibus.c,v 1.3 2003/06/02 23:27:58 millert Exp $ */ +/* $OpenBSD: uba_ibus.c,v 1.4 2015/02/01 15:27:12 miod Exp $ */ /* $NetBSD: uba_ibus.c,v 1.1 1999/08/07 10:36:47 ragge Exp $ */ /* * Copyright (c) 1996 Jonathan Stone. @@ -45,15 +45,10 @@ #include <machine/cpu.h> #include <machine/sgmap.h> +#include <arch/vax/uba/ubareg.h> #include <arch/vax/qbus/ubavar.h> - #include <arch/vax/uba/uba_common.h> -/* Some Qbus-specific defines */ -#define QBASIZE (8192 * VAX_NBPG) -#define QBAMAP 0x20088000 -#define QIOPAGE 0x20000000 - /* * The Q22 bus is the main IO bus on MicroVAX II/MicroVAX III systems. * It has an address space of 4MB (22 address bits), therefore the name, @@ -118,8 +113,6 @@ void qba_beforescan(sc) struct uba_softc *sc; { -#define QIPCR 0x1f40 -#define Q_LMEAE 0x20 bus_space_write_2(sc->uh_tag, sc->uh_ioh, QIPCR, Q_LMEAE); } diff --git a/sys/arch/vax/uba/ubareg.h b/sys/arch/vax/uba/ubareg.h index c4708784acd..66ed70d2c26 100644 --- a/sys/arch/vax/uba/ubareg.h +++ b/sys/arch/vax/uba/ubareg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ubareg.h,v 1.14 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: ubareg.h,v 1.15 2015/02/01 15:27:12 miod Exp $ */ /* $NetBSD: ubareg.h,v 1.11 2000/01/24 02:40:36 matt Exp $ */ /*- @@ -44,64 +44,19 @@ /* * Size of unibus memory address space in pages * (also number of map registers). - * QBAPAGES should be 8192, but we don't need nearly that much - * address space, and the return from the allocation routine - * can accommodate at most 2047 (ubavar.h: UBA_MAXMR); - * QBAPAGES must be at least UBAPAGES. Choose pragmatically. - * - * Is there ever any need to have QBAPAGES != UBAPAGES??? - * Wont work now anyway, QBAPAGES _must_ be .eq. UBAPAGES. */ #define UBAPAGES 496 -#define NUBMREG 496 -#define QBAPAGES 1024 -#define UBAIOADDR 0760000 /* start of I/O page */ +#define UBAIOADDR 0760000 /* start of I/O page */ #define UBAIOPAGES 16 +#define UBAIOSIZE (UBAIOPAGES * VAX_NBPG) /* 8K I/O space */ -#if !defined(_LOCORE) && !defined(UBA_REGS_DEFINED) -/* - * DW780/DW750 hardware registers - */ -struct uba_regs { - int uba_cnfgr; /* configuration register */ - int uba_cr; /* control register */ - int uba_sr; /* status register */ - int uba_dcr; /* diagnostic control register */ - int uba_fmer; /* failed map entry register */ - int uba_fubar; /* failed UNIBUS address register */ - int pad1[2]; - int uba_brsvr[4]; - int uba_brrvr[4]; /* receive vector registers */ - int uba_dpr[16]; /* buffered data path register */ - int pad2[480]; - pt_entry_t uba_map[UBAPAGES]; /* unibus map register */ - int pad3[UBAIOPAGES]; /* no maps for device address space */ -}; -#endif - -/* uba_mr[] */ -#define UBAMR_MRV 0x80000000 /* map register valid */ -#define UBAMR_BO 0x02000000 /* byte offset bit */ -#define UBAMR_DPDB 0x01e00000 /* data path designator field */ -#define UBAMR_SBIPFN 0x001fffff /* SBI page address field */ - -#define UBAMR_DPSHIFT 21 /* shift to data path designator */ - -/* - * Number of unibus buffered data paths and possible uba's per cpu type. - */ -#define NBDPBUA 5 -#define MAXNBDP 15 +/* Some Qbus-specific defines */ +#define QBAPAGES 8192 +#define QBASIZE (QBAPAGES * VAX_NBPG) +#define QBAMAP 0x20088000 +#define QIOPAGE 0x20000000 /* - * Symbolic BUS addresses for UBAs. - */ - -#if VAX630 || VAX650 || VAX60 -#define QBAMAP 0x20088000 -#define QMEM 0x30000000 -#define QIOPAGE 0x20000000 -/* * Q-bus control registers */ #define QIPCR 0x1f40 /* from start of iopage */ @@ -111,11 +66,3 @@ struct uba_regs { #define Q_DBIIE 0x0040 /* doorbell interrupt enable */ #define Q_AUXHLT 0x0100 /* auxiliary processor halt */ #define Q_DMAQPE 0x8000 /* Q22 bus address space parity error */ -#endif - -/* - * Macro to offset a UNIBUS device address, often expressed as - * something like 0172520, by forcing it into the last 8K - * of UNIBUS memory space. - */ -#define ubdevreg(addr) ((addr) & 017777) diff --git a/sys/arch/vax/vax/autoconf.c b/sys/arch/vax/vax/autoconf.c index 45a942494c9..1b267da06f3 100644 --- a/sys/arch/vax/vax/autoconf.c +++ b/sys/arch/vax/vax/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.38 2014/10/31 10:54:39 jsg Exp $ */ +/* $OpenBSD: autoconf.c,v 1.39 2015/02/01 15:27:12 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.45 1999/10/23 14:56:05 ragge Exp $ */ /* @@ -201,8 +201,6 @@ int (*devreg[])(struct device *, void *) = { 0, }; -#define ubreg(x) ((x) & 017777) - void device_register(struct device *dev, void *aux) { |