diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-07-18 03:20:19 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-07-18 03:20:19 +0000 |
commit | a02fe3fc9aeb2a684231542d991fa476329648ab (patch) | |
tree | 6a78ec447e266bcf4b2ed9379974dfef92bd16d5 /sys/dev | |
parent | 3caa70922e50b8e238de690abee2f8a63d25d485 (diff) |
Added pci_mapreg* interface from NetBSD.
Added PCI 2.2 stuff from NetBSD
Modified if_de to use mapreg interface
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_de.c | 35 | ||||
-rw-r--r-- | sys/dev/pci/pci.c | 168 | ||||
-rw-r--r-- | sys/dev/pci/pci_map.c | 274 | ||||
-rw-r--r-- | sys/dev/pci/pcireg.h | 29 | ||||
-rw-r--r-- | sys/dev/pci/pcivar.h | 25 |
5 files changed, 367 insertions, 164 deletions
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 8bf38bb1df5..8b989fee6f4 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.40 1999/02/26 17:05:51 jason Exp $ */ +/* $OpenBSD: if_de.c,v 1.41 1999/07/18 03:20:18 csapuntz Exp $ */ /* $NetBSD: if_de.c,v 1.45 1997/06/09 00:34:18 thorpej Exp $ */ /*- @@ -5237,11 +5237,6 @@ tulip_pci_attach( } while (0) #endif /* __NetBSD__ */ -#if defined(__OpenBSD__) - pci_chipset_tag_t pc = pa->pa_pc; - bus_addr_t tulipbase; - bus_size_t tulipsize; -#endif int retval, idx; u_int32_t revinfo, cfdainfo, id; #if !defined(TULIP_IOMAPPED) && defined(__FreeBSD__) @@ -5407,7 +5402,7 @@ tulip_pci_attach( #endif #endif /* __bsdi__ */ -#if defined(__NetBSD__) +#if defined(__NetBSD__) || defined(__OpenBSD__) csr_base = 0; ioh_valid = (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, @@ -5417,32 +5412,6 @@ tulip_pci_attach( &memt, &memh, NULL, NULL) == 0); #endif -#if defined(__OpenBSD__) - ioh_valid = 0; - memh_valid = 0; - csr_base = 0; - -#if defined(TULIP_IO_MAPPED) - iot = pa->pa_iot; - retval = pci_io_find(pc, pa->pa_tag, PCI_CBIO, &tulipbase, &tulipsize); - if (!retval) - retval = bus_space_map(pa->pa_iot, tulipbase, tulipsize, 0, - &ioh); - - ioh_valid = (retval == 0); -#else - memt = pa->pa_memt; - retval = pci_mem_find(pc, pa->pa_tag, PCI_CBMA, &tulipbase, &tulipsize, - NULL); - if (!retval) - retval = bus_space_map(pa->pa_memt, tulipbase, tulipsize, 0, - &memh); - - memh_valid = (retval == 0); -#endif - -#endif - #if defined(__OpenBSD__) || defined(__NetBSD__) #if defined(TULIP_IOMAPPED) if (ioh_valid) { diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index d19037527b7..15c45120d1a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.14 1998/10/29 18:11:53 csapuntz Exp $ */ +/* $OpenBSD: pci.c,v 1.15 1999/07/18 03:20:18 csapuntz Exp $ */ /* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */ /* @@ -173,6 +173,10 @@ pciattach(parent, self, aux) pa.pa_id = id; pa.pa_class = class; + /* This is a simplification of the NetBSD code. + We don't support turning off I/O or memory + on broken hardware. <csapuntz@stanford.edu> */ + pa.pa_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; if (bus == 0) { pa.pa_intrswiz = 0; pa.pa_intrtag = tag; @@ -260,143 +264,49 @@ pcisubmatch(parent, match, aux) return (success); } -int -pci_io_find(pc, pcitag, reg, iobasep, iosizep) - pci_chipset_tag_t pc; - pcitag_t pcitag; - int reg; - bus_addr_t *iobasep; - bus_size_t *iosizep; +void +set_pci_isa_bridge_callback(fn, arg) + void (*fn) __P((void *)); + void *arg; { - pcireg_t addrdata, sizedata; - int s; - - if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) - panic("pci_io_find: bad request"); - - /* XXX? - * Section 6.2.5.1, `Address Maps', tells us that: - * - * 1) The builtin software should have already mapped the device in a - * reasonable way. - * - * 2) A device which wants 2^n bytes of memory will hardwire the bottom - * n bits of the address to 0. As recommended, we write all 1s and see - * what we get back. - */ - addrdata = pci_conf_read(pc, pcitag, reg); - - s = splhigh(); - pci_conf_write(pc, pcitag, reg, 0xffffffff); - sizedata = pci_conf_read(pc, pcitag, reg); - pci_conf_write(pc, pcitag, reg, addrdata); - splx(s); - - if (PCI_MAPREG_TYPE(addrdata) != PCI_MAPREG_TYPE_IO) - panic("pci_io_find: not an I/O region"); - - if (iobasep != NULL) - *iobasep = PCI_MAPREG_IO_ADDR(addrdata); - if (iosizep != NULL) - *iosizep = PCI_MAPREG_IO_SIZE(sizedata); -#ifdef powerpc - /* - * Open Firmware (yuck) shuts down devices before entering a - * program so we need to bring them back 'online' to respond - * to bus accesses... so far this is true on the power.4e. - */ - s = splhigh(); - sizedata = pci_conf_read(pc, pcitag, PCI_COMMAND_STATUS_REG); - sizedata |= (PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_IO_ENABLE | - PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE); - pci_conf_write(pc, pcitag, PCI_COMMAND_STATUS_REG, sizedata); - splx(s); -#endif - - return (0); + if (pci_isa_bridge_callback != NULL) + panic("set_pci_isa_bridge_callback"); + pci_isa_bridge_callback = fn; + pci_isa_bridge_callback_arg = arg; } int -pci_mem_find(pc, pcitag, reg, membasep, memsizep, cacheablep) +pci_get_capability(pc, tag, capid, offset, value) pci_chipset_tag_t pc; - pcitag_t pcitag; - int reg; - bus_addr_t *membasep; - bus_size_t *memsizep; - int *cacheablep; + pcitag_t tag; + int capid; + int *offset; + pcireg_t *value; { - pcireg_t addrdata, sizedata; - int s; - - if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) - panic("pci_find_mem: bad request"); - - /* - * Section 6.2.5.1, `Address Maps', tells us that: - * - * 1) The builtin software should have already mapped the device in a - * reasonable way. - * - * 2) A device which wants 2^n bytes of memory will hardwire the bottom - * n bits of the address to 0. As recommended, we write all 1s and see - * what we get back. - */ - addrdata = pci_conf_read(pc, pcitag, reg); - - s = splhigh(); - pci_conf_write(pc, pcitag, reg, 0xffffffff); - sizedata = pci_conf_read(pc, pcitag, reg); - pci_conf_write(pc, pcitag, reg, addrdata); - splx(s); - - if (PCI_MAPREG_TYPE(addrdata) == PCI_MAPREG_TYPE_IO) - panic("pci_find_mem: I/O region"); - - switch (PCI_MAPREG_MEM_TYPE(addrdata)) { - case PCI_MAPREG_MEM_TYPE_32BIT: - case PCI_MAPREG_MEM_TYPE_32BIT_1M: - break; - case PCI_MAPREG_MEM_TYPE_64BIT: -/* XXX */ printf("pci_find_mem: 64-bit region\n"); -/* XXX */ return (1); - default: - printf("pci_find_mem: reserved region type\n"); - return (1); - } + pcireg_t reg; + unsigned int ofs; - if (membasep != NULL) - *membasep = PCI_MAPREG_MEM_ADDR(addrdata); /* PCI addr */ - if (memsizep != NULL) - *memsizep = PCI_MAPREG_MEM_SIZE(sizedata); - if (cacheablep != NULL) - *cacheablep = PCI_MAPREG_MEM_CACHEABLE(addrdata); + reg = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); + if (!(reg & PCI_STATUS_CAPLIST_SUPPORT)) + return (0); -#ifdef powerpc - /* - * Open Firmware (yuck) shuts down devices before entering a - * program so we need to bring them back 'online' to respond - * to bus accesses... so far this is true on the power.4e. - */ - s = splhigh(); - sizedata = pci_conf_read(pc, pcitag, PCI_COMMAND_STATUS_REG); - sizedata |= (PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE | - PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE); - pci_conf_write(pc, pcitag, PCI_COMMAND_STATUS_REG, sizedata); - splx(s); + ofs = PCI_CAPLIST_PTR(pci_conf_read(pc, tag, PCI_CAPLISTPTR_REG)); + while (ofs != 0) { +#ifdef DIAGNOSTIC + if ((ofs & 3) || (ofs < 0x40)) + panic("pci_get_capability"); #endif + reg = pci_conf_read(pc, tag, ofs); + if (PCI_CAPLIST_CAP(reg) == capid) { + if (offset) + *offset = ofs; + if (value) + *value = reg; + return (1); + } + ofs = PCI_CAPLIST_NEXT(reg); + } - return 0; -} - -void -set_pci_isa_bridge_callback(fn, arg) - void (*fn) __P((void *)); - void *arg; -{ - - if (pci_isa_bridge_callback != NULL) - panic("set_pci_isa_bridge_callback"); - pci_isa_bridge_callback = fn; - pci_isa_bridge_callback_arg = arg; + return (0); } diff --git a/sys/dev/pci/pci_map.c b/sys/dev/pci/pci_map.c new file mode 100644 index 00000000000..a68ba971ada --- /dev/null +++ b/sys/dev/pci/pci_map.c @@ -0,0 +1,274 @@ +/* $NetBSD: pci_map.c,v 1.5 1998/08/15 10:10:54 mycroft Exp $ */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Charles M. Hannum. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * PCI device mapping. + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/device.h> + +#include <dev/pci/pcireg.h> +#include <dev/pci/pcivar.h> + + +static int nbsd_pci_io_find __P((pci_chipset_tag_t, pcitag_t, int, pcireg_t, + bus_addr_t *, bus_size_t *, int *)); +static int nbsd_pci_mem_find __P((pci_chipset_tag_t, pcitag_t, int, pcireg_t, + bus_addr_t *, bus_size_t *, int *)); + +static int +nbsd_pci_io_find(pc, tag, reg, type, basep, sizep, flagsp) + pci_chipset_tag_t pc; + pcitag_t tag; + int reg; + pcireg_t type; + bus_addr_t *basep; + bus_size_t *sizep; + int *flagsp; +{ + pcireg_t address, mask; + int s; + + if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) + panic("pci_io_find: bad request"); + + /* + * Section 6.2.5.1, `Address Maps', tells us that: + * + * 1) The builtin software should have already mapped the device in a + * reasonable way. + * + * 2) A device which wants 2^n bytes of memory will hardwire the bottom + * n bits of the address to 0. As recommended, we write all 1s and see + * what we get back. + */ + s = splhigh(); + address = pci_conf_read(pc, tag, reg); + pci_conf_write(pc, tag, reg, 0xffffffff); + mask = pci_conf_read(pc, tag, reg); + pci_conf_write(pc, tag, reg, address); + splx(s); + + if (PCI_MAPREG_TYPE(address) != PCI_MAPREG_TYPE_IO) { + printf("pci_io_find: expected type i/o, found mem\n"); + return (1); + } + + if (PCI_MAPREG_IO_SIZE(mask) == 0) { + printf("pci_io_find: void region\n"); + return (1); + } + + if (basep != 0) + *basep = PCI_MAPREG_IO_ADDR(address); + if (sizep != 0) + *sizep = PCI_MAPREG_IO_SIZE(mask); + if (flagsp != 0) + *flagsp = 0; + + return (0); +} + +static int +nbsd_pci_mem_find(pc, tag, reg, type, basep, sizep, flagsp) + pci_chipset_tag_t pc; + pcitag_t tag; + int reg; + pcireg_t type; + bus_addr_t *basep; + bus_size_t *sizep; + int *flagsp; +{ + pcireg_t address, mask; + int s; + + if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) + panic("pci_find_mem: bad request"); + + /* + * Section 6.2.5.1, `Address Maps', tells us that: + * + * 1) The builtin software should have already mapped the device in a + * reasonable way. + * + * 2) A device which wants 2^n bytes of memory will hardwire the bottom + * n bits of the address to 0. As recommended, we write all 1s and see + * what we get back. + */ + s = splhigh(); + address = pci_conf_read(pc, tag, reg); + pci_conf_write(pc, tag, reg, 0xffffffff); + mask = pci_conf_read(pc, tag, reg); + pci_conf_write(pc, tag, reg, address); + splx(s); + + if (PCI_MAPREG_TYPE(address) != PCI_MAPREG_TYPE_MEM) { + printf("pci_mem_find: expected type mem, found i/o\n"); + return (1); + } + if (type != -1 && + PCI_MAPREG_MEM_TYPE(address) != PCI_MAPREG_MEM_TYPE(type)) { + printf("pci_mem_find: expected mem type %08x, found %08x\n", + PCI_MAPREG_MEM_TYPE(type), + PCI_MAPREG_MEM_TYPE(address)); + return (1); + } + + if (PCI_MAPREG_MEM_SIZE(mask) == 0) { + printf("pci_mem_find: void region\n"); + return (1); + } + + switch (PCI_MAPREG_MEM_TYPE(address)) { + case PCI_MAPREG_MEM_TYPE_32BIT: + case PCI_MAPREG_MEM_TYPE_32BIT_1M: + break; + case PCI_MAPREG_MEM_TYPE_64BIT: + printf("pci_mem_find: 64-bit memory mapping register\n"); + return (1); + default: + printf("pci_mem_find: reserved mapping register type\n"); + return (1); + } + + if (basep != 0) + *basep = PCI_MAPREG_MEM_ADDR(address); + if (sizep != 0) + *sizep = PCI_MAPREG_MEM_SIZE(mask); + if (flagsp != 0) + *flagsp = PCI_MAPREG_MEM_CACHEABLE(address) +#ifndef __OpenBSD__ + ? BUS_SPACE_MAP_CACHEABLE : 0 +#endif + ; + + return (0); +} + +int +pci_io_find(pc, pcitag, reg, iobasep, iosizep) + pci_chipset_tag_t pc; + pcitag_t pcitag; + int reg; + bus_addr_t *iobasep; + bus_size_t *iosizep; +{ + return (nbsd_pci_io_find(pc, pcitag, reg, 0, iobasep, iosizep, 0)); +} + +int +pci_mem_find(pc, pcitag, reg, membasep, memsizep, cacheablep) + pci_chipset_tag_t pc; + pcitag_t pcitag; + int reg; + bus_addr_t *membasep; + bus_size_t *memsizep; + int *cacheablep; +{ + return (nbsd_pci_mem_find(pc, pcitag, reg, -1, membasep, memsizep, + cacheablep)); +} + + +int +pci_mapreg_info(pc, tag, reg, type, basep, sizep, flagsp) + pci_chipset_tag_t pc; + pcitag_t tag; + int reg; + pcireg_t type; + bus_addr_t *basep; + bus_size_t *sizep; + int *flagsp; +{ + + if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) + return (nbsd_pci_io_find(pc, tag, reg, type, basep, sizep, + flagsp)); + else + return (nbsd_pci_mem_find(pc, tag, reg, type, basep, sizep, + flagsp)); +} + +int +pci_mapreg_map(pa, reg, type, busflags, tagp, handlep, basep, sizep) + struct pci_attach_args *pa; + int reg, busflags; + pcireg_t type; + bus_space_tag_t *tagp; + bus_space_handle_t *handlep; + bus_addr_t *basep; + bus_size_t *sizep; +{ + bus_space_tag_t tag; + bus_space_handle_t handle; + bus_addr_t base; + bus_size_t size; + int flags; + + if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) { + if ((pa->pa_flags & PCI_FLAGS_IO_ENABLED) == 0) + return (1); + if (nbsd_pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, &base, + &size, &flags)) + return (1); + tag = pa->pa_iot; + } else { + if ((pa->pa_flags & PCI_FLAGS_MEM_ENABLED) == 0) + return (1); + if (nbsd_pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, &base, + &size, &flags)) + return (1); + tag = pa->pa_memt; + } + + if (bus_space_map(tag, base, size, busflags | flags, &handle)) + return (1); + + if (tagp != 0) + *tagp = tag; + if (handlep != 0) + *handlep = handle; + if (basep != 0) + *basep = base; + if (sizep != 0) + *sizep = size; + + return (0); +} diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index 7463c8a72a1..a22fa6dc8fa 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcireg.h,v 1.10 1999/01/30 23:24:22 niklas Exp $ */ +/* $OpenBSD: pcireg.h,v 1.11 1999/07/18 03:20:18 csapuntz Exp $ */ /* $NetBSD: pcireg.h,v 1.11 1996/08/10 15:42:33 mycroft Exp $ */ /* @@ -74,6 +74,7 @@ typedef u_int16_t pci_product_id_t; #define PCI_COMMAND_SERR_ENABLE 0x00000100 #define PCI_COMMAND_BACKTOBACK_ENABLE 0x00000200 +#define PCI_STATUS_CAPLIST_SUPPORT 0x00100000 #define PCI_STATUS_66MHZ_SUPPORT 0x00200000 #define PCI_STATUS_UDF_SUPPORT 0x00400000 #define PCI_STATUS_BACKTOBACK_SUPPORT 0x00800000 @@ -345,6 +346,32 @@ typedef u_int8_t pci_revision_t; #define PCI_MAPREG_IO_ADDR_MASK 0xfffffffe /* + * Cardbus CIS pointer (PCI rev. 2.1) + */ +#define PCI_CARDBUS_CIS_REG 0x28 + +/* + * Subsystem identification register; contains a vendor ID and a device ID. + * Types/macros for PCI_ID_REG apply. + * (PCI rev. 2.1) + */ +#define PCI_SUBSYS_ID_REG 0x2c + +/* + * capabilities link list (PCI rev. 2.2) + */ +#define PCI_CAPLISTPTR_REG 0x34 +#define PCI_CAPLIST_PTR(cpr) ((cpr) & 0xff) +#define PCI_CAPLIST_NEXT(cr) (((cr) >> 8) & 0xff) +#define PCI_CAPLIST_CAP(cr) ((cr) & 0xff) +#define PCI_CAP_PWRMGMT 1 +#define PCI_CAP_AGP 2 +#define PCI_CAP_VPD 3 +#define PCI_CAP_SLOTID 4 +#define PCI_CAP_MBI 5 +#define PCI_CAP_HOTSWAP 6 + +/* * Interrupt Configuration Register; contains interrupt pin and line. */ #define PCI_INTERRUPT_REG 0x3c diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index e54214335bb..deef4a9da7c 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcivar.h,v 1.15 1999/06/16 14:38:36 espie Exp $ */ +/* $OpenBSD: pcivar.h,v 1.16 1999/07/18 03:20:18 csapuntz Exp $ */ /* $NetBSD: pcivar.h,v 1.23 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -104,6 +104,7 @@ struct pci_attach_args { bus_space_tag_t pa_memt; /* pci mem space tag */ bus_dma_tag_t pa_dmat; /* DMA tag */ pci_chipset_tag_t pa_pc; + int pa_flags; /* flags; see below */ u_int pa_device; u_int pa_function; @@ -125,6 +126,14 @@ struct pci_attach_args { }; /* + * Flags given in the bus and device attachment args. + * + * OpenBSD doesn't actually use them yet -- csapuntz@cvs.openbsd.org + */ +#define PCI_FLAGS_IO_ENABLED 0x01 /* I/O space is enabled */ +#define PCI_FLAGS_MEM_ENABLED 0x02 /* memory space is enabled */ + +/* * Locators devices that attach to 'pcibus', as specified to config. */ #define pcibuscf_bus cf_loc[0] @@ -143,11 +152,25 @@ struct pci_attach_args { * Configuration space access and utility functions. (Note that most, * e.g. make_tag, conf_read, conf_write are declared by pci_machdep.h.) */ +/* + * Configuration space access and utility functions. (Note that most, + * e.g. make_tag, conf_read, conf_write are declared by pci_machdep.h.) + */ +int pci_mapreg_info __P((pci_chipset_tag_t, pcitag_t, int, pcireg_t, + bus_addr_t *, bus_size_t *, int *)); +int pci_mapreg_map __P((struct pci_attach_args *, int, pcireg_t, int, + bus_space_tag_t *, bus_space_handle_t *, bus_addr_t *, + bus_size_t *)); + + int pci_io_find __P((pci_chipset_tag_t, pcitag_t, int, bus_addr_t *, bus_size_t *)); int pci_mem_find __P((pci_chipset_tag_t, pcitag_t, int, bus_addr_t *, bus_size_t *, int *)); +int pci_get_capability __P((pci_chipset_tag_t, pcitag_t, int, + int *, pcireg_t *)); + /* * Helper functions for autoconfiguration. */ |