Page MenuHomeFreeBSD

pci_user.c: Call bus_translate_resource before mmaping bars
ClosedPublic

Authored by mindal_semihalf.com on Apr 6 2021, 2:11 PM.

Details

Summary

On some armv8 machines there is no 1:1 mapping between cpu and pci bus BAR base addresses.
When a BAR is allocated in kernel using bus_alloc_resource_any this translation is handled in ofw_pci_activate_resource.
Do the same in pci_user.c by calling bus_translate_resource devmethod. This fixes mmaping BARs to userspace on armada7k and possibly many other platforms.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mindal_semihalf.com created this revision.
This revision is now accepted and ready to land.Apr 6 2021, 2:53 PM