This fixes e.g. amdgpu operation on the NXP Layerscape LX2160A SoC (powering the SolidRun HoneyComb LX2K workstation) which has a Translation Offset in ACPI for below-4G PCI addresses.
See https://github.com/freebsd/drm-kmod/issues/84 for our long debugging session :)
tl;dr due to how Linux drivers are written, LinuxKPI requires raw physical memory addresses.
In D21096 / rS350570, a BUS_TRANSLATE_RESOURCE method was introduced to allow LinuxKPI to get physical addresses in pci_resource_start, this was done for PowerPC and implemented in ofw_pci.
When translation was implemented in pci_host_generic in r10:372c142b4fc almost a year later, this method was not implemented — instead a local static function was added for a similar purpose.
And that's why GPUs were mysteriously broken on the LX2K, instead of talking to the GPU's configuration register area, the driver was talking to something else and receiving all zeros.
BIKESHEDDING TIME: Obviously this first version of the patch is not beautiful. Having a second wrapper function that throws out the end is… meh :/
Would it be fine to just convert to the start-only API, and recalculate end in callers based on start and the size? (And if not, any suggestions on naming these, any other changes?)