Add a bus_space_tag_t field to the mvmebus_softc structure and

initialise/use it in the ASIC-specific back-ends.
This commit is contained in:
scw 2000-11-24 09:27:42 +00:00
parent 06e91c089b
commit a70c48655b
7 changed files with 35 additions and 38 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mvmebus.h,v 1.4 2000/09/19 19:35:53 scw Exp $ */
/* $NetBSD: mvmebus.h,v 1.5 2000/11/24 09:27:43 scw Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -99,6 +99,7 @@ struct mvmebus_dmamap {
struct mvmebus_softc {
struct device sc_dev;
bus_space_tag_t sc_bust;
bus_dma_tag_t sc_dmat;
short sc_irqref[8];
void *sc_chip;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_pcc.c,v 1.12 2000/09/19 19:35:53 scw Exp $ */
/* $NetBSD: vme_pcc.c,v 1.13 2000/11/24 09:27:42 scw Exp $ */
/*-
* Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@ -167,12 +167,21 @@ vme_pcc_attach(parent, self, aux)
sc = (struct vme_pcc_softc *) self;
pa = aux;
sc->sc_bust = pa->pa_bust;
/* Map the VMEchip's registers */
bus_space_map(sc->sc_bust, pa->pa_offset, VME1REG_SIZE, 0,
bus_space_map(pa->pa_bust, pa->pa_offset, VME1REG_SIZE, 0,
&sc->sc_bush);
/* Initialise stuff used by the mvme68k common VMEbus front-end */
sc->sc_mvmebus.sc_bust = pa->pa_bust;
sc->sc_mvmebus.sc_dmat = pa->pa_dmat;
sc->sc_mvmebus.sc_chip = sc;
sc->sc_mvmebus.sc_nmasters = VME1_NMASTERS;
sc->sc_mvmebus.sc_masters = &vme_pcc_masters[0];
sc->sc_mvmebus.sc_nslaves = VME1_NSLAVES;
sc->sc_mvmebus.sc_slaves = &sc->sc_slave[0];
sc->sc_mvmebus.sc_intr_establish = vme_pcc_intr_establish;
sc->sc_mvmebus.sc_intr_disestablish = vme_pcc_intr_disestablish;
/* Initialize the chip. */
reg = vme1_reg_read(sc, VME1REG_SCON) & ~VME1_SCON_SYSFAIL;
vme1_reg_write(sc, VME1REG_SCON, reg);
@ -238,16 +247,6 @@ vme_pcc_attach(parent, self, aux)
} else
sc->sc_slave[VME1_SLAVE_A32].vr_am = MVMEBUS_AM_DISABLED;
/* Attach to the mvme68k common VMEbus front-end */
sc->sc_mvmebus.sc_dmat = pa->pa_dmat;
sc->sc_mvmebus.sc_chip = sc;
sc->sc_mvmebus.sc_nmasters = VME1_NMASTERS;
sc->sc_mvmebus.sc_masters = &vme_pcc_masters[0];
sc->sc_mvmebus.sc_nslaves = VME1_NSLAVES;
sc->sc_mvmebus.sc_slaves = &sc->sc_slave[0];
sc->sc_mvmebus.sc_intr_establish = vme_pcc_intr_establish;
sc->sc_mvmebus.sc_intr_disestablish = vme_pcc_intr_disestablish;
vme_pcc_attached = 1;
mvmebus_attach(&sc->sc_mvmebus);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_pccreg.h,v 1.4 2000/08/13 17:00:52 scw Exp $ */
/* $NetBSD: vme_pccreg.h,v 1.5 2000/11/24 09:27:42 scw Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -138,9 +138,9 @@
* Convenience macros for reading and writing the registers
*/
#define vme1_reg_read(sc,r) \
bus_space_read_1((sc)->sc_bust, (sc)->sc_bush, (r))
bus_space_read_1((sc)->sc_mvmebus.sc_bust, (sc)->sc_bush, (r))
#define vme1_reg_write(sc,r,v) \
bus_space_write_1((sc)->sc_bust, (sc)->sc_bush, (r), (v))
bus_space_write_1((sc)->sc_mvmebus.sc_bust, (sc)->sc_bush, (r), (v))
/*
* The Type 1 VMEchip decoder maps VME address space to system addresses

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_pccvar.h,v 1.6 2000/08/21 20:50:13 scw Exp $ */
/* $NetBSD: vme_pccvar.h,v 1.7 2000/11/24 09:27:43 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -47,7 +47,6 @@
struct vme_pcc_softc {
struct mvmebus_softc sc_mvmebus;
bus_space_tag_t sc_bust;
bus_space_handle_t sc_bush;
struct mvmebus_range sc_slave[VME1_NSLAVES];
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_two.c,v 1.11 2000/11/20 19:35:29 scw Exp $ */
/* $NetBSD: vme_two.c,v 1.12 2000/11/24 09:27:43 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -137,8 +137,6 @@ vmetwo_attach(parent, self, aux)
sc = vmetwo_sc = (struct vmetwo_softc *) self;
ma = aux;
sc->sc_bust = ma->ma_bust;
/*
* Map the local control registers
*/
@ -153,6 +151,17 @@ vmetwo_attach(parent, self, aux)
VME2GCSR_SIZE, 0, &sc->sc_gcrh);
#endif
/* Initialise stuff for the mvme68k common VMEbus front-end */
sc->sc_mvmebus.sc_bust = ma->ma_bust;
sc->sc_mvmebus.sc_dmat = ma->ma_dmat;
sc->sc_mvmebus.sc_chip = sc;
sc->sc_mvmebus.sc_nmasters = VME2_NMASTERS;
sc->sc_mvmebus.sc_masters = &sc->sc_master[0];
sc->sc_mvmebus.sc_nslaves = VME2_NSLAVES;
sc->sc_mvmebus.sc_slaves = &sc->sc_slave[0];
sc->sc_mvmebus.sc_intr_establish = vmetwo_intr_establish;
sc->sc_mvmebus.sc_intr_disestablish = vmetwo_intr_disestablish;
/* Clear out the ISR handler array */
for (i = 0; i < VMETWO_HANDLERS_SZ; i++)
vme_two_handlers[i].isr_hand = NULL;
@ -283,16 +292,6 @@ vmetwo_attach(parent, self, aux)
nmihand, NULL);
}
/* Attach to the mvme68k common VMEbus front-end */
sc->sc_mvmebus.sc_dmat = ma->ma_dmat;
sc->sc_mvmebus.sc_chip = sc;
sc->sc_mvmebus.sc_nmasters = VME2_NMASTERS;
sc->sc_mvmebus.sc_masters = &sc->sc_master[0];
sc->sc_mvmebus.sc_nslaves = VME2_NSLAVES;
sc->sc_mvmebus.sc_slaves = &sc->sc_slave[0];
sc->sc_mvmebus.sc_intr_establish = vmetwo_intr_establish;
sc->sc_mvmebus.sc_intr_disestablish = vmetwo_intr_disestablish;
mvmebus_attach(&sc->sc_mvmebus);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_tworeg.h,v 1.3 2000/08/20 17:07:42 scw Exp $ */
/* $NetBSD: vme_tworeg.h,v 1.4 2000/11/24 09:27:43 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -500,9 +500,9 @@
#define vme2_lcsr_read(s,r) \
bus_space_read_4((s)->sc_bust, (s)->sc_lcrh, (r))
bus_space_read_4((s)->sc_mvmebus.sc_bust, (s)->sc_lcrh, (r))
#define vme2_lcsr_write(s,r,v) \
bus_space_write_4((s)->sc_bust, (s)->sc_lcrh, (r), (v))
bus_space_write_4((s)->sc_mvmebus.sc_bust, (s)->sc_lcrh, (r), (v))
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_twovar.h,v 1.7 2000/08/21 20:50:13 scw Exp $ */
/* $NetBSD: vme_twovar.h,v 1.8 2000/11/24 09:27:43 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -52,7 +52,6 @@
struct vmetwo_softc {
struct mvmebus_softc sc_mvmebus;
bus_space_tag_t sc_bust;
bus_space_handle_t sc_lcrh;
bus_space_handle_t sc_gcrh;
struct mvmebus_range sc_master[VME2_NMASTERS];