From 41f0cf8abc9a268fdc69c3e5d6bafe1854ce776d Mon Sep 17 00:00:00 2001 From: tsutsui Date: Mon, 25 Nov 2002 13:41:35 +0000 Subject: [PATCH] - Remove code to map PCI_MAPREG_TYPE_MEM, which is not supported by 53c974. - Print PCI devinfo in the attachment message. --- sys/dev/pci/pcscp.c | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/sys/dev/pci/pcscp.c b/sys/dev/pci/pcscp.c index 57feb61bc739..9fe1808e6532 100644 --- a/sys/dev/pci/pcscp.c +++ b/sys/dev/pci/pcscp.c @@ -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 -__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 #include @@ -73,7 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.21 2002/11/15 22:13:12 tsutsui Exp $"); #include #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 @@ pcscp_attach(parent, self, aux) 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);