diff options
Diffstat (limited to 'include/linux/pci_regs.h')
-rw-r--r-- | include/linux/pci_regs.h | 122 |
1 files changed, 109 insertions, 13 deletions
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 4b608f543412..53274bff5773 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,7 @@ | |||
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 */ | ||
524 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 546 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
525 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 547 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
526 | 548 | ||
@@ -529,23 +551,43 @@ | |||
529 | #define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) | 551 | #define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) |
530 | #define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) | 552 | #define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) |
531 | 553 | ||
532 | #define PCI_EXT_CAP_ID_ERR 1 | 554 | #define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */ |
533 | #define PCI_EXT_CAP_ID_VC 2 | 555 | #define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */ |
534 | #define PCI_EXT_CAP_ID_DSN 3 | 556 | #define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ |
535 | #define PCI_EXT_CAP_ID_PWR 4 | 557 | #define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */ |
536 | #define PCI_EXT_CAP_ID_VNDR 11 | 558 | #define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */ |
537 | #define PCI_EXT_CAP_ID_ACS 13 | 559 | #define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */ |
538 | #define PCI_EXT_CAP_ID_ARI 14 | 560 | #define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */ |
539 | #define PCI_EXT_CAP_ID_ATS 15 | 561 | #define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */ |
540 | #define PCI_EXT_CAP_ID_SRIOV 16 | 562 | #define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */ |
541 | #define PCI_EXT_CAP_ID_PRI 19 | 563 | #define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */ |
542 | #define PCI_EXT_CAP_ID_LTR 24 | 564 | #define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */ |
543 | #define PCI_EXT_CAP_ID_PASID 27 | 565 | #define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */ |
566 | #define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */ | ||
567 | #define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */ | ||
568 | #define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */ | ||
569 | #define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */ | ||
570 | #define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */ | ||
571 | #define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */ | ||
572 | #define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */ | ||
573 | #define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */ | ||
574 | #define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */ | ||
575 | #define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */ | ||
576 | #define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */ | ||
577 | #define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */ | ||
578 | #define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */ | ||
579 | #define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */ | ||
580 | #define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ | ||
581 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID | ||
582 | |||
583 | #define PCI_EXT_CAP_DSN_SIZEOF 12 | ||
584 | #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 | ||
544 | 585 | ||
545 | /* Advanced Error Reporting */ | 586 | /* Advanced Error Reporting */ |
546 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ | 587 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
547 | #define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ | 588 | #define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ |
548 | #define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ | 589 | #define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ |
590 | #define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */ | ||
549 | #define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ | 591 | #define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ |
550 | #define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ | 592 | #define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ |
551 | #define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ | 593 | #define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ |
@@ -555,6 +597,11 @@ | |||
555 | #define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ | 597 | #define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ |
556 | #define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ | 598 | #define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ |
557 | #define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ | 599 | #define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ |
600 | #define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */ | ||
601 | #define PCI_ERR_UNC_INTN 0x00400000 /* internal error */ | ||
602 | #define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */ | ||
603 | #define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */ | ||
604 | #define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */ | ||
558 | #define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ | 605 | #define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ |
559 | /* Same bits as above */ | 606 | /* Same bits as above */ |
560 | #define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ | 607 | #define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ |
@@ -565,6 +612,9 @@ | |||
565 | #define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ | 612 | #define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ |
566 | #define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ | 613 | #define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ |
567 | #define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ | 614 | #define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ |
615 | #define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */ | ||
616 | #define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */ | ||
617 | #define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */ | ||
568 | #define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ | 618 | #define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ |
569 | /* Same bits as above */ | 619 | /* Same bits as above */ |
570 | #define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ | 620 | #define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ |
@@ -596,12 +646,18 @@ | |||
596 | 646 | ||
597 | /* Virtual Channel */ | 647 | /* Virtual Channel */ |
598 | #define PCI_VC_PORT_REG1 4 | 648 | #define PCI_VC_PORT_REG1 4 |
649 | #define PCI_VC_REG1_EVCC 0x7 /* extended vc count */ | ||
599 | #define PCI_VC_PORT_REG2 8 | 650 | #define PCI_VC_PORT_REG2 8 |
651 | #define PCI_VC_REG2_32_PHASE 0x2 | ||
652 | #define PCI_VC_REG2_64_PHASE 0x4 | ||
653 | #define PCI_VC_REG2_128_PHASE 0x8 | ||
600 | #define PCI_VC_PORT_CTRL 12 | 654 | #define PCI_VC_PORT_CTRL 12 |
601 | #define PCI_VC_PORT_STATUS 14 | 655 | #define PCI_VC_PORT_STATUS 14 |
602 | #define PCI_VC_RES_CAP 16 | 656 | #define PCI_VC_RES_CAP 16 |
603 | #define PCI_VC_RES_CTRL 20 | 657 | #define PCI_VC_RES_CTRL 20 |
604 | #define PCI_VC_RES_STATUS 26 | 658 | #define PCI_VC_RES_STATUS 26 |
659 | #define PCI_CAP_VC_BASE_SIZEOF 0x10 | ||
660 | #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C | ||
605 | 661 | ||
606 | /* Power Budgeting */ | 662 | /* Power Budgeting */ |
607 | #define PCI_PWR_DSR 4 /* Data Select Register */ | 663 | #define PCI_PWR_DSR 4 /* Data Select Register */ |
@@ -614,6 +670,7 @@ | |||
614 | #define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ | 670 | #define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ |
615 | #define PCI_PWR_CAP 12 /* Capability */ | 671 | #define PCI_PWR_CAP 12 /* Capability */ |
616 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ | 672 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ |
673 | #define PCI_EXT_CAP_PWR_SIZEOF 16 | ||
617 | 674 | ||
618 | /* | 675 | /* |
619 | * Hypertransport sub capability types | 676 | * Hypertransport sub capability types |
@@ -646,6 +703,8 @@ | |||
646 | #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ | 703 | #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ |
647 | #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ | 704 | #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ |
648 | #define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ | 705 | #define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ |
706 | #define HT_CAP_SIZEOF_LONG 28 /* slave & primary */ | ||
707 | #define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */ | ||
649 | 708 | ||
650 | /* Alternative Routing-ID Interpretation */ | 709 | /* Alternative Routing-ID Interpretation */ |
651 | #define PCI_ARI_CAP 0x04 /* ARI Capability Register */ | 710 | #define PCI_ARI_CAP 0x04 /* ARI Capability Register */ |
@@ -656,6 +715,7 @@ | |||
656 | #define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ | 715 | #define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ |
657 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ | 716 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ |
658 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ | 717 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ |
718 | #define PCI_EXT_CAP_ARI_SIZEOF 8 | ||
659 | 719 | ||
660 | /* Address Translation Service */ | 720 | /* Address Translation Service */ |
661 | #define PCI_ATS_CAP 0x04 /* ATS Capability Register */ | 721 | #define PCI_ATS_CAP 0x04 /* ATS Capability Register */ |
@@ -665,6 +725,7 @@ | |||
665 | #define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ | 725 | #define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ |
666 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ | 726 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ |
667 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | 727 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ |
728 | #define PCI_EXT_CAP_ATS_SIZEOF 8 | ||
668 | 729 | ||
669 | /* Page Request Interface */ | 730 | /* Page Request Interface */ |
670 | #define PCI_PRI_CTRL 0x04 /* PRI control register */ | 731 | #define PCI_PRI_CTRL 0x04 /* PRI control register */ |
@@ -676,6 +737,7 @@ | |||
676 | #define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ | 737 | #define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ |
677 | #define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ | 738 | #define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ |
678 | #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ | 739 | #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ |
740 | #define PCI_EXT_CAP_PRI_SIZEOF 16 | ||
679 | 741 | ||
680 | /* PASID capability */ | 742 | /* PASID capability */ |
681 | #define PCI_PASID_CAP 0x04 /* PASID feature register */ | 743 | #define PCI_PASID_CAP 0x04 /* PASID feature register */ |
@@ -685,6 +747,7 @@ | |||
685 | #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ | 747 | #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ |
686 | #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ | 748 | #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ |
687 | #define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ | 749 | #define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ |
750 | #define PCI_EXT_CAP_PASID_SIZEOF 8 | ||
688 | 751 | ||
689 | /* Single Root I/O Virtualization */ | 752 | /* Single Root I/O Virtualization */ |
690 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 753 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
@@ -716,12 +779,14 @@ | |||
716 | #define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ | 779 | #define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ |
717 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 780 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
718 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 781 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
782 | #define PCI_EXT_CAP_SRIOV_SIZEOF 64 | ||
719 | 783 | ||
720 | #define PCI_LTR_MAX_SNOOP_LAT 0x4 | 784 | #define PCI_LTR_MAX_SNOOP_LAT 0x4 |
721 | #define PCI_LTR_MAX_NOSNOOP_LAT 0x6 | 785 | #define PCI_LTR_MAX_NOSNOOP_LAT 0x6 |
722 | #define PCI_LTR_VALUE_MASK 0x000003ff | 786 | #define PCI_LTR_VALUE_MASK 0x000003ff |
723 | #define PCI_LTR_SCALE_MASK 0x00001c00 | 787 | #define PCI_LTR_SCALE_MASK 0x00001c00 |
724 | #define PCI_LTR_SCALE_SHIFT 10 | 788 | #define PCI_LTR_SCALE_SHIFT 10 |
789 | #define PCI_EXT_CAP_LTR_SIZEOF 8 | ||
725 | 790 | ||
726 | /* Access Control Service */ | 791 | /* Access Control Service */ |
727 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | 792 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ |
@@ -732,7 +797,38 @@ | |||
732 | #define PCI_ACS_UF 0x10 /* Upstream Forwarding */ | 797 | #define PCI_ACS_UF 0x10 /* Upstream Forwarding */ |
733 | #define PCI_ACS_EC 0x20 /* P2P Egress Control */ | 798 | #define PCI_ACS_EC 0x20 /* P2P Egress Control */ |
734 | #define PCI_ACS_DT 0x40 /* Direct Translated P2P */ | 799 | #define PCI_ACS_DT 0x40 /* Direct Translated P2P */ |
800 | #define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */ | ||
735 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ | 801 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ |
736 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ | 802 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ |
737 | 803 | ||
804 | #define PCI_VSEC_HDR 4 /* extended cap - vendor specific */ | ||
805 | #define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */ | ||
806 | |||
807 | /* sata capability */ | ||
808 | #define PCI_SATA_REGS 4 /* SATA REGs specifier */ | ||
809 | #define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */ | ||
810 | #define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */ | ||
811 | #define PCI_SATA_SIZEOF_SHORT 8 | ||
812 | #define PCI_SATA_SIZEOF_LONG 16 | ||
813 | |||
814 | /* resizable BARs */ | ||
815 | #define PCI_REBAR_CTRL 8 /* control register */ | ||
816 | #define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */ | ||
817 | #define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */ | ||
818 | |||
819 | /* dynamic power allocation */ | ||
820 | #define PCI_DPA_CAP 4 /* capability register */ | ||
821 | #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ | ||
822 | #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ | ||
823 | |||
824 | /* TPH Requester */ | ||
825 | #define PCI_TPH_CAP 4 /* capability register */ | ||
826 | #define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */ | ||
827 | #define PCI_TPH_LOC_NONE 0x000 /* no location */ | ||
828 | #define PCI_TPH_LOC_CAP 0x200 /* in capability */ | ||
829 | #define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */ | ||
830 | #define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */ | ||
831 | #define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */ | ||
832 | #define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */ | ||
833 | |||
738 | #endif /* LINUX_PCI_REGS_H */ | 834 | #endif /* LINUX_PCI_REGS_H */ |