[PATCH] Add support for 64-bit AHCI BAR.

Michał Stanek mst at semihalf.com
Thu Jan 8 16:09:32 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ahci_64bit_bar.patch
Type: text/x-patch
Size: 1487 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20150108/bb8dc2f3/attachment.bin>


More information about the freebsd-current mailing list