summaryrefslogtreecommitdiff
path: root/include/pci.h
diff options
context:
space:
mode:
authorAlex Marginean <alexm.osslist@gmail.com>2019-06-07 11:24:23 +0300
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commit0b143d8ab2b84219552d652e46619360a38888d1 (patch)
tree165554ec7e72d81dcb55564cd6586e3635cf7688 /include/pci.h
parent2204bc1bd3abedc37a72282b4ddcfb3eca8cfccb (diff)
drivers: pci: add map_bar support for Enhanced Allocation
Makes dm_pci_map_bar API available for integrated PCI devices that support Enhanced Allocation instead of the original PCI BAR mechanism. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/pci.h')
-rw-r--r--include/pci.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h
index 40c7751acf..0aab438159 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -455,6 +455,17 @@
#define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM
+/* Enhanced Allocation Registers */
+#define PCI_EA_NUM_ENT 2 /* Number of Capability Entries */
+#define PCI_EA_NUM_ENT_MASK 0x3f /* Num Entries Mask */
+#define PCI_EA_FIRST_ENT 4 /* First EA Entry in List */
+#define PCI_EA_ES 0x00000007 /* Entry Size */
+#define PCI_EA_BEI 0x000000f0 /* BAR Equivalent Indicator */
+/* Base, MaxOffset registers */
+/* bit 0 is reserved */
+#define PCI_EA_IS_64 0x00000002 /* 64-bit field flag */
+#define PCI_EA_FIELD_MASK 0xfffffffc /* For Base & Max Offset */
+
/* Include the ID list */
#include <pci_ids.h>
@@ -1312,6 +1323,8 @@ pci_addr_t dm_pci_phys_to_bus(struct udevice *dev, phys_addr_t addr,
* that corresponds to it.
* Can be used for 32b BARs 0-5 on type 0 functions and for 32b BARs 0-1 on
* type 1 functions.
+ * Can also be used on type 0 functions that support Enhanced Allocation for
+ * 32b/64b BARs. Note that duplicate BEI entries are not supported.
*
* @dev: Device to check
* @bar: Bar register offset (PCI_BASE_ADDRESS_...)