Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mvme68k/dev Add a bus_space_tag_t field to the mvme...



details:   https://anonhg.NetBSD.org/src/rev/d5acdb0ea34d
branches:  trunk
changeset: 499591:d5acdb0ea34d
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Nov 24 09:27:42 2000 +0000

description:
Add a bus_space_tag_t field to the mvmebus_softc structure and
initialise/use it in the ASIC-specific back-ends.

diffstat:

 sys/arch/mvme68k/dev/mvmebus.h    |   3 ++-
 sys/arch/mvme68k/dev/vme_pcc.c    |  29 ++++++++++++++---------------
 sys/arch/mvme68k/dev/vme_pccreg.h |   6 +++---
 sys/arch/mvme68k/dev/vme_pccvar.h |   3 +--
 sys/arch/mvme68k/dev/vme_two.c    |  25 ++++++++++++-------------
 sys/arch/mvme68k/dev/vme_tworeg.h |   6 +++---
 sys/arch/mvme68k/dev/vme_twovar.h |   3 +--
 7 files changed, 36 insertions(+), 39 deletions(-)

diffs (197 lines):

diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/mvmebus.h
--- a/sys/arch/mvme68k/dev/mvmebus.h    Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/mvmebus.h    Fri Nov 24 09:27:42 2000 +0000
@@ -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_softc {
        struct device           sc_dev;
+       bus_space_tag_t         sc_bust;
        bus_dma_tag_t           sc_dmat;
        short                   sc_irqref[8];
        void                    *sc_chip;
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_pcc.c
--- a/sys/arch/mvme68k/dev/vme_pcc.c    Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_pcc.c    Fri Nov 24 09:27:42 2000 +0000
@@ -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,11 +167,20 @@
        sc = (struct vme_pcc_softc *) self;
        pa = aux;
 
-       sc->sc_bust = pa->pa_bust;
+       /* Map the VMEchip's registers */
+       bus_space_map(pa->pa_bust, pa->pa_offset, VME1REG_SIZE, 0,
+           &sc->sc_bush);
 
-       /* Map the VMEchip's registers */
-       bus_space_map(sc->sc_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;
@@ -238,16 +247,6 @@
        } 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);
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_pccreg.h
--- a/sys/arch/mvme68k/dev/vme_pccreg.h Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_pccreg.h Fri Nov 24 09:27:42 2000 +0000
@@ -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
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_pccvar.h
--- a/sys/arch/mvme68k/dev/vme_pccvar.h Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_pccvar.h Fri Nov 24 09:27:42 2000 +0000
@@ -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];
 };
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_two.c
--- a/sys/arch/mvme68k/dev/vme_two.c    Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_two.c    Fri Nov 24 09:27:42 2000 +0000
@@ -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 @@
        sc = vmetwo_sc = (struct vmetwo_softc *) self;
        ma = aux;
 
-       sc->sc_bust = ma->ma_bust;
-
        /*
         * Map the local control registers
         */
@@ -153,6 +151,17 @@
            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 @@
                    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);
 }
 
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_tworeg.h
--- a/sys/arch/mvme68k/dev/vme_tworeg.h Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_tworeg.h Fri Nov 24 09:27:42 2000 +0000
@@ -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))
 
 
 /*
diff -r 8dafd7eb2059 -r d5acdb0ea34d sys/arch/mvme68k/dev/vme_twovar.h
--- a/sys/arch/mvme68k/dev/vme_twovar.h Fri Nov 24 09:05:55 2000 +0000
+++ b/sys/arch/mvme68k/dev/vme_twovar.h Fri Nov 24 09:27:42 2000 +0000
@@ -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];



Home | Main Index | Thread Index | Old Index