History

PCI: Add resizable BAR infrastructure

Add resizable BAR infrastructure, including defines and helper functions to read the possible sizes of a BAR and update its size. See PCIe r3.1, sec 7.22.

Christian König committed 9 years ago

Commit 276b7381 parent cb21bc93 files · +115 −2Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/pci_regs.h+6−2
@@ -939,9 +939,13 @@ · 938 unmodified lines
939939 #define PCI_SATA_SIZEOF_LONG 16
940940
941941 /* Resizable BARs */
942+#define PCI_REBAR_CAP 4 /* capability register */
943+#define PCI_REBAR_CAP_SIZES 0x00FFFFF0 /* supported BAR sizes */
942944 #define PCI_REBAR_CTRL 8 /* control register */
943−#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
944−#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
945+#define PCI_REBAR_CTRL_BAR_IDX 0x00000007 /* BAR index */
946+#define PCI_REBAR_CTRL_NBAR_MASK 0x000000E0 /* # of resizable BARs */
947+#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # of BARs */
948+#define PCI_REBAR_CTRL_BAR_SIZE 0x00001F00 /* BAR size */
945949
946950 /* Dynamic Power Allocation */
947951 #define PCI_DPA_CAP 4 /* capability register */