diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-25 17:36:52 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-25 17:36:52 +0000 |
commit | 43e170744205c21b52e2c6c26109152658dbfd78 (patch) | |
tree | b4d6371aa6d80cec75c4d2d7618786deb3e7f5a6 | |
parent | 999755bd8c548c6d55d4b8af2bb43f9286b0e586 (diff) |
Let the stp driver use different bus_space_tag_t for its own device access,
and for access to the pcmcia windows from the pcmcia drivers.
-rw-r--r-- | sys/arch/sparc64/dev/stp_sbus.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/stp4020.c | 16 | ||||
-rw-r--r-- | sys/dev/sbus/stp4020var.h | 3 |
3 files changed, 13 insertions, 10 deletions
diff --git a/sys/arch/sparc64/dev/stp_sbus.c b/sys/arch/sparc64/dev/stp_sbus.c index 13070497042..858412eba96 100644 --- a/sys/arch/sparc64/dev/stp_sbus.c +++ b/sys/arch/sparc64/dev/stp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp_sbus.c,v 1.3 2003/06/24 21:54:39 henric Exp $ */ +/* $OpenBSD: stp_sbus.c,v 1.4 2003/06/25 17:36:51 miod Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -152,9 +152,11 @@ stpattach(parent, self, aux) } else if (i < STP4020_BANK_CTRL) { /* banks 1-3 */ sc->sc_socks[0].windows[i-1].winaddr = bh; + sc->sc_socks[0].wintag = sc->sc_bustag; } else { /* banks 5-7 */ sc->sc_socks[1].windows[i-5].winaddr = bh; + sc->sc_socks[1].wintag = sc->sc_bustag; } } diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index 4f38f7e0412..afd8993789c 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp4020.c,v 1.5 2003/06/23 09:28:00 miod Exp $ */ +/* $OpenBSD: stp4020.c,v 1.6 2003/06/25 17:36:49 miod Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -589,7 +589,7 @@ stp4020_chip_mem_alloc(pch, size, pcmhp) struct stp4020_socket *h = (struct stp4020_socket *)pch; /* we can not do much here, defere work to _mem_map */ - pcmhp->memt = h->tag; + pcmhp->memt = h->wintag; pcmhp->size = size; pcmhp->addr = 0; pcmhp->mhandle = 0; @@ -618,13 +618,13 @@ stp4020_chip_mem_map(pch, kind, card_addr, size, pcmhp, offsetp, windowp) struct stp4020_socket *h = (struct stp4020_socket *)pch; int win = (kind & PCMCIA_MEM_ATTR) ? STP_WIN_ATTR : STP_WIN_MEM; - pcmhp->memt = h->tag; - bus_space_subregion(h->tag, h->windows[win].winaddr, + pcmhp->memt = h->wintag; + bus_space_subregion(h->wintag, h->windows[win].winaddr, card_addr, size, &pcmhp->memh); pcmhp->size = size; pcmhp->realsize = STP4020_WINDOW_SIZE - card_addr; *offsetp = 0; - *windowp = 0; + *windowp = win; return (0); } @@ -646,7 +646,7 @@ stp4020_chip_io_alloc(pch, start, size, align, pcihp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; - pcihp->iot = h->tag; + pcihp->iot = h->wintag; pcihp->ioh = h->windows[STP_WIN_IO].winaddr; pcihp->size = size; return (0); @@ -670,8 +670,8 @@ stp4020_chip_io_map(pch, width, offset, size, pcihp, windowp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; - pcihp->iot = h->tag; - bus_space_subregion(h->tag, h->windows[STP_WIN_IO].winaddr, + pcihp->iot = h->wintag; + bus_space_subregion(h->wintag, h->windows[STP_WIN_IO].winaddr, offset, size, &pcihp->ioh); *windowp = 0; return (0); diff --git a/sys/dev/sbus/stp4020var.h b/sys/dev/sbus/stp4020var.h index c4ad70f6a80..ebe9ead1e6f 100644 --- a/sys/dev/sbus/stp4020var.h +++ b/sys/dev/sbus/stp4020var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stp4020var.h,v 1.1 2003/06/23 09:28:00 miod Exp $ */ +/* $OpenBSD: stp4020var.h,v 1.2 2003/06/25 17:36:49 miod Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -57,6 +57,7 @@ struct stp4020_socket { (void *); void *intrarg; /* Card interrupt handler argument */ int ipl; /* Interrupt level suggested by card */ + bus_space_tag_t wintag; /* windows access tag */ struct { bus_space_handle_t winaddr;/* this window's address */ } windows[STP4020_NWIN]; |