xref: /freebsd/sys/x86/include/pci_cfgreg.h (revision 2dd1bdf1834c53d048d3d9a7079b45afea5cecd7)
11368987aSJohn Baldwin /*-
21368987aSJohn Baldwin  * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
31368987aSJohn Baldwin  * All rights reserved.
41368987aSJohn Baldwin  *
51368987aSJohn Baldwin  * Redistribution and use in source and binary forms, with or without
61368987aSJohn Baldwin  * modification, are permitted provided that the following conditions
71368987aSJohn Baldwin  * are met:
81368987aSJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
91368987aSJohn Baldwin  *    notice unmodified, this list of conditions, and the following
101368987aSJohn Baldwin  *    disclaimer.
111368987aSJohn Baldwin  * 2. Redistributions in binary form must reproduce the above copyright
121368987aSJohn Baldwin  *    notice, this list of conditions and the following disclaimer in the
131368987aSJohn Baldwin  *    documentation and/or other materials provided with the distribution.
141368987aSJohn Baldwin  *
151368987aSJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
161368987aSJohn Baldwin  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
171368987aSJohn Baldwin  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
181368987aSJohn Baldwin  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
191368987aSJohn Baldwin  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
201368987aSJohn Baldwin  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
211368987aSJohn Baldwin  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
221368987aSJohn Baldwin  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
231368987aSJohn Baldwin  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
241368987aSJohn Baldwin  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251368987aSJohn Baldwin  *
261368987aSJohn Baldwin  * $FreeBSD$
271368987aSJohn Baldwin  *
281368987aSJohn Baldwin  */
291368987aSJohn Baldwin 
301368987aSJohn Baldwin #ifndef __X86_PCI_CFGREG_H__
311368987aSJohn Baldwin #define	__X86_PCI_CFGREG_H__
321368987aSJohn Baldwin 
331368987aSJohn Baldwin #define CONF1_ADDR_PORT    0x0cf8
341368987aSJohn Baldwin #define CONF1_DATA_PORT    0x0cfc
351368987aSJohn Baldwin 
361368987aSJohn Baldwin #define CONF1_ENABLE       0x80000000ul
371368987aSJohn Baldwin #define CONF1_ENABLE_CHK   0x80000000ul
381368987aSJohn Baldwin #define CONF1_ENABLE_MSK   0x7f000000ul
391368987aSJohn Baldwin #define CONF1_ENABLE_CHK1  0xff000001ul
401368987aSJohn Baldwin #define CONF1_ENABLE_MSK1  0x80000001ul
411368987aSJohn Baldwin #define CONF1_ENABLE_RES1  0x80000000ul
421368987aSJohn Baldwin 
431368987aSJohn Baldwin #define CONF2_ENABLE_PORT  0x0cf8
441368987aSJohn Baldwin #define CONF2_FORWARD_PORT 0x0cfa
451368987aSJohn Baldwin 
461368987aSJohn Baldwin #define CONF2_ENABLE_CHK   0x0e
471368987aSJohn Baldwin #define CONF2_ENABLE_RES   0x0e
481368987aSJohn Baldwin 
49*2dd1bdf1SJustin Hibbits rman_res_t	hostb_alloc_start(int type, rman_res_t start, rman_res_t end, rman_res_t count);
501368987aSJohn Baldwin int		pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
511368987aSJohn Baldwin int		pci_cfgregopen(void);
521368987aSJohn Baldwin u_int32_t	pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
531368987aSJohn Baldwin void		pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
541368987aSJohn Baldwin #ifdef __HAVE_PIR
551368987aSJohn Baldwin void		pci_pir_open(void);
561368987aSJohn Baldwin int		pci_pir_probe(int bus, int require_parse);
571368987aSJohn Baldwin int		pci_pir_route_interrupt(int bus, int device, int func, int pin);
581368987aSJohn Baldwin #endif
591368987aSJohn Baldwin 
601368987aSJohn Baldwin #endif /* !__X86_PCI_CFGREG_H__ */
61