Skip to contentSkip to conversation

Add lspci support for Enhanced Allocation Capability.

PATCH Applied David Daney 2 participants 2 messages Dec 23, 2015 – Jan 3, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add lspci support for Enhanced Allocation Capability.

From: David Daney <[email protected]>

The PCISIG recently added the Enhanced Allocation Capability. Decode it in lspci.
---
The specification is currently located here:

https://pcisig.com/sites/default/files/specification_documents/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf

Bjorn Helgaas recently merged Linux kernel support for EA, and Cavium ThunderX processors have implemented it. This patch gives us a pretty view of the capability structure.

Changes from v1: Add and use more symbolic names. Use FLAG() macro where appropiate. Read subordinate bus number from proper offset.

Changes from v2: Reword and reformat some messages.

Changes from v3: Add tests/cap-ea-1, rebased.

Thanks,
David Daney

 lib/header.h   |   8 ++
 ls-caps.c      | 156 +++++++++++++++++++++++++++
 tests/cap-ea-1 | 324 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 488 insertions(+)
 create mode 100644 tests/cap-ea-1
lib/header.h +8 -0
index f7cdee7..b8f7dc1 100644
@@ -203,6 +203,7 @@
 #define  PCI_CAP_ID_MSIX	0x11	/* MSI-X */
 #define  PCI_CAP_ID_SATA	0x12	/* Serial-ATA HBA */
 #define  PCI_CAP_ID_AF		0x13	/* Advanced features of PCI devices integrated in PCIe root cplx */
+#define  PCI_CAP_ID_EA		0x14	/* Enhanced Allocation */
 #define PCI_CAP_LIST_NEXT	1	/* Next capability in the list */
 #define PCI_CAP_FLAGS		2	/* Capability defined flags (16 bits) */
 #define PCI_CAP_SIZEOF		4
@@ -906,6 +907,13 @@
 #define PCI_SATA_HBA_BARS	4
 #define PCI_SATA_HBA_REG0	8
 
+/* Enhanced Allocation (EA) */
+#define PCI_EA_CAP_TYPE1_SECONDARY	4
+#define PCI_EA_CAP_TYPE1_SUBORDINATE	5
+/* EA Entry header */
+#define PCI_EA_CAP_ENT_WRITABLE	0x40000000	/* Writable: 1 = RW, 0 = HwInit */
+#define PCI_EA_CAP_ENT_ENABLE	0x80000000	/* Enable for this entry */
+
 /*** Definitions of extended capabilities ***/
 
 /* Advanced Error Reporting */
ls-caps.c +156 -0

168 lines not on this page · raw message

tests/cap-ea-1 new file +324 -0

324 lines not on this page · raw message

Signature · 1 line
1.8.3.1
Applied
#1 lore raw

Hi!

Quoted 13 lines

From: David Daney <[email protected]>

The PCISIG recently added the Enhanced Allocation Capability. Decode it in lspci.
---
The specification is currently located here:

https://pcisig.com/sites/default/files/specification_documents/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf

Bjorn Helgaas recently merged Linux kernel support for EA, and Cavium ThunderX processors have implemented it. This patch gives us a pretty view of the capability structure.

Quoted 6 lines

Changes from v1: Add and use more symbolic names. Use FLAG() macro where appropiate. Read subordinate bus number from proper offset.

Changes from v2: Reword and reformat some messages.

Changes from v3: Add tests/cap-ea-1, rebased.

Thanks, applied.

Have a nice fortnight

Signature · 3 lines
Martin `MJ' Mares                          <[email protected]>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Homo homini lupus, frater fratri lupior, bohemus bohemo lupissimus.