mirror of
https://github.com/opnsense/src.git
synced 2026-07-15 20:13:02 -04:00
pci_host_generic:Add pcib_request_feature on ACPI
In the ACPI attachment add support for the pcib_request_feature method. This uses the common _OSC handling. Reviewed by: imp, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48048
This commit is contained in:
parent
deb36d0c65
commit
1f5c50a861
2 changed files with 28 additions and 0 deletions
|
|
@ -287,6 +287,8 @@ pci_host_generic_acpi_init(device_t dev)
|
|||
sc = device_get_softc(dev);
|
||||
handle = acpi_get_handle(dev);
|
||||
|
||||
acpi_pcib_osc(dev, &sc->osc_ctl, 0);
|
||||
|
||||
/* Get Start bus number for the PCI host bus is from _BBN method */
|
||||
status = acpi_GetInteger(handle, "_BBN", &sc->base.bus_start);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
|
@ -504,6 +506,30 @@ generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type,
|
|||
return (pcib_get_id(pci, child, type, id));
|
||||
}
|
||||
|
||||
static int
|
||||
generic_pcie_acpi_request_feature(device_t pcib, device_t dev,
|
||||
enum pci_feature feature)
|
||||
{
|
||||
struct generic_pcie_acpi_softc *sc;
|
||||
uint32_t osc_ctl;
|
||||
|
||||
sc = device_get_softc(pcib);
|
||||
|
||||
switch (feature) {
|
||||
case PCI_FEATURE_HP:
|
||||
osc_ctl = PCIM_OSC_CTL_PCIE_HP;
|
||||
break;
|
||||
case PCI_FEATURE_AER:
|
||||
osc_ctl = PCIM_OSC_CTL_PCIE_AER;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (acpi_pcib_osc(pcib, &sc->osc_ctl, osc_ctl));
|
||||
}
|
||||
|
||||
|
||||
static device_method_t generic_pcie_acpi_methods[] = {
|
||||
DEVMETHOD(device_probe, generic_pcie_acpi_probe),
|
||||
DEVMETHOD(device_attach, pci_host_generic_acpi_attach),
|
||||
|
|
@ -517,6 +543,7 @@ static device_method_t generic_pcie_acpi_methods[] = {
|
|||
DEVMETHOD(pcib_release_msix, generic_pcie_acpi_release_msix),
|
||||
DEVMETHOD(pcib_map_msi, generic_pcie_acpi_map_msi),
|
||||
DEVMETHOD(pcib_get_id, generic_pcie_acpi_get_id),
|
||||
DEVMETHOD(pcib_request_feature, generic_pcie_acpi_request_feature),
|
||||
|
||||
DEVMETHOD_END
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
struct generic_pcie_acpi_softc {
|
||||
struct generic_pcie_core_softc base;
|
||||
int segment;
|
||||
uint32_t osc_ctl;
|
||||
ACPI_BUFFER ap_prt; /* interrupt routing table */
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue