mapping pci configuration space (not subregion)

This commit is contained in:
igy 2003-07-13 07:15:22 +00:00
parent 1087696257
commit cdb56b83f6
4 changed files with 22 additions and 40 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0.c,v 1.10 2003/07/13 02:11:58 igy Exp $ */
/* $NetBSD: ixp12x0.c,v 1.11 2003/07/13 07:15:22 igy Exp $ */
/*
* Copyright (c) 2002, 2003
* Ichiro FUKUHARA <ichiro@ichiro.org>.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0.c,v 1.10 2003/07/13 02:11:58 igy Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0.c,v 1.11 2003/07/13 07:15:22 igy Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -60,26 +60,24 @@ ixp12x0_attach(sc)
ixp12x0_softc = sc;
printf("\n");
sc->sc_iot = &ixp12x0_bs_tag;
/*
* Subregion for PCI Configuration Spase Registers
* Mapping for PCI Configuration Spase Registers
*/
if (bus_space_subregion(sc->sc_iot, sc->sc_ioh,
IXP12X0_PCI_VBASE - IXP12X0_IO_VBASE,
IXP12X0_PCI_SIZE, &sc->sc_pci_ioh))
panic("%s: unable to subregion PCI registers",
sc->sc_dev.dv_xname);
if (bus_space_map(sc->sc_iot, IXP12X0_PCI_HWBASE, IXP12X0_PCI_SIZE,
0, &sc->sc_pci_ioh))
panic("%s: unable to map PCI registers", sc->sc_dev.dv_xname);
if (bus_space_map(sc->sc_iot, IXP12X0_PCI_TYPE0_HWBASE,
IXP12X0_PCI_TYPE0_SIZE, 0, &sc->sc_conf0_ioh))
panic("%s: unable to map PCI Configutation 0\n",
sc->sc_dev.dv_xname);
if (bus_space_map(sc->sc_iot, IXP12X0_PCI_TYPE1_HWBASE,
IXP12X0_PCI_TYPE0_SIZE, 1, &sc->sc_conf1_ioh))
panic("%s: unable to map PCI Configutation 1\n",
sc->sc_dev.dv_xname);
if (bus_space_subregion(sc->sc_iot, sc->sc_ioh,
IXP12X0_PCI_TYPE0_VBASE - IXP12X0_IO_VBASE,
IXP12X0_PCI_TYPE0_SIZE, &sc->sc_conf0_ioh))
panic("%s: unable to subregion PCI Configutation 0\n",
sc->sc_dev.dv_xname);
if (bus_space_subregion(sc->sc_iot, sc->sc_ioh,
IXP12X0_PCI_TYPE1_VBASE - IXP12X0_IO_VBASE,
IXP12X0_PCI_TYPE1_SIZE, &sc->sc_conf1_ioh))
panic("%s: unable to subregion PCI Configutation 1\n",
sc->sc_dev.dv_xname);
/*
* PCI bus reset
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0_io.c,v 1.8 2003/07/13 02:11:58 igy Exp $ */
/* $NetBSD: ixp12x0_io.c,v 1.9 2003/07/13 07:15:22 igy Exp $ */
/*
* Copyright (c) 2002, 2003
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_io.c,v 1.8 2003/07/13 02:11:58 igy Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_io.c,v 1.9 2003/07/13 07:15:22 igy Exp $");
/*
* bus_space I/O functions for ixp12x0
@ -134,15 +134,6 @@ struct bus_space ixp12x0_bs_tag = {
bs_notimpl_bs_c_8,
};
void
ixp12x0_bs_init(bs, cookie)
bus_space_tag_t bs;
void *cookie;
{
*bs = ixp12x0_bs_tag;
bs->bs_cookie = cookie;
}
/* Common routines */
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0var.h,v 1.4 2003/07/13 02:11:58 igy Exp $ */
/* $NetBSD: ixp12x0var.h,v 1.5 2003/07/13 07:15:23 igy Exp $ */
/*
* Copyright (c) 2002
* Ichiro FUKUHARA <ichiro@ichiro.org>.
@ -103,9 +103,6 @@ struct pmap_ent {
extern struct bus_space ixp12x0_bs_tag;
void ixp12x0_bs_init(bus_space_tag_t, void *);
void ixp12x0_io_bs_init(bus_space_tag_t, void *);
void ixp12x0_mem_bs_init(bus_space_tag_t, void *);
void ixp12x0_pci_init(pci_chipset_tag_t, void *);
void ixp12x0_pci_dma_init(struct ixp12x0_softc *);
void ixp12x0_attach(struct ixp12x0_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0_mainbus.c,v 1.5 2003/03/25 06:53:16 igy Exp $ */
/* $NetBSD: ixp12x0_mainbus.c,v 1.6 2003/07/13 07:15:23 igy Exp $ */
/*
* Copyright (c) 2002
* Ichiro FUKUHARA <ichiro@ichiro.org>.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_mainbus.c,v 1.5 2003/03/25 06:53:16 igy Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_mainbus.c,v 1.6 2003/07/13 07:15:23 igy Exp $");
/*
* front-end for the ixp12x0 I/O Processor.
@ -73,10 +73,6 @@ ixp12x0_mainbus_attach(struct device *parent, struct device *self, void *aux)
{
struct ixp12x0_softc *sc = (void *) self;
ixp12x0_bs_init(&ixp12x0_bs_tag, sc);
sc->sc_iot = &ixp12x0_bs_tag;
sc->sc_ioh = IXP12X0_IO_VBASE;
/*
* Initialize the interrupt part of our PCI chipset tag
*/