Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci - The GEM registers are always memory type regis...
details: https://anonhg.NetBSD.org/src/rev/4f7bfd8f96ba
branches: trunk
changeset: 516173:4f7bfd8f96ba
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Oct 18 03:48:48 2001 +0000
description:
- The GEM registers are always memory type registers. Don't use a
broken hueristic to determine memory vs. i/o (one should never make
an assumption that the bus_space_tag_t is a pointer, as this code
did).
- Fix the "can't map registers" error message.
- Garbage-collect some code that is not relevant to the GEM (which
was already #if 0'd out).
- Cluster all the SPARC-specific code into one place (will be
replaced with Properties once that is fleshed out).
diffstat:
sys/dev/pci/if_gem_pci.c | 44 +++++++++++++++++---------------------------
1 files changed, 17 insertions(+), 27 deletions(-)
diffs (83 lines):
diff -r 833f29357d65 -r 4f7bfd8f96ba sys/dev/pci/if_gem_pci.c
--- a/sys/dev/pci/if_gem_pci.c Thu Oct 18 03:33:33 2001 +0000
+++ b/sys/dev/pci/if_gem_pci.c Thu Oct 18 03:48:48 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gem_pci.c,v 1.2 2001/09/24 04:39:40 eeh Exp $ */
+/* $NetBSD: if_gem_pci.c,v 1.3 2001/10/18 03:48:48 thorpej Exp $ */
/*
*
@@ -117,50 +117,40 @@
struct gem_pci_softc *gsc = (void *)self;
struct gem_softc *sc = &gsc->gsc_gem;
pci_intr_handle_t intrhandle;
-#ifdef __sparc__
- /* XXX the following declarations should be elsewhere */
- extern void myetheraddr __P((u_char *));
-#endif
const char *intrstr;
- int type;
char devinfo[256];
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
- if (pa->pa_memt) {
- type = PCI_MAPREG_TYPE_MEM;
- sc->sc_bustag = pa->pa_memt;
- } else {
- type = PCI_MAPREG_TYPE_IO;
- sc->sc_bustag = pa->pa_iot;
- }
-
sc->sc_dmatag = pa->pa_dmat;
sc->sc_pci = 1; /* XXXXX should all be done in bus_dma. */
-#define PCI_GEM_BASEADDR 0x10
- if (pci_mapreg_map(pa, PCI_GEM_BASEADDR, type, 0,
+#define PCI_GEM_BASEADDR (PCI_MAPREG_START + 0x00)
+
+ /* XXX Need to check for a 64-bit mem BAR? */
+ if (pci_mapreg_map(pa, PCI_GEM_BASEADDR,
+ PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
&gsc->gsc_memt, &gsc->gsc_memh, NULL, NULL) != 0)
{
- printf(": could not map gem registers\n");
+ printf("%s: could not map gem registers\n",
+ sc->sc_dev.dv_xname);
return;
}
sc->sc_bustag = gsc->gsc_memt;
sc->sc_h = gsc->gsc_memh;
-#if 0
-/* SBUS compatible stuff? */
- sc->sc_seb = gsc->gsc_memh;
- sc->sc_etx = gsc->gsc_memh + 0x2000;
- sc->sc_erx = gsc->gsc_memh + 0x4000;
- sc->sc_mac = gsc->gsc_memh + 0x6000;
- sc->sc_mif = gsc->gsc_memh + 0x7000;
-#endif
+ /*
+ * XXX This should be done with properties, when those are
+ * XXX fleshed out.
+ */
#ifdef __sparc__
- myetheraddr(sc->sc_enaddr);
+ {
+ extern void myetheraddr __P((u_char *));
+ myetheraddr(sc->sc_enaddr);
+ }
#endif
sc->sc_burst = 16; /* XXX */
@@ -188,6 +178,6 @@
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return; /* bus_unmap ? */
+ return;
}
}
Home |
Main Index |
Thread Index |
Old Index