aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci_regs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci_regs.h')
-rw-r--r--include/linux/pci_regs.h127
1 files changed, 114 insertions, 13 deletions
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 4b608f543412..7fb75b143755 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -26,6 +26,7 @@
26 * Under PCI, each device has 256 bytes of configuration address space, 26 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows: 27 * of which the first 64 bytes are standardized as follows:
28 */ 28 */
29#define PCI_STD_HEADER_SIZEOF 64
29#define PCI_VENDOR_ID 0x00 /* 16 bits */ 30#define PCI_VENDOR_ID 0x00 /* 16 bits */
30#define PCI_DEVICE_ID 0x02 /* 16 bits */ 31#define PCI_DEVICE_ID 0x02 /* 16 bits */
31#define PCI_COMMAND 0x04 /* 16 bits */ 32#define PCI_COMMAND 0x04 /* 16 bits */
@@ -125,7 +126,8 @@
125#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ 126#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
126#define PCI_IO_RANGE_TYPE_16 0x00 127#define PCI_IO_RANGE_TYPE_16 0x00
127#define PCI_IO_RANGE_TYPE_32 0x01 128#define PCI_IO_RANGE_TYPE_32 0x01
128#define PCI_IO_RANGE_MASK (~0x0fUL) 129#define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */
130#define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */
129#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 131#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
130#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 132#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
131#define PCI_MEMORY_LIMIT 0x22 133#define PCI_MEMORY_LIMIT 0x22
@@ -209,9 +211,12 @@
209#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 211#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
210#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ 212#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
211#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ 213#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
214#define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */
212#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 215#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
213#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 216#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
217#define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */
214#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ 218#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
219#define PCI_CAP_ID_MAX PCI_CAP_ID_AF
215#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 220#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
216#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ 221#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
217#define PCI_CAP_SIZEOF 4 222#define PCI_CAP_SIZEOF 4
@@ -276,6 +281,7 @@
276#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ 281#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
277#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ 282#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
278#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ 283#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
284#define PCI_CAP_VPD_SIZEOF 8
279 285
280/* Slot Identification */ 286/* Slot Identification */
281 287
@@ -297,8 +303,10 @@
297#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
298#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 304#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
299#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ 305#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
306#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 307#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 308#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
302 310
303/* MSI-X registers */ 311/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 312#define PCI_MSIX_FLAGS 2
@@ -308,6 +316,7 @@
308#define PCI_MSIX_TABLE 4 316#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8 317#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
311 320
312/* MSI-X entry's format */ 321/* MSI-X entry's format */
313#define PCI_MSIX_ENTRY_SIZE 16 322#define PCI_MSIX_ENTRY_SIZE 16
@@ -338,6 +347,7 @@
338#define PCI_AF_CTRL_FLR 0x01 347#define PCI_AF_CTRL_FLR 0x01
339#define PCI_AF_STATUS 5 348#define PCI_AF_STATUS 5
340#define PCI_AF_STATUS_TP 0x01 349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
341 351
342/* PCI-X registers */ 352/* PCI-X registers */
343 353
@@ -374,6 +384,10 @@
374#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ 384#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
375#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 385#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
376#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 386#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
387#define PCI_X_ECC_CSR 8 /* ECC control and status */
388#define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
377 391
378/* PCI Bridge Subsystem ID registers */ 392/* PCI Bridge Subsystem ID registers */
379 393
@@ -462,6 +476,7 @@
462#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ 476#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
463#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ 477#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
464#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ 478#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
479#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */
465#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 480#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
466#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ 481#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
467#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ 482#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
@@ -507,6 +522,12 @@
507#define PCI_EXP_RTSTA 32 /* Root Status */ 522#define PCI_EXP_RTSTA 32 /* Root Status */
508#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 523#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */
509#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 524#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */
525/*
526 * Note that the following PCI Express 'Capability Structure' registers
527 * were introduced with 'Capability Version' 0x2 (v2). These registers
528 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2()
529 * to use these fields safely.
530 */
510#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 531#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
511#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 532#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
512#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 533#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */
@@ -521,6 +542,12 @@
521#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 542#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */
522#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 543#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */
523#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
546#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */
547#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */
548#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */
549#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */
550#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */
524#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
525#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 552#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
526 553
@@ -529,23 +556,43 @@
529#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) 556#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
530#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) 557#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
531 558
532#define PCI_EXT_CAP_ID_ERR 1 559#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */
533#define PCI_EXT_CAP_ID_VC 2 560#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */
534#define PCI_EXT_CAP_ID_DSN 3 561#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */
535#define PCI_EXT_CAP_ID_PWR 4 562#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */
536#define PCI_EXT_CAP_ID_VNDR 11 563#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */
537#define PCI_EXT_CAP_ID_ACS 13 564#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */
538#define PCI_EXT_CAP_ID_ARI 14 565#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */
539#define PCI_EXT_CAP_ID_ATS 15 566#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */
540#define PCI_EXT_CAP_ID_SRIOV 16 567#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */
541#define PCI_EXT_CAP_ID_PRI 19 568#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */
542#define PCI_EXT_CAP_ID_LTR 24 569#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */
543#define PCI_EXT_CAP_ID_PASID 27 570#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */
571#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */
572#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */
573#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */
574#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */
575#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */
576#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */
577#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */
578#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */
579#define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */
580#define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */
581#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */
582#define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */
583#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */
584#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */
585#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */
586#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID
587
588#define PCI_EXT_CAP_DSN_SIZEOF 12
589#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
544 590
545/* Advanced Error Reporting */ 591/* Advanced Error Reporting */
546#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 592#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
547#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ 593#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
548#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ 594#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
595#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
549#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ 596#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
550#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ 597#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
551#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ 598#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
@@ -555,6 +602,11 @@
555#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ 602#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
556#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ 603#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
557#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ 604#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
605#define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */
606#define PCI_ERR_UNC_INTN 0x00400000 /* internal error */
607#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
608#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
609#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
558#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ 610#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
559 /* Same bits as above */ 611 /* Same bits as above */
560#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ 612#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
@@ -565,6 +617,9 @@
565#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ 617#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
566#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ 618#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
567#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ 619#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
620#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
621#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
622#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
568#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ 623#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
569 /* Same bits as above */ 624 /* Same bits as above */
570#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ 625#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
@@ -596,12 +651,18 @@
596 651
597/* Virtual Channel */ 652/* Virtual Channel */
598#define PCI_VC_PORT_REG1 4 653#define PCI_VC_PORT_REG1 4
654#define PCI_VC_REG1_EVCC 0x7 /* extended vc count */
599#define PCI_VC_PORT_REG2 8 655#define PCI_VC_PORT_REG2 8
656#define PCI_VC_REG2_32_PHASE 0x2
657#define PCI_VC_REG2_64_PHASE 0x4
658#define PCI_VC_REG2_128_PHASE 0x8
600#define PCI_VC_PORT_CTRL 12 659#define PCI_VC_PORT_CTRL 12
601#define PCI_VC_PORT_STATUS 14 660#define PCI_VC_PORT_STATUS 14
602#define PCI_VC_RES_CAP 16 661#define PCI_VC_RES_CAP 16
603#define PCI_VC_RES_CTRL 20 662#define PCI_VC_RES_CTRL 20
604#define PCI_VC_RES_STATUS 26 663#define PCI_VC_RES_STATUS 26
664#define PCI_CAP_VC_BASE_SIZEOF 0x10
665#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
605 666
606/* Power Budgeting */ 667/* Power Budgeting */
607#define PCI_PWR_DSR 4 /* Data Select Register */ 668#define PCI_PWR_DSR 4 /* Data Select Register */
@@ -614,6 +675,7 @@
614#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ 675#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
615#define PCI_PWR_CAP 12 /* Capability */ 676#define PCI_PWR_CAP 12 /* Capability */
616#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 677#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
678#define PCI_EXT_CAP_PWR_SIZEOF 16
617 679
618/* 680/*
619 * Hypertransport sub capability types 681 * Hypertransport sub capability types
@@ -646,6 +708,8 @@
646#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 708#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
647#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ 709#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
648#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ 710#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
711#define HT_CAP_SIZEOF_LONG 28 /* slave & primary */
712#define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */
649 713
650/* Alternative Routing-ID Interpretation */ 714/* Alternative Routing-ID Interpretation */
651#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ 715#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
@@ -656,6 +720,7 @@
656#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ 720#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
657#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 721#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
658#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 722#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
723#define PCI_EXT_CAP_ARI_SIZEOF 8
659 724
660/* Address Translation Service */ 725/* Address Translation Service */
661#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ 726#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
@@ -665,6 +730,7 @@
665#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ 730#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
666#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 731#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
667#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 732#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
733#define PCI_EXT_CAP_ATS_SIZEOF 8
668 734
669/* Page Request Interface */ 735/* Page Request Interface */
670#define PCI_PRI_CTRL 0x04 /* PRI control register */ 736#define PCI_PRI_CTRL 0x04 /* PRI control register */
@@ -676,6 +742,7 @@
676#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ 742#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
677#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ 743#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
678#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ 744#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
745#define PCI_EXT_CAP_PRI_SIZEOF 16
679 746
680/* PASID capability */ 747/* PASID capability */
681#define PCI_PASID_CAP 0x04 /* PASID feature register */ 748#define PCI_PASID_CAP 0x04 /* PASID feature register */
@@ -685,6 +752,7 @@
685#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ 752#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
686#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ 753#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
687#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ 754#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */
755#define PCI_EXT_CAP_PASID_SIZEOF 8
688 756
689/* Single Root I/O Virtualization */ 757/* Single Root I/O Virtualization */
690#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 758#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
@@ -716,12 +784,14 @@
716#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ 784#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
717#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 785#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
718#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 786#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
787#define PCI_EXT_CAP_SRIOV_SIZEOF 64
719 788
720#define PCI_LTR_MAX_SNOOP_LAT 0x4 789#define PCI_LTR_MAX_SNOOP_LAT 0x4
721#define PCI_LTR_MAX_NOSNOOP_LAT 0x6 790#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
722#define PCI_LTR_VALUE_MASK 0x000003ff 791#define PCI_LTR_VALUE_MASK 0x000003ff
723#define PCI_LTR_SCALE_MASK 0x00001c00 792#define PCI_LTR_SCALE_MASK 0x00001c00
724#define PCI_LTR_SCALE_SHIFT 10 793#define PCI_LTR_SCALE_SHIFT 10
794#define PCI_EXT_CAP_LTR_SIZEOF 8
725 795
726/* Access Control Service */ 796/* Access Control Service */
727#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ 797#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
@@ -732,7 +802,38 @@
732#define PCI_ACS_UF 0x10 /* Upstream Forwarding */ 802#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
733#define PCI_ACS_EC 0x20 /* P2P Egress Control */ 803#define PCI_ACS_EC 0x20 /* P2P Egress Control */
734#define PCI_ACS_DT 0x40 /* Direct Translated P2P */ 804#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
805#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
735#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ 806#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
736#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ 807#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
737 808
809#define PCI_VSEC_HDR 4 /* extended cap - vendor specific */
810#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
811
812/* sata capability */
813#define PCI_SATA_REGS 4 /* SATA REGs specifier */
814#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
815#define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */
816#define PCI_SATA_SIZEOF_SHORT 8
817#define PCI_SATA_SIZEOF_LONG 16
818
819/* resizable BARs */
820#define PCI_REBAR_CTRL 8 /* control register */
821#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
822#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
823
824/* dynamic power allocation */
825#define PCI_DPA_CAP 4 /* capability register */
826#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
827#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
828
829/* TPH Requester */
830#define PCI_TPH_CAP 4 /* capability register */
831#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */
832#define PCI_TPH_LOC_NONE 0x000 /* no location */
833#define PCI_TPH_LOC_CAP 0x200 /* in capability */
834#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
835#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
836#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
837#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
838
738#endif /* LINUX_PCI_REGS_H */ 839#endif /* LINUX_PCI_REGS_H */