[ena] Use pci_bar_set() to place device within bridge memory window

Use pci_bar_set() when we need to set a device base address (on
instance types such as c6i.metal where the BIOS fails to do so), so
that 64-bit BARs will be handled automatically.

This particular issue has so far been observed only on 6th generation
instances.  These use 32-bit BARs, and so the lack of support for
handling 64-bit BARs has not caused any observable issue.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-10-14 14:44:56 +01:00
parent 94902ae187
commit 04a61c413d

View File

@@ -1102,7 +1102,7 @@ static int ena_membase ( struct ena_nic *ena, struct pci_device *pci ) {
} }
/* Place device at start of memory window */ /* Place device at start of memory window */
pci_write_config_dword ( pci, PCI_BASE_ADDRESS_0, bridge->membase ); pci_bar_set ( pci, PCI_BASE_ADDRESS_0, bridge->membase );
pci->membase = bridge->membase; pci->membase = bridge->membase;
DBGC ( ena, "ENA %p at " PCI_FMT " claiming bridge " PCI_FMT " mem " DBGC ( ena, "ENA %p at " PCI_FMT " claiming bridge " PCI_FMT " mem "
"%08x\n", ena, PCI_ARGS ( pci ), PCI_ARGS ( bridge->pci ), "%08x\n", ena, PCI_ARGS ( pci ), PCI_ARGS ( bridge->pci ),