diff options
author | Andrew Scull <ascull@google.com> | 2022-04-21 16:11:16 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-05-03 18:33:29 -0400 |
commit | 3b920186752518fe669cb337c433a69ee021bc30 (patch) | |
tree | 8c0241b1adb7345fe8df34da06ff1dac83f74e4f /drivers/pci/pci-uclass.c | |
parent | 0699a78c0c583691c44ffab0da061d3740d288b3 (diff) |
pci: Add config for Enhanced Allocation
Add a config to control whether Enhanced Allocation is supported by the
driver.
Signed-off-by: Andrew Scull <ascull@google.com>
Diffstat (limited to 'drivers/pci/pci-uclass.c')
-rw-r--r-- | drivers/pci/pci-uclass.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index bb53e6ba5f7..970ee1adf1b 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -645,7 +645,11 @@ int dm_pci_hose_probe_bus(struct udevice *bus) return log_msg_ret("probe", -EINVAL); } - ea_pos = dm_pci_find_capability(bus, PCI_CAP_ID_EA); + if (IS_ENABLED(CONFIG_PCI_ENHANCED_ALLOCATION)) + ea_pos = dm_pci_find_capability(bus, PCI_CAP_ID_EA); + else + ea_pos = 0; + if (ea_pos) { dm_pci_read_config8(bus, ea_pos + sizeof(u32) + sizeof(u8), ®); @@ -1579,7 +1583,11 @@ void *dm_pci_map_bar(struct udevice *dev, int bar, size_t offset, size_t len, * Incase of virtual functions, pdata will help read VF BEI * and EA entry size. */ - ea_off = dm_pci_find_capability(udev, PCI_CAP_ID_EA); + if (IS_ENABLED(CONFIG_PCI_ENHANCED_ALLOCATION)) + ea_off = dm_pci_find_capability(udev, PCI_CAP_ID_EA); + else + ea_off = 0; + if (ea_off) return dm_pci_map_ea_bar(udev, bar, offset, len, ea_off, pdata); |