HomeFreeBSD

pci_host_generic: implement bus_translate_resource (for LinuxKPI)

Description

pci_host_generic: implement bus_translate_resource (for LinuxKPI)

In D21096 BUS_TRANSLATE_RESOURCE was introduced to allow LinuxKPI to get
physical addresses in pci_resource_start for PowerPC and implemented
in ofw_pci.
When the translation was implemented in pci_host_generic in 372c142b4fc,
this method was not implemented; instead a local static function was
added for a similar purpose.
Rename the static function to "_common" and implement the bus function
as a wrapper around that. With this a LinuxKPI driver using
physical addresses correctly finds the configuration registers of
the GPU.
This unbreaks amdgpu on NXP Layerscape LX2160A SoC (SolidRun HoneyComb
LX2K workstation) which has a Translation Offset in ACPI for
below-4G PCI addresses.

More info: https://github.com/freebsd/drm-kmod/issues/84
Tested by: dan.kotowski_a9development.com
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30986

Details

Provenance
val_packett.coolAuthored on Sep 20 2021, 8:05 PM
bzCommitted on Sep 27 2021, 5:19 PM
Reviewer
hselasky
Differential Revision
D30986: pci_host_generic: implement bus_translate_resource (for LinuxKPI)
Parents
rGb1e2f063ae91: amd64 sendsig: fix context corruption
Branches
Unknown
Tags
Unknown