📄 pci_regs.h
字号:
#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */#define PCI_AGP_SIZEOF 12/* Vital Product Data */#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */#define PCI_VPD_DATA 4 /* 32-bits of data returned here *//* Slot Identification */#define PCI_SID_ESR 2 /* Expansion Slot Register */#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */#define PCI_SID_CHASSIS_NR 3 /* Chassis Number *//* Message Signalled Interrupts registers */#define PCI_MSI_FLAGS 2 /* Various flags */#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */#define PCI_MSI_RFU 3 /* Rest of capability flags */#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */#define PCI_MSI_MASK_BIT 16 /* Mask bits register *//* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */#define PCI_MSIX_FLAGS 2#define PCI_MSIX_FLAGS_QSIZE 0x7FF#define PCI_MSIX_FLAGS_ENABLE (1 << 15)#define PCI_MSIX_FLAGS_MASKALL (1 << 14)#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)#define PCI_MSIX_FLAGS_BITMASK (1 << 0)/* CompactPCI Hotswap Register */#define PCI_CHSWP_CSR 2 /* Control and Status Register */#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */#define PCI_CHSWP_LOO 0x08 /* LED On / Off */#define PCI_CHSWP_PI 0x30 /* Programming Interface */#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion *//* PCI-X registers */#define PCI_X_CMD 2 /* Modes & Features */#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */#define PCI_X_CMD_READ_512 0x0000 /* 512 byte maximum read byte count */#define PCI_X_CMD_READ_1K 0x0004 /* 1Kbyte maximum read byte count */#define PCI_X_CMD_READ_2K 0x0008 /* 2Kbyte maximum read byte count */#define PCI_X_CMD_READ_4K 0x000c /* 4Kbyte maximum read byte count */#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */ /* Max # of outstanding split transactions */#define PCI_X_CMD_SPLIT_1 0x0000 /* Max 1 */#define PCI_X_CMD_SPLIT_2 0x0010 /* Max 2 */#define PCI_X_CMD_SPLIT_3 0x0020 /* Max 3 */#define PCI_X_CMD_SPLIT_4 0x0030 /* Max 4 */#define PCI_X_CMD_SPLIT_8 0x0040 /* Max 8 */#define PCI_X_CMD_SPLIT_12 0x0050 /* Max 12 */#define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */#define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */#define PCI_X_STATUS 4 /* PCI-X capabilities */#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable *//* PCI Express capability registers */#define PCI_EXP_FLAGS 2 /* Capabilities register */#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */#define PCI_EXP_DEVCAP 4 /* Device capabilities */#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */#define PCI_EXP_DEVCTL 8 /* Device Control */#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */#define PCI_EXP_DEVSTA 10 /* Device Status */#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */#define PCI_EXP_LNKCAP 12 /* Link Capabilities */#define PCI_EXP_LNKCTL 16 /* Link Control */#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */#define PCI_EXP_LNKSTA 18 /* Link Status */#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */#define PCI_EXP_SLTCTL 24 /* Slot Control */#define PCI_EXP_SLTSTA 26 /* Slot Status */#define PCI_EXP_RTCTL 28 /* Root Control */#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */#define PCI_EXP_RTCAP 30 /* Root Capabilities */#define PCI_EXP_RTSTA 32 /* Root Status *//* Extended Capabilities (PCI-X 2.0 and Express) */#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)#define PCI_EXT_CAP_ID_ERR 1#define PCI_EXT_CAP_ID_VC 2#define PCI_EXT_CAP_ID_DSN 3#define PCI_EXT_CAP_ID_PWR 4/* Advanced Error Reporting */#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ /* Same bits as above */#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ /* Same bits as above */#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ /* Same bits as above */#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command *//* Correctable Err Reporting Enable */#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001/* Non-fatal Err Reporting Enable */#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002/* Fatal Err Reporting Enable */#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004#define PCI_ERR_ROOT_STATUS 48#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received *//* Multi ERR_COR Received */#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002/* ERR_FATAL/NONFATAL Recevied */#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004/* Multi ERR_FATAL/NONFATAL Recevied */#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */#define PCI_ERR_ROOT_COR_SRC 52#define PCI_ERR_ROOT_SRC 54/* Virtual Channel */#define PCI_VC_PORT_REG1 4#define PCI_VC_PORT_REG2 8#define PCI_VC_PORT_CTRL 12#define PCI_VC_PORT_STATUS 14#define PCI_VC_RES_CAP 16#define PCI_VC_RES_CTRL 20#define PCI_VC_RES_STATUS 26/* Power Budgeting */#define PCI_PWR_DSR 4 /* Data Select Register */#define PCI_PWR_DATA 8 /* Data Register */#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */#define PCI_PWR_CAP 12 /* Capability */#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget *//* * Hypertransport sub capability types * * Unfortunately there are both 3 bit and 5 bit capability types defined * in the HT spec, catering for that is a little messy. You probably don't * want to use these directly, just use pci_find_ht_capability() and it * will do the right thing for you. */#define HT_3BIT_CAP_MASK 0xE0#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */#define HT_5BIT_CAP_MASK 0xF8#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */#define HT_MSI_FLAGS 0x02 /* Offset to flags */#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */#endif /* LINUX_PCI_REGS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -