dm_pci_read_config32(udev, bar, &bar_response);
pci_bus_addr = (pci_addr_t)(bar_response & ~0xf);
+ /* This has a lot of baked in assumptions, but essentially tries
+ * to mirror the behavior of BAR assignment for 64 Bit enabled
+ * hosts and 64 bit placeable BARs in the auto assign code.
+ */
+#if defined(CONFIG_SYS_PCI_64BIT)
+ if (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ dm_pci_read_config32(udev, bar + 4, &bar_response);
+ pci_bus_addr |= (pci_addr_t)bar_response << 32;
+ }
+#endif /* CONFIG_SYS_PCI_64BIT */
+
if (~((pci_addr_t)0) - pci_bus_addr < offset)
return NULL;
* 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.
+ * Can also be used on 64b bars on type 0 functions.
*
* @dev: Device to check
* @bar: Bar register offset (PCI_BASE_ADDRESS_...)