Hello all, I ran into an issue with AHCI BAR allocation on arm64. The AHCI PCI driver in sys/dev/ahci/ahci_pci.c assumes that ABAR (AHCI Base Address) register is located at offset 0x24 (BAR5) in the PCI header. Specification for AHCI confirms this is indeed the default address of the main BAR. However, if AHCI uses 64-bit base addresses, then this register consists of two dwords starting at offset 0x20 - BAR4 and BAR5. This is the case on our arm64 target and possibly other platforms using 64-bit BARs for AHCI. The following patch adds a check for the extended BAR in ahci_pci_attach() and sets the 'rid' in bus_alloc_resource_any accordingly. It fixes the allocation error on our platform. Please review and test this patch on other platforms. If there are no issues then it will be committed in a week. Thanks, Michal Stanek
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:54 UTC