Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci - Remove code to map PCI_MAPREG_TYPE_MEM, which ...
details: https://anonhg.NetBSD.org/src/rev/2077537e7f13
branches: trunk
changeset: 539755:2077537e7f13
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Mon Nov 25 13:41:35 2002 +0000
description:
- Remove code to map PCI_MAPREG_TYPE_MEM, which is not supported by 53c974.
- Print PCI devinfo in the attachment message.
diffstat:
sys/dev/pci/pcscp.c | 39 ++++++++++++---------------------------
1 files changed, 12 insertions(+), 27 deletions(-)
diffs (79 lines):
diff -r 6014646341ec -r 2077537e7f13 sys/dev/pci/pcscp.c
--- a/sys/dev/pci/pcscp.c Mon Nov 25 13:11:36 2002 +0000
+++ b/sys/dev/pci/pcscp.c Mon Nov 25 13:41:35 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcscp.c,v 1.21 2002/11/15 22:13:12 tsutsui Exp $ */
+/* $NetBSD: pcscp.c,v 1.22 2002/11/25 13:41:35 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.21 2002/11/15 22:13:12 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.22 2002/11/25 13:41:35 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -73,7 +73,6 @@
#include <dev/pci/pcscpreg.h>
#define IO_MAP_REG 0x10
-#define MEM_MAP_REG 0x14
struct pcscp_softc {
struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */
@@ -169,42 +168,28 @@
struct pci_attach_args *pa = aux;
struct pcscp_softc *esc = (void *)self;
struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
- bus_space_tag_t st, iot, memt;
- bus_space_handle_t sh, ioh, memh;
- int ioh_valid, memh_valid;
+ bus_space_tag_t iot;
+ bus_space_handle_t ioh;
pci_intr_handle_t ih;
const char *intrstr;
pcireg_t csr;
bus_dma_segment_t seg;
int error, rseg;
+ char devinfo[256];
- ioh_valid = (pci_mapreg_map(pa, IO_MAP_REG,
- PCI_MAPREG_TYPE_IO, 0,
- &iot, &ioh, NULL, NULL) == 0);
-#if 0 /* XXX cannot use memory map? */
- memh_valid = (pci_mapreg_map(pa, MEM_MAP_REG,
- PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
- &memt, &memh, NULL, NULL) == 0);
-#else
- memh_valid = 0;
-#endif
+ pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
+ printf(": %s\n", devinfo);
- if (memh_valid) {
- st = memt;
- sh = memh;
- } else if (ioh_valid) {
- st = iot;
- sh = ioh;
- } else {
- printf(": unable to map registers\n");
+ if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0,
+ &iot, &ioh, NULL, NULL)) {
+ printf("%s: unable to map registers\n", sc->sc_dev.dv_xname);
return;
}
- printf("\n");
sc->sc_glue = &pcscp_glue;
- esc->sc_st = st;
- esc->sc_sh = sh;
+ esc->sc_st = iot;
+ esc->sc_sh = ioh;
esc->sc_dmat = pa->pa_dmat;
csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
Home |
Main Index |
Thread Index |
Old Index