]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ena] Use pci_bar_set() to place device within bridge memory window
authorMichael Brown <mcb30@ipxe.org>
Tue, 14 Oct 2025 13:44:56 +0000 (14:44 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 14 Oct 2025 14:57:02 +0000 (15:57 +0100)
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>
src/drivers/net/ena.c

index 89483eae1be44f3dfaaabc164d5341227160aae5..dc822dcf6283cd24cde85744755e0e1197fa1674 100644 (file)
@@ -1102,7 +1102,7 @@ static int ena_membase ( struct ena_nic *ena, struct pci_device *pci ) {
        }
 
        /* 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;
        DBGC ( ena, "ENA %p at " PCI_FMT " claiming bridge " PCI_FMT " mem "
               "%08x\n", ena, PCI_ARGS ( pci ), PCI_ARGS ( bridge->pci ),