1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * PCI standard defines 4*4882a593Smuzhiyun * Copyright 1994, Drew Eckhardt 5*4882a593Smuzhiyun * Copyright 1997--1999 Martin Mares <mj@ucw.cz> 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * For more information, please consult the following manuals (look at 8*4882a593Smuzhiyun * http://www.pcisig.com/ for how to get them): 9*4882a593Smuzhiyun * 10*4882a593Smuzhiyun * PCI BIOS Specification 11*4882a593Smuzhiyun * PCI Local Bus Specification 12*4882a593Smuzhiyun * PCI to PCI Bridge Specification 13*4882a593Smuzhiyun * PCI System Design Guide 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * For HyperTransport information, please consult the following manuals 16*4882a593Smuzhiyun * from http://www.hypertransport.org : 17*4882a593Smuzhiyun * 18*4882a593Smuzhiyun * The HyperTransport I/O Link Specification 19*4882a593Smuzhiyun */ 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun #ifndef LINUX_PCI_REGS_H 22*4882a593Smuzhiyun #define LINUX_PCI_REGS_H 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun /* 25*4882a593Smuzhiyun * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of 26*4882a593Smuzhiyun * configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of 27*4882a593Smuzhiyun * configuration space. 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun #define PCI_CFG_SPACE_SIZE 256 30*4882a593Smuzhiyun #define PCI_CFG_SPACE_EXP_SIZE 4096 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun /* 33*4882a593Smuzhiyun * Under PCI, each device has 256 bytes of configuration address space, 34*4882a593Smuzhiyun * of which the first 64 bytes are standardized as follows: 35*4882a593Smuzhiyun */ 36*4882a593Smuzhiyun #define PCI_STD_HEADER_SIZEOF 64 37*4882a593Smuzhiyun #define PCI_STD_NUM_BARS 6 /* Number of standard BARs */ 38*4882a593Smuzhiyun #define PCI_VENDOR_ID 0x00 /* 16 bits */ 39*4882a593Smuzhiyun #define PCI_DEVICE_ID 0x02 /* 16 bits */ 40*4882a593Smuzhiyun #define PCI_COMMAND 0x04 /* 16 bits */ 41*4882a593Smuzhiyun #define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ 42*4882a593Smuzhiyun #define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ 43*4882a593Smuzhiyun #define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ 44*4882a593Smuzhiyun #define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ 45*4882a593Smuzhiyun #define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ 46*4882a593Smuzhiyun #define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ 47*4882a593Smuzhiyun #define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ 48*4882a593Smuzhiyun #define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ 49*4882a593Smuzhiyun #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ 50*4882a593Smuzhiyun #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ 51*4882a593Smuzhiyun #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun #define PCI_STATUS 0x06 /* 16 bits */ 54*4882a593Smuzhiyun #define PCI_STATUS_IMM_READY 0x01 /* Immediate Readiness */ 55*4882a593Smuzhiyun #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ 56*4882a593Smuzhiyun #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ 57*4882a593Smuzhiyun #define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */ 58*4882a593Smuzhiyun #define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ 59*4882a593Smuzhiyun #define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ 60*4882a593Smuzhiyun #define PCI_STATUS_PARITY 0x100 /* Detected parity error */ 61*4882a593Smuzhiyun #define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ 62*4882a593Smuzhiyun #define PCI_STATUS_DEVSEL_FAST 0x000 63*4882a593Smuzhiyun #define PCI_STATUS_DEVSEL_MEDIUM 0x200 64*4882a593Smuzhiyun #define PCI_STATUS_DEVSEL_SLOW 0x400 65*4882a593Smuzhiyun #define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ 66*4882a593Smuzhiyun #define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ 67*4882a593Smuzhiyun #define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ 68*4882a593Smuzhiyun #define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ 69*4882a593Smuzhiyun #define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun #define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */ 72*4882a593Smuzhiyun #define PCI_REVISION_ID 0x08 /* Revision ID */ 73*4882a593Smuzhiyun #define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ 74*4882a593Smuzhiyun #define PCI_CLASS_DEVICE 0x0a /* Device class */ 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun #define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ 77*4882a593Smuzhiyun #define PCI_LATENCY_TIMER 0x0d /* 8 bits */ 78*4882a593Smuzhiyun #define PCI_HEADER_TYPE 0x0e /* 8 bits */ 79*4882a593Smuzhiyun #define PCI_HEADER_TYPE_MASK 0x7f 80*4882a593Smuzhiyun #define PCI_HEADER_TYPE_NORMAL 0 81*4882a593Smuzhiyun #define PCI_HEADER_TYPE_BRIDGE 1 82*4882a593Smuzhiyun #define PCI_HEADER_TYPE_CARDBUS 2 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun #define PCI_BIST 0x0f /* 8 bits */ 85*4882a593Smuzhiyun #define PCI_BIST_CODE_MASK 0x0f /* Return result */ 86*4882a593Smuzhiyun #define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ 87*4882a593Smuzhiyun #define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun /* 90*4882a593Smuzhiyun * Base addresses specify locations in memory or I/O space. 91*4882a593Smuzhiyun * Decoded size can be determined by writing a value of 92*4882a593Smuzhiyun * 0xffffffff to the register, and reading it back. Only 93*4882a593Smuzhiyun * 1 bits are decoded. 94*4882a593Smuzhiyun */ 95*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ 96*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ 97*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ 98*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ 99*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ 100*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ 101*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ 102*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_SPACE_IO 0x01 103*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 104*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 105*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ 106*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ 107*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ 108*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ 109*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL) 110*4882a593Smuzhiyun #define PCI_BASE_ADDRESS_IO_MASK (~0x03UL) 111*4882a593Smuzhiyun /* bit 1 is reserved if address_space = 1 */ 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun /* Header type 0 (normal devices) */ 114*4882a593Smuzhiyun #define PCI_CARDBUS_CIS 0x28 115*4882a593Smuzhiyun #define PCI_SUBSYSTEM_VENDOR_ID 0x2c 116*4882a593Smuzhiyun #define PCI_SUBSYSTEM_ID 0x2e 117*4882a593Smuzhiyun #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ 118*4882a593Smuzhiyun #define PCI_ROM_ADDRESS_ENABLE 0x01 119*4882a593Smuzhiyun #define PCI_ROM_ADDRESS_MASK (~0x7ffU) 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun #define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun /* 0x35-0x3b are reserved */ 124*4882a593Smuzhiyun #define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ 125*4882a593Smuzhiyun #define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ 126*4882a593Smuzhiyun #define PCI_MIN_GNT 0x3e /* 8 bits */ 127*4882a593Smuzhiyun #define PCI_MAX_LAT 0x3f /* 8 bits */ 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun /* Header type 1 (PCI-to-PCI bridges) */ 130*4882a593Smuzhiyun #define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ 131*4882a593Smuzhiyun #define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ 132*4882a593Smuzhiyun #define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ 133*4882a593Smuzhiyun #define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ 134*4882a593Smuzhiyun #define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ 135*4882a593Smuzhiyun #define PCI_IO_LIMIT 0x1d 136*4882a593Smuzhiyun #define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ 137*4882a593Smuzhiyun #define PCI_IO_RANGE_TYPE_16 0x00 138*4882a593Smuzhiyun #define PCI_IO_RANGE_TYPE_32 0x01 139*4882a593Smuzhiyun #define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */ 140*4882a593Smuzhiyun #define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */ 141*4882a593Smuzhiyun #define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 142*4882a593Smuzhiyun #define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 143*4882a593Smuzhiyun #define PCI_MEMORY_LIMIT 0x22 144*4882a593Smuzhiyun #define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL 145*4882a593Smuzhiyun #define PCI_MEMORY_RANGE_MASK (~0x0fUL) 146*4882a593Smuzhiyun #define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ 147*4882a593Smuzhiyun #define PCI_PREF_MEMORY_LIMIT 0x26 148*4882a593Smuzhiyun #define PCI_PREF_RANGE_TYPE_MASK 0x0fUL 149*4882a593Smuzhiyun #define PCI_PREF_RANGE_TYPE_32 0x00 150*4882a593Smuzhiyun #define PCI_PREF_RANGE_TYPE_64 0x01 151*4882a593Smuzhiyun #define PCI_PREF_RANGE_MASK (~0x0fUL) 152*4882a593Smuzhiyun #define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ 153*4882a593Smuzhiyun #define PCI_PREF_LIMIT_UPPER32 0x2c 154*4882a593Smuzhiyun #define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ 155*4882a593Smuzhiyun #define PCI_IO_LIMIT_UPPER16 0x32 156*4882a593Smuzhiyun /* 0x34 same as for htype 0 */ 157*4882a593Smuzhiyun /* 0x35-0x3b is reserved */ 158*4882a593Smuzhiyun #define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ 159*4882a593Smuzhiyun /* 0x3c-0x3d are same as for htype 0 */ 160*4882a593Smuzhiyun #define PCI_BRIDGE_CONTROL 0x3e 161*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ 162*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ 163*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_ISA 0x04 /* Enable ISA mode */ 164*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ 165*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ 166*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ 167*4882a593Smuzhiyun #define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ 168*4882a593Smuzhiyun 169*4882a593Smuzhiyun /* Header type 2 (CardBus bridges) */ 170*4882a593Smuzhiyun #define PCI_CB_CAPABILITY_LIST 0x14 171*4882a593Smuzhiyun /* 0x15 reserved */ 172*4882a593Smuzhiyun #define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ 173*4882a593Smuzhiyun #define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ 174*4882a593Smuzhiyun #define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ 175*4882a593Smuzhiyun #define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ 176*4882a593Smuzhiyun #define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ 177*4882a593Smuzhiyun #define PCI_CB_MEMORY_BASE_0 0x1c 178*4882a593Smuzhiyun #define PCI_CB_MEMORY_LIMIT_0 0x20 179*4882a593Smuzhiyun #define PCI_CB_MEMORY_BASE_1 0x24 180*4882a593Smuzhiyun #define PCI_CB_MEMORY_LIMIT_1 0x28 181*4882a593Smuzhiyun #define PCI_CB_IO_BASE_0 0x2c 182*4882a593Smuzhiyun #define PCI_CB_IO_BASE_0_HI 0x2e 183*4882a593Smuzhiyun #define PCI_CB_IO_LIMIT_0 0x30 184*4882a593Smuzhiyun #define PCI_CB_IO_LIMIT_0_HI 0x32 185*4882a593Smuzhiyun #define PCI_CB_IO_BASE_1 0x34 186*4882a593Smuzhiyun #define PCI_CB_IO_BASE_1_HI 0x36 187*4882a593Smuzhiyun #define PCI_CB_IO_LIMIT_1 0x38 188*4882a593Smuzhiyun #define PCI_CB_IO_LIMIT_1_HI 0x3a 189*4882a593Smuzhiyun #define PCI_CB_IO_RANGE_MASK (~0x03UL) 190*4882a593Smuzhiyun /* 0x3c-0x3d are same as for htype 0 */ 191*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CONTROL 0x3e 192*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ 193*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_SERR 0x02 194*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_ISA 0x04 195*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_VGA 0x08 196*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 197*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ 198*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ 199*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ 200*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 201*4882a593Smuzhiyun #define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 202*4882a593Smuzhiyun #define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 203*4882a593Smuzhiyun #define PCI_CB_SUBSYSTEM_ID 0x42 204*4882a593Smuzhiyun #define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ 205*4882a593Smuzhiyun /* 0x48-0x7f reserved */ 206*4882a593Smuzhiyun 207*4882a593Smuzhiyun /* Capability lists */ 208*4882a593Smuzhiyun 209*4882a593Smuzhiyun #define PCI_CAP_LIST_ID 0 /* Capability ID */ 210*4882a593Smuzhiyun #define PCI_CAP_ID_PM 0x01 /* Power Management */ 211*4882a593Smuzhiyun #define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ 212*4882a593Smuzhiyun #define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ 213*4882a593Smuzhiyun #define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ 214*4882a593Smuzhiyun #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ 215*4882a593Smuzhiyun #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ 216*4882a593Smuzhiyun #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ 217*4882a593Smuzhiyun #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ 218*4882a593Smuzhiyun #define PCI_CAP_ID_VNDR 0x09 /* Vendor-Specific */ 219*4882a593Smuzhiyun #define PCI_CAP_ID_DBG 0x0A /* Debug port */ 220*4882a593Smuzhiyun #define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ 221*4882a593Smuzhiyun #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 222*4882a593Smuzhiyun #define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ 223*4882a593Smuzhiyun #define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ 224*4882a593Smuzhiyun #define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */ 225*4882a593Smuzhiyun #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 226*4882a593Smuzhiyun #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 227*4882a593Smuzhiyun #define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */ 228*4882a593Smuzhiyun #define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ 229*4882a593Smuzhiyun #define PCI_CAP_ID_EA 0x14 /* PCI Enhanced Allocation */ 230*4882a593Smuzhiyun #define PCI_CAP_ID_MAX PCI_CAP_ID_EA 231*4882a593Smuzhiyun #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 232*4882a593Smuzhiyun #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ 233*4882a593Smuzhiyun #define PCI_CAP_SIZEOF 4 234*4882a593Smuzhiyun 235*4882a593Smuzhiyun /* Power Management Registers */ 236*4882a593Smuzhiyun 237*4882a593Smuzhiyun #define PCI_PM_PMC 2 /* PM Capabilities Register */ 238*4882a593Smuzhiyun #define PCI_PM_CAP_VER_MASK 0x0007 /* Version */ 239*4882a593Smuzhiyun #define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */ 240*4882a593Smuzhiyun #define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */ 241*4882a593Smuzhiyun #define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */ 242*4882a593Smuzhiyun #define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxiliary power support mask */ 243*4882a593Smuzhiyun #define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ 244*4882a593Smuzhiyun #define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ 245*4882a593Smuzhiyun #define PCI_PM_CAP_PME 0x0800 /* PME pin supported */ 246*4882a593Smuzhiyun #define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */ 247*4882a593Smuzhiyun #define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */ 248*4882a593Smuzhiyun #define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */ 249*4882a593Smuzhiyun #define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */ 250*4882a593Smuzhiyun #define PCI_PM_CAP_PME_D3hot 0x4000 /* PME# from D3 (hot) */ 251*4882a593Smuzhiyun #define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */ 252*4882a593Smuzhiyun #define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */ 253*4882a593Smuzhiyun #define PCI_PM_CTRL 4 /* PM control and status register */ 254*4882a593Smuzhiyun #define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ 255*4882a593Smuzhiyun #define PCI_PM_CTRL_NO_SOFT_RESET 0x0008 /* No reset for D3hot->D0 */ 256*4882a593Smuzhiyun #define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ 257*4882a593Smuzhiyun #define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */ 258*4882a593Smuzhiyun #define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */ 259*4882a593Smuzhiyun #define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ 260*4882a593Smuzhiyun #define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */ 261*4882a593Smuzhiyun #define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */ 262*4882a593Smuzhiyun #define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */ 263*4882a593Smuzhiyun #define PCI_PM_DATA_REGISTER 7 /* (??) */ 264*4882a593Smuzhiyun #define PCI_PM_SIZEOF 8 265*4882a593Smuzhiyun 266*4882a593Smuzhiyun /* AGP registers */ 267*4882a593Smuzhiyun 268*4882a593Smuzhiyun #define PCI_AGP_VERSION 2 /* BCD version number */ 269*4882a593Smuzhiyun #define PCI_AGP_RFU 3 /* Rest of capability flags */ 270*4882a593Smuzhiyun #define PCI_AGP_STATUS 4 /* Status register */ 271*4882a593Smuzhiyun #define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ 272*4882a593Smuzhiyun #define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ 273*4882a593Smuzhiyun #define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */ 274*4882a593Smuzhiyun #define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */ 275*4882a593Smuzhiyun #define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */ 276*4882a593Smuzhiyun #define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */ 277*4882a593Smuzhiyun #define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */ 278*4882a593Smuzhiyun #define PCI_AGP_COMMAND 8 /* Control register */ 279*4882a593Smuzhiyun #define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ 280*4882a593Smuzhiyun #define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ 281*4882a593Smuzhiyun #define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ 282*4882a593Smuzhiyun #define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ 283*4882a593Smuzhiyun #define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ 284*4882a593Smuzhiyun #define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ 285*4882a593Smuzhiyun #define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ 286*4882a593Smuzhiyun #define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ 287*4882a593Smuzhiyun #define PCI_AGP_SIZEOF 12 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun /* Vital Product Data */ 290*4882a593Smuzhiyun 291*4882a593Smuzhiyun #define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */ 292*4882a593Smuzhiyun #define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ 293*4882a593Smuzhiyun #define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ 294*4882a593Smuzhiyun #define PCI_VPD_DATA 4 /* 32-bits of data returned here */ 295*4882a593Smuzhiyun #define PCI_CAP_VPD_SIZEOF 8 296*4882a593Smuzhiyun 297*4882a593Smuzhiyun /* Slot Identification */ 298*4882a593Smuzhiyun 299*4882a593Smuzhiyun #define PCI_SID_ESR 2 /* Expansion Slot Register */ 300*4882a593Smuzhiyun #define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ 301*4882a593Smuzhiyun #define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ 302*4882a593Smuzhiyun #define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ 303*4882a593Smuzhiyun 304*4882a593Smuzhiyun /* Message Signalled Interrupt registers */ 305*4882a593Smuzhiyun 306*4882a593Smuzhiyun #define PCI_MSI_FLAGS 2 /* Message Control */ 307*4882a593Smuzhiyun #define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */ 308*4882a593Smuzhiyun #define PCI_MSI_FLAGS_QMASK 0x000e /* Maximum queue size available */ 309*4882a593Smuzhiyun #define PCI_MSI_FLAGS_QSIZE 0x0070 /* Message queue size configured */ 310*4882a593Smuzhiyun #define PCI_MSI_FLAGS_64BIT 0x0080 /* 64-bit addresses allowed */ 311*4882a593Smuzhiyun #define PCI_MSI_FLAGS_MASKBIT 0x0100 /* Per-vector masking capable */ 312*4882a593Smuzhiyun #define PCI_MSI_RFU 3 /* Rest of capability flags */ 313*4882a593Smuzhiyun #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ 314*4882a593Smuzhiyun #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 315*4882a593Smuzhiyun #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 316*4882a593Smuzhiyun #define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ 317*4882a593Smuzhiyun #define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */ 318*4882a593Smuzhiyun #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 319*4882a593Smuzhiyun #define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 320*4882a593Smuzhiyun #define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */ 321*4882a593Smuzhiyun 322*4882a593Smuzhiyun /* MSI-X registers (in MSI-X capability) */ 323*4882a593Smuzhiyun #define PCI_MSIX_FLAGS 2 /* Message Control */ 324*4882a593Smuzhiyun #define PCI_MSIX_FLAGS_QSIZE 0x07FF /* Table size */ 325*4882a593Smuzhiyun #define PCI_MSIX_FLAGS_MASKALL 0x4000 /* Mask all vectors for this function */ 326*4882a593Smuzhiyun #define PCI_MSIX_FLAGS_ENABLE 0x8000 /* MSI-X enable */ 327*4882a593Smuzhiyun #define PCI_MSIX_TABLE 4 /* Table offset */ 328*4882a593Smuzhiyun #define PCI_MSIX_TABLE_BIR 0x00000007 /* BAR index */ 329*4882a593Smuzhiyun #define PCI_MSIX_TABLE_OFFSET 0xfffffff8 /* Offset into specified BAR */ 330*4882a593Smuzhiyun #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */ 331*4882a593Smuzhiyun #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */ 332*4882a593Smuzhiyun #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */ 333*4882a593Smuzhiyun #define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */ 334*4882a593Smuzhiyun #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */ 335*4882a593Smuzhiyun 336*4882a593Smuzhiyun /* MSI-X Table entry format (in memory mapped by a BAR) */ 337*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_SIZE 16 338*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_LOWER_ADDR 0 /* Message Address */ 339*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_UPPER_ADDR 4 /* Message Upper Address */ 340*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_DATA 8 /* Message Data */ 341*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 /* Vector Control */ 342*4882a593Smuzhiyun #define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 343*4882a593Smuzhiyun 344*4882a593Smuzhiyun /* CompactPCI Hotswap Register */ 345*4882a593Smuzhiyun 346*4882a593Smuzhiyun #define PCI_CHSWP_CSR 2 /* Control and Status Register */ 347*4882a593Smuzhiyun #define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */ 348*4882a593Smuzhiyun #define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */ 349*4882a593Smuzhiyun #define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */ 350*4882a593Smuzhiyun #define PCI_CHSWP_LOO 0x08 /* LED On / Off */ 351*4882a593Smuzhiyun #define PCI_CHSWP_PI 0x30 /* Programming Interface */ 352*4882a593Smuzhiyun #define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */ 353*4882a593Smuzhiyun #define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */ 354*4882a593Smuzhiyun 355*4882a593Smuzhiyun /* PCI Advanced Feature registers */ 356*4882a593Smuzhiyun 357*4882a593Smuzhiyun #define PCI_AF_LENGTH 2 358*4882a593Smuzhiyun #define PCI_AF_CAP 3 359*4882a593Smuzhiyun #define PCI_AF_CAP_TP 0x01 360*4882a593Smuzhiyun #define PCI_AF_CAP_FLR 0x02 361*4882a593Smuzhiyun #define PCI_AF_CTRL 4 362*4882a593Smuzhiyun #define PCI_AF_CTRL_FLR 0x01 363*4882a593Smuzhiyun #define PCI_AF_STATUS 5 364*4882a593Smuzhiyun #define PCI_AF_STATUS_TP 0x01 365*4882a593Smuzhiyun #define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */ 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun /* PCI Enhanced Allocation registers */ 368*4882a593Smuzhiyun 369*4882a593Smuzhiyun #define PCI_EA_NUM_ENT 2 /* Number of Capability Entries */ 370*4882a593Smuzhiyun #define PCI_EA_NUM_ENT_MASK 0x3f /* Num Entries Mask */ 371*4882a593Smuzhiyun #define PCI_EA_FIRST_ENT 4 /* First EA Entry in List */ 372*4882a593Smuzhiyun #define PCI_EA_FIRST_ENT_BRIDGE 8 /* First EA Entry for Bridges */ 373*4882a593Smuzhiyun #define PCI_EA_ES 0x00000007 /* Entry Size */ 374*4882a593Smuzhiyun #define PCI_EA_BEI 0x000000f0 /* BAR Equivalent Indicator */ 375*4882a593Smuzhiyun 376*4882a593Smuzhiyun /* EA fixed Secondary and Subordinate bus numbers for Bridge */ 377*4882a593Smuzhiyun #define PCI_EA_SEC_BUS_MASK 0xff 378*4882a593Smuzhiyun #define PCI_EA_SUB_BUS_MASK 0xff00 379*4882a593Smuzhiyun #define PCI_EA_SUB_BUS_SHIFT 8 380*4882a593Smuzhiyun 381*4882a593Smuzhiyun /* 0-5 map to BARs 0-5 respectively */ 382*4882a593Smuzhiyun #define PCI_EA_BEI_BAR0 0 383*4882a593Smuzhiyun #define PCI_EA_BEI_BAR5 5 384*4882a593Smuzhiyun #define PCI_EA_BEI_BRIDGE 6 /* Resource behind bridge */ 385*4882a593Smuzhiyun #define PCI_EA_BEI_ENI 7 /* Equivalent Not Indicated */ 386*4882a593Smuzhiyun #define PCI_EA_BEI_ROM 8 /* Expansion ROM */ 387*4882a593Smuzhiyun /* 9-14 map to VF BARs 0-5 respectively */ 388*4882a593Smuzhiyun #define PCI_EA_BEI_VF_BAR0 9 389*4882a593Smuzhiyun #define PCI_EA_BEI_VF_BAR5 14 390*4882a593Smuzhiyun #define PCI_EA_BEI_RESERVED 15 /* Reserved - Treat like ENI */ 391*4882a593Smuzhiyun #define PCI_EA_PP 0x0000ff00 /* Primary Properties */ 392*4882a593Smuzhiyun #define PCI_EA_SP 0x00ff0000 /* Secondary Properties */ 393*4882a593Smuzhiyun #define PCI_EA_P_MEM 0x00 /* Non-Prefetch Memory */ 394*4882a593Smuzhiyun #define PCI_EA_P_MEM_PREFETCH 0x01 /* Prefetchable Memory */ 395*4882a593Smuzhiyun #define PCI_EA_P_IO 0x02 /* I/O Space */ 396*4882a593Smuzhiyun #define PCI_EA_P_VF_MEM_PREFETCH 0x03 /* VF Prefetchable Memory */ 397*4882a593Smuzhiyun #define PCI_EA_P_VF_MEM 0x04 /* VF Non-Prefetch Memory */ 398*4882a593Smuzhiyun #define PCI_EA_P_BRIDGE_MEM 0x05 /* Bridge Non-Prefetch Memory */ 399*4882a593Smuzhiyun #define PCI_EA_P_BRIDGE_MEM_PREFETCH 0x06 /* Bridge Prefetchable Memory */ 400*4882a593Smuzhiyun #define PCI_EA_P_BRIDGE_IO 0x07 /* Bridge I/O Space */ 401*4882a593Smuzhiyun /* 0x08-0xfc reserved */ 402*4882a593Smuzhiyun #define PCI_EA_P_MEM_RESERVED 0xfd /* Reserved Memory */ 403*4882a593Smuzhiyun #define PCI_EA_P_IO_RESERVED 0xfe /* Reserved I/O Space */ 404*4882a593Smuzhiyun #define PCI_EA_P_UNAVAILABLE 0xff /* Entry Unavailable */ 405*4882a593Smuzhiyun #define PCI_EA_WRITABLE 0x40000000 /* Writable: 1 = RW, 0 = HwInit */ 406*4882a593Smuzhiyun #define PCI_EA_ENABLE 0x80000000 /* Enable for this entry */ 407*4882a593Smuzhiyun #define PCI_EA_BASE 4 /* Base Address Offset */ 408*4882a593Smuzhiyun #define PCI_EA_MAX_OFFSET 8 /* MaxOffset (resource length) */ 409*4882a593Smuzhiyun /* bit 0 is reserved */ 410*4882a593Smuzhiyun #define PCI_EA_IS_64 0x00000002 /* 64-bit field flag */ 411*4882a593Smuzhiyun #define PCI_EA_FIELD_MASK 0xfffffffc /* For Base & Max Offset */ 412*4882a593Smuzhiyun 413*4882a593Smuzhiyun /* PCI-X registers (Type 0 (non-bridge) devices) */ 414*4882a593Smuzhiyun 415*4882a593Smuzhiyun #define PCI_X_CMD 2 /* Modes & Features */ 416*4882a593Smuzhiyun #define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ 417*4882a593Smuzhiyun #define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */ 418*4882a593Smuzhiyun #define PCI_X_CMD_READ_512 0x0000 /* 512 byte maximum read byte count */ 419*4882a593Smuzhiyun #define PCI_X_CMD_READ_1K 0x0004 /* 1Kbyte maximum read byte count */ 420*4882a593Smuzhiyun #define PCI_X_CMD_READ_2K 0x0008 /* 2Kbyte maximum read byte count */ 421*4882a593Smuzhiyun #define PCI_X_CMD_READ_4K 0x000c /* 4Kbyte maximum read byte count */ 422*4882a593Smuzhiyun #define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */ 423*4882a593Smuzhiyun /* Max # of outstanding split transactions */ 424*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_1 0x0000 /* Max 1 */ 425*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_2 0x0010 /* Max 2 */ 426*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_3 0x0020 /* Max 3 */ 427*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_4 0x0030 /* Max 4 */ 428*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_8 0x0040 /* Max 8 */ 429*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_12 0x0050 /* Max 12 */ 430*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */ 431*4882a593Smuzhiyun #define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */ 432*4882a593Smuzhiyun #define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */ 433*4882a593Smuzhiyun #define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */ 434*4882a593Smuzhiyun #define PCI_X_STATUS 4 /* PCI-X capabilities */ 435*4882a593Smuzhiyun #define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */ 436*4882a593Smuzhiyun #define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */ 437*4882a593Smuzhiyun #define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */ 438*4882a593Smuzhiyun #define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */ 439*4882a593Smuzhiyun #define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */ 440*4882a593Smuzhiyun #define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */ 441*4882a593Smuzhiyun #define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */ 442*4882a593Smuzhiyun #define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */ 443*4882a593Smuzhiyun #define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */ 444*4882a593Smuzhiyun #define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */ 445*4882a593Smuzhiyun #define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ 446*4882a593Smuzhiyun #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 447*4882a593Smuzhiyun #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 448*4882a593Smuzhiyun #define PCI_X_ECC_CSR 8 /* ECC control and status */ 449*4882a593Smuzhiyun #define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */ 450*4882a593Smuzhiyun #define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */ 451*4882a593Smuzhiyun #define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */ 452*4882a593Smuzhiyun 453*4882a593Smuzhiyun /* PCI-X registers (Type 1 (bridge) devices) */ 454*4882a593Smuzhiyun 455*4882a593Smuzhiyun #define PCI_X_BRIDGE_SSTATUS 2 /* Secondary Status */ 456*4882a593Smuzhiyun #define PCI_X_SSTATUS_64BIT 0x0001 /* Secondary AD interface is 64 bits */ 457*4882a593Smuzhiyun #define PCI_X_SSTATUS_133MHZ 0x0002 /* 133 MHz capable */ 458*4882a593Smuzhiyun #define PCI_X_SSTATUS_FREQ 0x03c0 /* Secondary Bus Mode and Frequency */ 459*4882a593Smuzhiyun #define PCI_X_SSTATUS_VERS 0x3000 /* PCI-X Capability Version */ 460*4882a593Smuzhiyun #define PCI_X_SSTATUS_V1 0x1000 /* Mode 2, not Mode 1 */ 461*4882a593Smuzhiyun #define PCI_X_SSTATUS_V2 0x2000 /* Mode 1 or Modes 1 and 2 */ 462*4882a593Smuzhiyun #define PCI_X_SSTATUS_266MHZ 0x4000 /* 266 MHz capable */ 463*4882a593Smuzhiyun #define PCI_X_SSTATUS_533MHZ 0x8000 /* 533 MHz capable */ 464*4882a593Smuzhiyun #define PCI_X_BRIDGE_STATUS 4 /* Bridge Status */ 465*4882a593Smuzhiyun 466*4882a593Smuzhiyun /* PCI Bridge Subsystem ID registers */ 467*4882a593Smuzhiyun 468*4882a593Smuzhiyun #define PCI_SSVID_VENDOR_ID 4 /* PCI Bridge subsystem vendor ID */ 469*4882a593Smuzhiyun #define PCI_SSVID_DEVICE_ID 6 /* PCI Bridge subsystem device ID */ 470*4882a593Smuzhiyun 471*4882a593Smuzhiyun /* PCI Express capability registers */ 472*4882a593Smuzhiyun 473*4882a593Smuzhiyun #define PCI_EXP_FLAGS 2 /* Capabilities register */ 474*4882a593Smuzhiyun #define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ 475*4882a593Smuzhiyun #define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ 476*4882a593Smuzhiyun #define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ 477*4882a593Smuzhiyun #define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ 478*4882a593Smuzhiyun #define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ 479*4882a593Smuzhiyun #define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ 480*4882a593Smuzhiyun #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ 481*4882a593Smuzhiyun #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCIe to PCI/PCI-X Bridge */ 482*4882a593Smuzhiyun #define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIe Bridge */ 483*4882a593Smuzhiyun #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ 484*4882a593Smuzhiyun #define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */ 485*4882a593Smuzhiyun #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ 486*4882a593Smuzhiyun #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ 487*4882a593Smuzhiyun #define PCI_EXP_DEVCAP 4 /* Device capabilities */ 488*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */ 489*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */ 490*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */ 491*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_L0S 0x000001c0 /* L0s Acceptable Latency */ 492*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_L1 0x00000e00 /* L1 Acceptable Latency */ 493*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_ATN_BUT 0x00001000 /* Attention Button Present */ 494*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_ATN_IND 0x00002000 /* Attention Indicator Present */ 495*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_PWR_IND 0x00004000 /* Power Indicator Present */ 496*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_RBER 0x00008000 /* Role-Based Error Reporting */ 497*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */ 498*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */ 499*4882a593Smuzhiyun #define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */ 500*4882a593Smuzhiyun #define PCI_EXP_DEVCTL 8 /* Device Control */ 501*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ 502*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ 503*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ 504*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ 505*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */ 506*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ 507*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_128B 0x0000 /* 128 Bytes */ 508*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_256B 0x0020 /* 256 Bytes */ 509*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_512B 0x0040 /* 512 Bytes */ 510*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_1024B 0x0060 /* 1024 Bytes */ 511*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_2048B 0x0080 /* 2048 Bytes */ 512*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PAYLOAD_4096B 0x00a0 /* 4096 Bytes */ 513*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ 514*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ 515*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ 516*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */ 517*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ 518*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_128B 0x0000 /* 128 Bytes */ 519*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_256B 0x1000 /* 256 Bytes */ 520*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_512B 0x2000 /* 512 Bytes */ 521*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_1024B 0x3000 /* 1024 Bytes */ 522*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_2048B 0x4000 /* 2048 Bytes */ 523*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_READRQ_4096B 0x5000 /* 4096 Bytes */ 524*4882a593Smuzhiyun #define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */ 525*4882a593Smuzhiyun #define PCI_EXP_DEVSTA 10 /* Device Status */ 526*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */ 527*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */ 528*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */ 529*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_URD 0x0008 /* Unsupported Request Detected */ 530*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */ 531*4882a593Smuzhiyun #define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */ 532*4882a593Smuzhiyun #define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V1 12 /* v1 endpoints without link end here */ 533*4882a593Smuzhiyun #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 534*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ 535*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */ 536*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */ 537*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */ 538*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */ 539*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SLS_32_0GB 0x00000005 /* LNKCAP2 SLS Vector bit 4 */ 540*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ 541*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 542*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_ASPM_L0S 0x00000400 /* ASPM L0s Support */ 543*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_ASPM_L1 0x00000800 /* ASPM L1 Support */ 544*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ 545*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */ 546*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* Clock Power Management */ 547*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Surprise Down Error Reporting Capable */ 548*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */ 549*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */ 550*4882a593Smuzhiyun #define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ 551*4882a593Smuzhiyun #define PCI_EXP_LNKCTL 16 /* Link Control */ 552*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ 553*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */ 554*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */ 555*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ 556*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ 557*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ 558*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */ 559*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */ 560*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_CLKREQ_EN 0x0100 /* Enable clkreq */ 561*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ 562*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ 563*4882a593Smuzhiyun #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Link Autonomous Bandwidth Interrupt Enable */ 564*4882a593Smuzhiyun #define PCI_EXP_LNKSTA 18 /* Link Status */ 565*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ 566*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ 567*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ 568*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */ 569*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */ 570*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_CLS_32_0GB 0x0005 /* Current Link Speed 32.0GT/s */ 571*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ 572*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */ 573*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */ 574*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW_X4 0x0040 /* Current Link Width x4 */ 575*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW_X8 0x0080 /* Current Link Width x8 */ 576*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ 577*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ 578*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ 579*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ 580*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ 581*4882a593Smuzhiyun #define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ 582*4882a593Smuzhiyun #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints with link end here */ 583*4882a593Smuzhiyun #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 584*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ 585*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ 586*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */ 587*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_AIP 0x00000008 /* Attention Indicator Present */ 588*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_PIP 0x00000010 /* Power Indicator Present */ 589*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */ 590*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */ 591*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */ 592*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */ 593*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */ 594*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */ 595*4882a593Smuzhiyun #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ 596*4882a593Smuzhiyun #define PCI_EXP_SLTCTL 24 /* Slot Control */ 597*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */ 598*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */ 599*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */ 600*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PDCE 0x0008 /* Presence Detect Changed Enable */ 601*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ 602*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ 603*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ 604*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_ATTN_IND_SHIFT 6 /* Attention Indicator shift */ 605*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ 606*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ 607*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ 608*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ 609*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PWR_IND_ON 0x0100 /* Power Indicator on */ 610*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PWR_IND_BLINK 0x0200 /* Power Indicator blinking */ 611*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PWR_IND_OFF 0x0300 /* Power Indicator off */ 612*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ 613*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PWR_ON 0x0000 /* Power On */ 614*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */ 615*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ 616*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ 617*4882a593Smuzhiyun #define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */ 618*4882a593Smuzhiyun #define PCI_EXP_SLTSTA 26 /* Slot Status */ 619*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */ 620*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */ 621*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */ 622*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_PDC 0x0008 /* Presence Detect Changed */ 623*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_CC 0x0010 /* Command Completed */ 624*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_MRLSS 0x0020 /* MRL Sensor State */ 625*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */ 626*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */ 627*4882a593Smuzhiyun #define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */ 628*4882a593Smuzhiyun #define PCI_EXP_RTCTL 28 /* Root Control */ 629*4882a593Smuzhiyun #define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */ 630*4882a593Smuzhiyun #define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ 631*4882a593Smuzhiyun #define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ 632*4882a593Smuzhiyun #define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ 633*4882a593Smuzhiyun #define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */ 634*4882a593Smuzhiyun #define PCI_EXP_RTCAP 30 /* Root Capabilities */ 635*4882a593Smuzhiyun #define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ 636*4882a593Smuzhiyun #define PCI_EXP_RTSTA 32 /* Root Status */ 637*4882a593Smuzhiyun #define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */ 638*4882a593Smuzhiyun #define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */ 639*4882a593Smuzhiyun /* 640*4882a593Smuzhiyun * The Device Capabilities 2, Device Status 2, Device Control 2, 641*4882a593Smuzhiyun * Link Capabilities 2, Link Status 2, Link Control 2, 642*4882a593Smuzhiyun * Slot Capabilities 2, Slot Status 2, and Slot Control 2 registers 643*4882a593Smuzhiyun * are only present on devices with PCIe Capability version 2. 644*4882a593Smuzhiyun * Use pcie_capability_read_word() and similar interfaces to use them 645*4882a593Smuzhiyun * safely. 646*4882a593Smuzhiyun */ 647*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 648*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */ 649*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */ 650*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */ 651*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_ATOMIC_COMP32 0x00000080 /* 32b AtomicOp completion */ 652*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */ 653*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */ 654*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */ 655*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */ 656*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */ 657*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ 658*4882a593Smuzhiyun #define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */ 659*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ 660*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */ 661*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */ 662*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */ 663*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */ 664*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */ 665*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */ 666*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */ 667*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */ 668*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */ 669*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */ 670*4882a593Smuzhiyun #define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 671*4882a593Smuzhiyun #define PCI_EXP_DEVSTA2 42 /* Device Status 2 */ 672*4882a593Smuzhiyun #define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints without link end here */ 673*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */ 674*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */ 675*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */ 676*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */ 677*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */ 678*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */ 679*4882a593Smuzhiyun #define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */ 680*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 681*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS 0x000f 682*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */ 683*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */ 684*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */ 685*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */ 686*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */ 687*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ 688*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ 689*4882a593Smuzhiyun #define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */ 690*4882a593Smuzhiyun #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ 691*4882a593Smuzhiyun #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */ 692*4882a593Smuzhiyun #define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */ 693*4882a593Smuzhiyun #define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */ 694*4882a593Smuzhiyun #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 695*4882a593Smuzhiyun #define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */ 696*4882a593Smuzhiyun 697*4882a593Smuzhiyun /* Extended Capabilities (PCI-X 2.0 and Express) */ 698*4882a593Smuzhiyun #define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) 699*4882a593Smuzhiyun #define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) 700*4882a593Smuzhiyun #define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) 701*4882a593Smuzhiyun 702*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */ 703*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */ 704*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ 705*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */ 706*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */ 707*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */ 708*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */ 709*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */ 710*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */ 711*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */ 712*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor-Specific */ 713*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */ 714*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */ 715*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */ 716*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */ 717*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */ 718*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */ 719*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */ 720*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */ 721*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* Reserved for AMD */ 722*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_REBAR 0x15 /* Resizable BAR */ 723*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_DPA 0x16 /* Dynamic Power Allocation */ 724*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_TPH 0x17 /* TPH Requester */ 725*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_LTR 0x18 /* Latency Tolerance Reporting */ 726*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe Capability */ 727*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */ 728*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ 729*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */ 730*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */ 731*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */ 732*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ 733*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ 734*4882a593Smuzhiyun #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT 735*4882a593Smuzhiyun 736*4882a593Smuzhiyun #define PCI_EXT_CAP_DSN_SIZEOF 12 737*4882a593Smuzhiyun #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 738*4882a593Smuzhiyun 739*4882a593Smuzhiyun /* Advanced Error Reporting */ 740*4882a593Smuzhiyun #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 741*4882a593Smuzhiyun #define PCI_ERR_UNC_UND 0x00000001 /* Undefined */ 742*4882a593Smuzhiyun #define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ 743*4882a593Smuzhiyun #define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */ 744*4882a593Smuzhiyun #define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ 745*4882a593Smuzhiyun #define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ 746*4882a593Smuzhiyun #define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ 747*4882a593Smuzhiyun #define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ 748*4882a593Smuzhiyun #define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ 749*4882a593Smuzhiyun #define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ 750*4882a593Smuzhiyun #define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ 751*4882a593Smuzhiyun #define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ 752*4882a593Smuzhiyun #define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ 753*4882a593Smuzhiyun #define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */ 754*4882a593Smuzhiyun #define PCI_ERR_UNC_INTN 0x00400000 /* internal error */ 755*4882a593Smuzhiyun #define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */ 756*4882a593Smuzhiyun #define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */ 757*4882a593Smuzhiyun #define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */ 758*4882a593Smuzhiyun #define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ 759*4882a593Smuzhiyun /* Same bits as above */ 760*4882a593Smuzhiyun #define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ 761*4882a593Smuzhiyun /* Same bits as above */ 762*4882a593Smuzhiyun #define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ 763*4882a593Smuzhiyun #define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ 764*4882a593Smuzhiyun #define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ 765*4882a593Smuzhiyun #define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ 766*4882a593Smuzhiyun #define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ 767*4882a593Smuzhiyun #define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ 768*4882a593Smuzhiyun #define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */ 769*4882a593Smuzhiyun #define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */ 770*4882a593Smuzhiyun #define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */ 771*4882a593Smuzhiyun #define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ 772*4882a593Smuzhiyun /* Same bits as above */ 773*4882a593Smuzhiyun #define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ 774*4882a593Smuzhiyun #define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ 775*4882a593Smuzhiyun #define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ 776*4882a593Smuzhiyun #define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ 777*4882a593Smuzhiyun #define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ 778*4882a593Smuzhiyun #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ 779*4882a593Smuzhiyun #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ 780*4882a593Smuzhiyun #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ 781*4882a593Smuzhiyun #define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */ 782*4882a593Smuzhiyun #define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */ 783*4882a593Smuzhiyun #define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */ 784*4882a593Smuzhiyun #define PCI_ERR_ROOT_STATUS 48 785*4882a593Smuzhiyun #define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ 786*4882a593Smuzhiyun #define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */ 787*4882a593Smuzhiyun #define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */ 788*4882a593Smuzhiyun #define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 /* Multiple FATAL/NONFATAL */ 789*4882a593Smuzhiyun #define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First UNC is Fatal */ 790*4882a593Smuzhiyun #define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ 791*4882a593Smuzhiyun #define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ 792*4882a593Smuzhiyun #define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */ 793*4882a593Smuzhiyun #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ 794*4882a593Smuzhiyun 795*4882a593Smuzhiyun /* Virtual Channel */ 796*4882a593Smuzhiyun #define PCI_VC_PORT_CAP1 4 797*4882a593Smuzhiyun #define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */ 798*4882a593Smuzhiyun #define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */ 799*4882a593Smuzhiyun #define PCI_VC_CAP1_ARB_SIZE 0x00000c00 800*4882a593Smuzhiyun #define PCI_VC_PORT_CAP2 8 801*4882a593Smuzhiyun #define PCI_VC_CAP2_32_PHASE 0x00000002 802*4882a593Smuzhiyun #define PCI_VC_CAP2_64_PHASE 0x00000004 803*4882a593Smuzhiyun #define PCI_VC_CAP2_128_PHASE 0x00000008 804*4882a593Smuzhiyun #define PCI_VC_CAP2_ARB_OFF 0xff000000 805*4882a593Smuzhiyun #define PCI_VC_PORT_CTRL 12 806*4882a593Smuzhiyun #define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001 807*4882a593Smuzhiyun #define PCI_VC_PORT_STATUS 14 808*4882a593Smuzhiyun #define PCI_VC_PORT_STATUS_TABLE 0x00000001 809*4882a593Smuzhiyun #define PCI_VC_RES_CAP 16 810*4882a593Smuzhiyun #define PCI_VC_RES_CAP_32_PHASE 0x00000002 811*4882a593Smuzhiyun #define PCI_VC_RES_CAP_64_PHASE 0x00000004 812*4882a593Smuzhiyun #define PCI_VC_RES_CAP_128_PHASE 0x00000008 813*4882a593Smuzhiyun #define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010 814*4882a593Smuzhiyun #define PCI_VC_RES_CAP_256_PHASE 0x00000020 815*4882a593Smuzhiyun #define PCI_VC_RES_CAP_ARB_OFF 0xff000000 816*4882a593Smuzhiyun #define PCI_VC_RES_CTRL 20 817*4882a593Smuzhiyun #define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000 818*4882a593Smuzhiyun #define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000 819*4882a593Smuzhiyun #define PCI_VC_RES_CTRL_ID 0x07000000 820*4882a593Smuzhiyun #define PCI_VC_RES_CTRL_ENABLE 0x80000000 821*4882a593Smuzhiyun #define PCI_VC_RES_STATUS 26 822*4882a593Smuzhiyun #define PCI_VC_RES_STATUS_TABLE 0x00000001 823*4882a593Smuzhiyun #define PCI_VC_RES_STATUS_NEGO 0x00000002 824*4882a593Smuzhiyun #define PCI_CAP_VC_BASE_SIZEOF 0x10 825*4882a593Smuzhiyun #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C 826*4882a593Smuzhiyun 827*4882a593Smuzhiyun /* Power Budgeting */ 828*4882a593Smuzhiyun #define PCI_PWR_DSR 4 /* Data Select Register */ 829*4882a593Smuzhiyun #define PCI_PWR_DATA 8 /* Data Register */ 830*4882a593Smuzhiyun #define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ 831*4882a593Smuzhiyun #define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ 832*4882a593Smuzhiyun #define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ 833*4882a593Smuzhiyun #define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ 834*4882a593Smuzhiyun #define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ 835*4882a593Smuzhiyun #define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ 836*4882a593Smuzhiyun #define PCI_PWR_CAP 12 /* Capability */ 837*4882a593Smuzhiyun #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 838*4882a593Smuzhiyun #define PCI_EXT_CAP_PWR_SIZEOF 16 839*4882a593Smuzhiyun 840*4882a593Smuzhiyun /* Root Complex Event Collector Endpoint Association */ 841*4882a593Smuzhiyun #define PCI_RCEC_RCIEP_BITMAP 4 /* Associated Bitmap for RCiEPs */ 842*4882a593Smuzhiyun #define PCI_RCEC_BUSN 8 /* RCEC Associated Bus Numbers */ 843*4882a593Smuzhiyun #define PCI_RCEC_BUSN_REG_VER 0x02 /* Least version with BUSN present */ 844*4882a593Smuzhiyun #define PCI_RCEC_BUSN_NEXT(x) (((x) >> 8) & 0xff) 845*4882a593Smuzhiyun #define PCI_RCEC_BUSN_LAST(x) (((x) >> 16) & 0xff) 846*4882a593Smuzhiyun 847*4882a593Smuzhiyun /* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */ 848*4882a593Smuzhiyun #define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */ 849*4882a593Smuzhiyun #define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff) 850*4882a593Smuzhiyun #define PCI_VNDR_HEADER_REV(x) (((x) >> 16) & 0xf) 851*4882a593Smuzhiyun #define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff) 852*4882a593Smuzhiyun 853*4882a593Smuzhiyun /* 854*4882a593Smuzhiyun * HyperTransport sub capability types 855*4882a593Smuzhiyun * 856*4882a593Smuzhiyun * Unfortunately there are both 3 bit and 5 bit capability types defined 857*4882a593Smuzhiyun * in the HT spec, catering for that is a little messy. You probably don't 858*4882a593Smuzhiyun * want to use these directly, just use pci_find_ht_capability() and it 859*4882a593Smuzhiyun * will do the right thing for you. 860*4882a593Smuzhiyun */ 861*4882a593Smuzhiyun #define HT_3BIT_CAP_MASK 0xE0 862*4882a593Smuzhiyun #define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */ 863*4882a593Smuzhiyun #define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */ 864*4882a593Smuzhiyun 865*4882a593Smuzhiyun #define HT_5BIT_CAP_MASK 0xF8 866*4882a593Smuzhiyun #define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */ 867*4882a593Smuzhiyun #define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */ 868*4882a593Smuzhiyun #define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */ 869*4882a593Smuzhiyun #define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */ 870*4882a593Smuzhiyun #define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */ 871*4882a593Smuzhiyun #define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */ 872*4882a593Smuzhiyun #define HT_MSI_FLAGS 0x02 /* Offset to flags */ 873*4882a593Smuzhiyun #define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */ 874*4882a593Smuzhiyun #define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */ 875*4882a593Smuzhiyun #define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */ 876*4882a593Smuzhiyun #define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */ 877*4882a593Smuzhiyun #define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */ 878*4882a593Smuzhiyun #define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */ 879*4882a593Smuzhiyun #define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ 880*4882a593Smuzhiyun #define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ 881*4882a593Smuzhiyun #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 882*4882a593Smuzhiyun #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 HyperTransport configuration */ 883*4882a593Smuzhiyun #define HT_CAPTYPE_PM 0xE0 /* HyperTransport power management configuration */ 884*4882a593Smuzhiyun #define HT_CAP_SIZEOF_LONG 28 /* slave & primary */ 885*4882a593Smuzhiyun #define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */ 886*4882a593Smuzhiyun 887*4882a593Smuzhiyun /* Alternative Routing-ID Interpretation */ 888*4882a593Smuzhiyun #define PCI_ARI_CAP 0x04 /* ARI Capability Register */ 889*4882a593Smuzhiyun #define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */ 890*4882a593Smuzhiyun #define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */ 891*4882a593Smuzhiyun #define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */ 892*4882a593Smuzhiyun #define PCI_ARI_CTRL 0x06 /* ARI Control Register */ 893*4882a593Smuzhiyun #define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ 894*4882a593Smuzhiyun #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 895*4882a593Smuzhiyun #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 896*4882a593Smuzhiyun #define PCI_EXT_CAP_ARI_SIZEOF 8 897*4882a593Smuzhiyun 898*4882a593Smuzhiyun /* Address Translation Service */ 899*4882a593Smuzhiyun #define PCI_ATS_CAP 0x04 /* ATS Capability Register */ 900*4882a593Smuzhiyun #define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */ 901*4882a593Smuzhiyun #define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */ 902*4882a593Smuzhiyun #define PCI_ATS_CAP_PAGE_ALIGNED 0x0020 /* Page Aligned Request */ 903*4882a593Smuzhiyun #define PCI_ATS_CTRL 0x06 /* ATS Control Register */ 904*4882a593Smuzhiyun #define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ 905*4882a593Smuzhiyun #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 906*4882a593Smuzhiyun #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 907*4882a593Smuzhiyun #define PCI_EXT_CAP_ATS_SIZEOF 8 908*4882a593Smuzhiyun 909*4882a593Smuzhiyun /* Page Request Interface */ 910*4882a593Smuzhiyun #define PCI_PRI_CTRL 0x04 /* PRI control register */ 911*4882a593Smuzhiyun #define PCI_PRI_CTRL_ENABLE 0x0001 /* Enable */ 912*4882a593Smuzhiyun #define PCI_PRI_CTRL_RESET 0x0002 /* Reset */ 913*4882a593Smuzhiyun #define PCI_PRI_STATUS 0x06 /* PRI status register */ 914*4882a593Smuzhiyun #define PCI_PRI_STATUS_RF 0x0001 /* Response Failure */ 915*4882a593Smuzhiyun #define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */ 916*4882a593Smuzhiyun #define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */ 917*4882a593Smuzhiyun #define PCI_PRI_STATUS_PASID 0x8000 /* PRG Response PASID Required */ 918*4882a593Smuzhiyun #define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ 919*4882a593Smuzhiyun #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ 920*4882a593Smuzhiyun #define PCI_EXT_CAP_PRI_SIZEOF 16 921*4882a593Smuzhiyun 922*4882a593Smuzhiyun /* Process Address Space ID */ 923*4882a593Smuzhiyun #define PCI_PASID_CAP 0x04 /* PASID feature register */ 924*4882a593Smuzhiyun #define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */ 925*4882a593Smuzhiyun #define PCI_PASID_CAP_PRIV 0x04 /* Privilege Mode Supported */ 926*4882a593Smuzhiyun #define PCI_PASID_CTRL 0x06 /* PASID control register */ 927*4882a593Smuzhiyun #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ 928*4882a593Smuzhiyun #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ 929*4882a593Smuzhiyun #define PCI_PASID_CTRL_PRIV 0x04 /* Privilege Mode Enable */ 930*4882a593Smuzhiyun #define PCI_EXT_CAP_PASID_SIZEOF 8 931*4882a593Smuzhiyun 932*4882a593Smuzhiyun /* Single Root I/O Virtualization */ 933*4882a593Smuzhiyun #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 934*4882a593Smuzhiyun #define PCI_SRIOV_CAP_VFM 0x00000001 /* VF Migration Capable */ 935*4882a593Smuzhiyun #define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */ 936*4882a593Smuzhiyun #define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */ 937*4882a593Smuzhiyun #define PCI_SRIOV_CTRL_VFE 0x0001 /* VF Enable */ 938*4882a593Smuzhiyun #define PCI_SRIOV_CTRL_VFM 0x0002 /* VF Migration Enable */ 939*4882a593Smuzhiyun #define PCI_SRIOV_CTRL_INTR 0x0004 /* VF Migration Interrupt Enable */ 940*4882a593Smuzhiyun #define PCI_SRIOV_CTRL_MSE 0x0008 /* VF Memory Space Enable */ 941*4882a593Smuzhiyun #define PCI_SRIOV_CTRL_ARI 0x0010 /* ARI Capable Hierarchy */ 942*4882a593Smuzhiyun #define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */ 943*4882a593Smuzhiyun #define PCI_SRIOV_STATUS_VFM 0x0001 /* VF Migration Status */ 944*4882a593Smuzhiyun #define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */ 945*4882a593Smuzhiyun #define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */ 946*4882a593Smuzhiyun #define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */ 947*4882a593Smuzhiyun #define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */ 948*4882a593Smuzhiyun #define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */ 949*4882a593Smuzhiyun #define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */ 950*4882a593Smuzhiyun #define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */ 951*4882a593Smuzhiyun #define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */ 952*4882a593Smuzhiyun #define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */ 953*4882a593Smuzhiyun #define PCI_SRIOV_BAR 0x24 /* VF BAR0 */ 954*4882a593Smuzhiyun #define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */ 955*4882a593Smuzhiyun #define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/ 956*4882a593Smuzhiyun #define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */ 957*4882a593Smuzhiyun #define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */ 958*4882a593Smuzhiyun #define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */ 959*4882a593Smuzhiyun #define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ 960*4882a593Smuzhiyun #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 961*4882a593Smuzhiyun #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 962*4882a593Smuzhiyun #define PCI_EXT_CAP_SRIOV_SIZEOF 64 963*4882a593Smuzhiyun 964*4882a593Smuzhiyun #define PCI_LTR_MAX_SNOOP_LAT 0x4 965*4882a593Smuzhiyun #define PCI_LTR_MAX_NOSNOOP_LAT 0x6 966*4882a593Smuzhiyun #define PCI_LTR_VALUE_MASK 0x000003ff 967*4882a593Smuzhiyun #define PCI_LTR_SCALE_MASK 0x00001c00 968*4882a593Smuzhiyun #define PCI_LTR_SCALE_SHIFT 10 969*4882a593Smuzhiyun #define PCI_EXT_CAP_LTR_SIZEOF 8 970*4882a593Smuzhiyun 971*4882a593Smuzhiyun /* Access Control Service */ 972*4882a593Smuzhiyun #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ 973*4882a593Smuzhiyun #define PCI_ACS_SV 0x0001 /* Source Validation */ 974*4882a593Smuzhiyun #define PCI_ACS_TB 0x0002 /* Translation Blocking */ 975*4882a593Smuzhiyun #define PCI_ACS_RR 0x0004 /* P2P Request Redirect */ 976*4882a593Smuzhiyun #define PCI_ACS_CR 0x0008 /* P2P Completion Redirect */ 977*4882a593Smuzhiyun #define PCI_ACS_UF 0x0010 /* Upstream Forwarding */ 978*4882a593Smuzhiyun #define PCI_ACS_EC 0x0020 /* P2P Egress Control */ 979*4882a593Smuzhiyun #define PCI_ACS_DT 0x0040 /* Direct Translated P2P */ 980*4882a593Smuzhiyun #define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */ 981*4882a593Smuzhiyun #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ 982*4882a593Smuzhiyun #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ 983*4882a593Smuzhiyun 984*4882a593Smuzhiyun #define PCI_VSEC_HDR 4 /* extended cap - vendor-specific */ 985*4882a593Smuzhiyun #define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */ 986*4882a593Smuzhiyun 987*4882a593Smuzhiyun /* SATA capability */ 988*4882a593Smuzhiyun #define PCI_SATA_REGS 4 /* SATA REGs specifier */ 989*4882a593Smuzhiyun #define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */ 990*4882a593Smuzhiyun #define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */ 991*4882a593Smuzhiyun #define PCI_SATA_SIZEOF_SHORT 8 992*4882a593Smuzhiyun #define PCI_SATA_SIZEOF_LONG 16 993*4882a593Smuzhiyun 994*4882a593Smuzhiyun /* Resizable BARs */ 995*4882a593Smuzhiyun #define PCI_REBAR_CAP 4 /* capability register */ 996*4882a593Smuzhiyun #define PCI_REBAR_CAP_SIZES 0x00FFFFF0 /* supported BAR sizes */ 997*4882a593Smuzhiyun #define PCI_REBAR_CTRL 8 /* control register */ 998*4882a593Smuzhiyun #define PCI_REBAR_CTRL_BAR_IDX 0x00000007 /* BAR index */ 999*4882a593Smuzhiyun #define PCI_REBAR_CTRL_NBAR_MASK 0x000000E0 /* # of resizable BARs */ 1000*4882a593Smuzhiyun #define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # of BARs */ 1001*4882a593Smuzhiyun #define PCI_REBAR_CTRL_BAR_SIZE 0x00001F00 /* BAR size */ 1002*4882a593Smuzhiyun #define PCI_REBAR_CTRL_BAR_SHIFT 8 /* shift for BAR size */ 1003*4882a593Smuzhiyun 1004*4882a593Smuzhiyun /* Dynamic Power Allocation */ 1005*4882a593Smuzhiyun #define PCI_DPA_CAP 4 /* capability register */ 1006*4882a593Smuzhiyun #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ 1007*4882a593Smuzhiyun #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ 1008*4882a593Smuzhiyun 1009*4882a593Smuzhiyun /* TPH Requester */ 1010*4882a593Smuzhiyun #define PCI_TPH_CAP 4 /* capability register */ 1011*4882a593Smuzhiyun #define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */ 1012*4882a593Smuzhiyun #define PCI_TPH_LOC_NONE 0x000 /* no location */ 1013*4882a593Smuzhiyun #define PCI_TPH_LOC_CAP 0x200 /* in capability */ 1014*4882a593Smuzhiyun #define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */ 1015*4882a593Smuzhiyun #define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */ 1016*4882a593Smuzhiyun #define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */ 1017*4882a593Smuzhiyun #define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */ 1018*4882a593Smuzhiyun 1019*4882a593Smuzhiyun /* Downstream Port Containment */ 1020*4882a593Smuzhiyun #define PCI_EXP_DPC_CAP 4 /* DPC Capability */ 1021*4882a593Smuzhiyun #define PCI_EXP_DPC_IRQ 0x001F /* Interrupt Message Number */ 1022*4882a593Smuzhiyun #define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */ 1023*4882a593Smuzhiyun #define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */ 1024*4882a593Smuzhiyun #define PCI_EXP_DPC_CAP_SW_TRIGGER 0x0080 /* Software Triggering Supported */ 1025*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */ 1026*4882a593Smuzhiyun #define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */ 1027*4882a593Smuzhiyun 1028*4882a593Smuzhiyun #define PCI_EXP_DPC_CTL 6 /* DPC control */ 1029*4882a593Smuzhiyun #define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */ 1030*4882a593Smuzhiyun #define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */ 1031*4882a593Smuzhiyun #define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */ 1032*4882a593Smuzhiyun 1033*4882a593Smuzhiyun #define PCI_EXP_DPC_STATUS 8 /* DPC Status */ 1034*4882a593Smuzhiyun #define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */ 1035*4882a593Smuzhiyun #define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */ 1036*4882a593Smuzhiyun #define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */ 1037*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */ 1038*4882a593Smuzhiyun #define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */ 1039*4882a593Smuzhiyun 1040*4882a593Smuzhiyun #define PCI_EXP_DPC_SOURCE_ID 10 /* DPC Source Identifier */ 1041*4882a593Smuzhiyun 1042*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */ 1043*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO Mask */ 1044*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_SEVERITY 0x14 /* RP PIO Severity */ 1045*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_SYSERROR 0x18 /* RP PIO SysError */ 1046*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_EXCEPTION 0x1C /* RP PIO Exception */ 1047*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_HEADER_LOG 0x20 /* RP PIO Header Log */ 1048*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_IMPSPEC_LOG 0x30 /* RP PIO ImpSpec Log */ 1049*4882a593Smuzhiyun #define PCI_EXP_DPC_RP_PIO_TLPPREFIX_LOG 0x34 /* RP PIO TLP Prefix Log */ 1050*4882a593Smuzhiyun 1051*4882a593Smuzhiyun /* Precision Time Measurement */ 1052*4882a593Smuzhiyun #define PCI_PTM_CAP 0x04 /* PTM Capability */ 1053*4882a593Smuzhiyun #define PCI_PTM_CAP_REQ 0x00000001 /* Requester capable */ 1054*4882a593Smuzhiyun #define PCI_PTM_CAP_ROOT 0x00000004 /* Root capable */ 1055*4882a593Smuzhiyun #define PCI_PTM_GRANULARITY_MASK 0x0000FF00 /* Clock granularity */ 1056*4882a593Smuzhiyun #define PCI_PTM_CTRL 0x08 /* PTM Control */ 1057*4882a593Smuzhiyun #define PCI_PTM_CTRL_ENABLE 0x00000001 /* PTM enable */ 1058*4882a593Smuzhiyun #define PCI_PTM_CTRL_ROOT 0x00000002 /* Root select */ 1059*4882a593Smuzhiyun 1060*4882a593Smuzhiyun /* ASPM L1 PM Substates */ 1061*4882a593Smuzhiyun #define PCI_L1SS_CAP 0x04 /* Capabilities Register */ 1062*4882a593Smuzhiyun #define PCI_L1SS_CAP_PCIPM_L1_2 0x00000001 /* PCI-PM L1.2 Supported */ 1063*4882a593Smuzhiyun #define PCI_L1SS_CAP_PCIPM_L1_1 0x00000002 /* PCI-PM L1.1 Supported */ 1064*4882a593Smuzhiyun #define PCI_L1SS_CAP_ASPM_L1_2 0x00000004 /* ASPM L1.2 Supported */ 1065*4882a593Smuzhiyun #define PCI_L1SS_CAP_ASPM_L1_1 0x00000008 /* ASPM L1.1 Supported */ 1066*4882a593Smuzhiyun #define PCI_L1SS_CAP_L1_PM_SS 0x00000010 /* L1 PM Substates Supported */ 1067*4882a593Smuzhiyun #define PCI_L1SS_CAP_CM_RESTORE_TIME 0x0000ff00 /* Port Common_Mode_Restore_Time */ 1068*4882a593Smuzhiyun #define PCI_L1SS_CAP_P_PWR_ON_SCALE 0x00030000 /* Port T_POWER_ON scale */ 1069*4882a593Smuzhiyun #define PCI_L1SS_CAP_P_PWR_ON_VALUE 0x00f80000 /* Port T_POWER_ON value */ 1070*4882a593Smuzhiyun #define PCI_L1SS_CTL1 0x08 /* Control 1 Register */ 1071*4882a593Smuzhiyun #define PCI_L1SS_CTL1_PCIPM_L1_2 0x00000001 /* PCI-PM L1.2 Enable */ 1072*4882a593Smuzhiyun #define PCI_L1SS_CTL1_PCIPM_L1_1 0x00000002 /* PCI-PM L1.1 Enable */ 1073*4882a593Smuzhiyun #define PCI_L1SS_CTL1_ASPM_L1_2 0x00000004 /* ASPM L1.2 Enable */ 1074*4882a593Smuzhiyun #define PCI_L1SS_CTL1_ASPM_L1_1 0x00000008 /* ASPM L1.1 Enable */ 1075*4882a593Smuzhiyun #define PCI_L1SS_CTL1_L1_2_MASK 0x00000005 1076*4882a593Smuzhiyun #define PCI_L1SS_CTL1_L1SS_MASK 0x0000000f 1077*4882a593Smuzhiyun #define PCI_L1SS_CTL1_CM_RESTORE_TIME 0x0000ff00 /* Common_Mode_Restore_Time */ 1078*4882a593Smuzhiyun #define PCI_L1SS_CTL1_LTR_L12_TH_VALUE 0x03ff0000 /* LTR_L1.2_THRESHOLD_Value */ 1079*4882a593Smuzhiyun #define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */ 1080*4882a593Smuzhiyun #define PCI_L1SS_CTL2 0x0c /* Control 2 Register */ 1081*4882a593Smuzhiyun 1082*4882a593Smuzhiyun /* Data Link Feature */ 1083*4882a593Smuzhiyun #define PCI_DLF_CAP 0x04 /* Capabilities Register */ 1084*4882a593Smuzhiyun #define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */ 1085*4882a593Smuzhiyun 1086*4882a593Smuzhiyun /* Physical Layer 16.0 GT/s */ 1087*4882a593Smuzhiyun #define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ 1088*4882a593Smuzhiyun #define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F 1089*4882a593Smuzhiyun #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 1090*4882a593Smuzhiyun #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 1091*4882a593Smuzhiyun 1092*4882a593Smuzhiyun #endif /* LINUX_PCI_REGS_H */ 1093