pcieb.h revision 83e6495b5bcdb3fbe09948670b92d3e265047dcc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_PCIEB_H
#define _SYS_PCIEB_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(DEBUG)
#define PCIEB_DEBUG pcieb_dbg
#else /* DEBUG */
#define PCIEB_DEBUG 0 &&
#endif /* DEBUG */
typedef enum { /* same sequence as pcieb_debug_sym[] */
/* 0 */ DBG_ATTACH,
/* 1 */ DBG_PWR,
/* 2 */ DBG_INTR
/*
* Intel specific register offsets with bit definitions.
*/
#define PCIEB_PX_CAPABILITY_ID 0x44
#define PCIEB_BRIDGE_CONF 0x40
/*
*/
#define PX_PFREQ_100 0x400
#define PX_PFREQ_133 0x600
/*
* Downstream delayed transaction resource partitioning.
*/
/*
* Maximum upstream delayed transaction.
*/
#define PX_MDT_44 0x00
#define PX_MDT_11 0x01
#define PX_MDT_22 0x10
#define NUM_LOGICAL_SLOTS 32
#define PCIEB_RANGE_LEN 2
#define PCIEB_32BIT_IO 1
#define PCIEB_32bit_MEM 1
#define PCIEB_MEMGRAIN 0x100000
#define PCIEB_IOGRAIN 0x1000
/*
* Intel 41210 PCIe-to-PCI Bridge has two Functions F0 and F2:
* VID: 0x8086
* DID: F0 = 0x340, F2 = 0x341
*/
#define PCIEB_IS_41210_BRIDGE(bus_dev_ven_id) \
typedef struct {
/* Interrupt support */
int pcieb_htable_size; /* htable size */
int pcieb_intr_count; /* Num of Intr */
int pcieb_intr_type; /* (MSI | FIXED) */
int pcieb_init_flags;
/* FMA */
/*
* soft state pointer
*/
extern void *pcieb_state;
/* soft state flags */
#define PCIEB_SOFT_STATE_CLOSED 0x00
#define PCIEB_SOFT_STATE_OPEN 0x01
#define PCIEB_SOFT_STATE_OPEN_EXCL 0x02
/* init flags */
#define PCIEB_INIT_MUTEX 0x01
#define PCIEB_INIT_HTABLE 0x02
#define PCIEB_INIT_ALLOC 0x04
#define PCIEB_INIT_HANDLER 0x08
#define PCIEB_INIT_ENABLE 0x10
#define PCIEB_INIT_BLOCK 0x20
#define PCIEB_INIT_FM 0x40
#define PCIEB_INTR_SRC_HP 0x1
#define PCIEB_INTR_SRC_PME 0x2
#define PCIEB_INTR_SRC_AER 0x4
/*
* Need to put vendor ids in a common file and not platform specific files
* as is done today. Until then putting this vendor id define here.
*/
#ifdef PCIEB_BCM
/* Workaround for address space limitation in Broadcom 5714/5715 */
#define PCIEB_ADDR_LIMIT_LO 0ull
#endif /* PCIEB_BCM */
/*
* The following values are used to initialize the cache line size
* and latency timer registers for PCI, PCI-X and PCIe2PCI devices.
*/
void *arg);
#endif /* defined(__i386) || defined(__amd64) */
#ifdef PX_PLX
dev_info_t *child);
#endif /* PX_PLX */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PCIEB_H */