summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-01-12 21:30:57 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-01-12 21:30:57 +0000
commit07da394b640372c39ffc74f48e369307686e16c6 (patch)
treedc795e11ee11cc69e6a9c0d7ad485aa5b597c974 /sys/dev
parentb197030b5af1d0d15656f931296f406b9018c6c8 (diff)
House cleaning: removing some leftover sparc bits and such
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sbus/magma.c25
-rw-r--r--sys/dev/sbus/magmareg.h15
2 files changed, 17 insertions, 23 deletions
diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c
index 62cc6c0c55e..893e56704d8 100644
--- a/sys/dev/sbus/magma.c
+++ b/sys/dev/sbus/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.1 2002/01/12 20:19:40 jason Exp $ */
+/* $OpenBSD: magma.c,v 1.2 2002/01/12 21:30:56 jason Exp $ */
/*
* magma.c
*
@@ -66,19 +66,6 @@
#include <dev/sbus/magmareg.h>
-/*
- * Select tty soft interrupt bit based on TTY ipl. (stole from zs.c)
- */
-#if PIL_TTY == 1
-# define IE_MSOFT IE_L1
-#elif PIL_TTY == 4
-# define IE_MSOFT IE_L4
-#elif PIL_TTY == 6
-# define IE_MSOFT IE_L6
-#else
-# error "no suitable software interrupt bit"
-#endif
-
/* supported cards
*
* The table below lists the cards that this driver is likely to
@@ -330,7 +317,6 @@ magma_attach(parent, dev, aux)
struct magma_board_info *card = supported_cards;
char *magma_prom = getpropstring(sa->sa_node, "magma_prom");
int chip;
- void *base;
/* find the card type */
while (card->mb_name && strcmp(magma_prom, card->mb_name))
@@ -449,9 +435,14 @@ magma_attach(parent, dev, aux)
/* init the cd1190 chips */
for (chip = 0 ; chip < card->mb_ncd1190 ; chip++) {
- struct cd1190 *cd = &sc->ms_cd1190[chip];
+ struct cd1190 *cd = &sc->ms_cd1190[chip];
- cd->cd_reg = base + card->mb_cd1190[chip];
+ if (bus_space_subregion(sc->sc_bustag, sc->sc_iohandle,
+ card->mb_cd1190[chip], CD1400_REGMAPSIZE, &cd->cd_regh)) {
+ printf(": failed to map cd1400 regs\n");
+ return;
+ }
+ cd->cd_regt = sc->sc_bustag;
dprintf(("%s attach CD1190 %d addr 0x%x (failed)\n", sc->ms_dev.dv_xname, chip, cd->cd_reg));
/* XXX don't know anything about these chips yet */
}
diff --git a/sys/dev/sbus/magmareg.h b/sys/dev/sbus/magmareg.h
index e4228dd930a..7bf580c0043 100644
--- a/sys/dev/sbus/magmareg.h
+++ b/sys/dev/sbus/magmareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: magmareg.h,v 1.1 2002/01/12 20:19:40 jason Exp $ */
+/* $OpenBSD: magmareg.h,v 1.2 2002/01/12 21:30:56 jason Exp $ */
/* magmareg.h
*
@@ -98,7 +98,8 @@ struct cd1400 {
* cd1190 chip data
*/
struct cd1190 {
- __volatile u_char *cd_reg; /* chip registers */
+ bus_space_handle_t cd_regh; /* chip register handle */
+ bus_space_tag_t cd_regt; /* chip register tag */
int cd_chiprev; /* chip revision */
};
@@ -106,17 +107,19 @@ struct cd1190 {
struct magma_softc {
struct device ms_dev; /* required. must be first in softc */
+ bus_space_tag_t sc_bustag; /* our bus tag */
+ bus_space_handle_t sc_iohandle; /* whole card registers */
+ void *sc_ih; /* interrupt vector */
+ void *sc_sih; /* softintr vector */
+
/* cd1400 chip info */
int ms_ncd1400;
struct cd1400 ms_cd1400[MAGMA_MAX_CD1400];
- void *sc_ih; /* interrupt vector */
- void *sc_sih; /* softintr vector */
- bus_space_tag_t sc_bustag;
- bus_space_handle_t sc_iohandle; /* whole card registers */
bus_space_handle_t sc_svcackrh; /* CD1400 service acknowledge receive */
bus_space_handle_t sc_svcackth; /* CD1400 service acknowledge transmit */
bus_space_handle_t sc_svcackmh; /* CD1400 service acknowledge modem */
+
/* cd1190 chip info */
int ms_ncd1190;
struct cd1190 ms_cd1190[MAGMA_MAX_CD1190];