Invoke _OSC on Host-PCI bridges.

Tell the firmware that we support PCI-express config space access
and MSI.

Reviewed by:	jkim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6023
This commit is contained in:
John Baldwin 2016-04-20 20:58:30 +00:00
parent c1eac826c2
commit 508c21b669
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298372

View File

@ -295,6 +295,40 @@ first_decoded_bus(struct acpi_hpcib_softc *sc, rman_res_t *startp)
}
#endif
static void
acpi_pcib_osc(struct acpi_hpcib_softc *sc)
{
ACPI_STATUS status;
uint32_t cap_set[3];
static uint8_t pci_host_bridge_uuid[ACPI_UUID_LENGTH] = {
0x5b, 0x4d, 0xdb, 0x33, 0xf7, 0x1f, 0x1c, 0x40,
0x96, 0x57, 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66
};
/* Support Field: Extended PCI Config Space, MSI */
cap_set[1] = 0x11;
/* Control Field */
cap_set[2] = 0;
status = acpi_EvaluateOSC(sc->ap_handle, pci_host_bridge_uuid, 1,
nitems(cap_set), cap_set, false);
if (ACPI_FAILURE(status)) {
if (status == AE_NOT_FOUND)
return;
device_printf(sc->ap_dev, "_OSC failed: %s\n",
AcpiFormatException(status));
return;
}
if (cap_set[0] != 0) {
device_printf(sc->ap_dev, "_OSC returned error %#x\n",
cap_set[0]);
return;
}
}
static int
acpi_pcib_acpi_attach(device_t dev)
{
@ -321,6 +355,8 @@ acpi_pcib_acpi_attach(device_t dev)
if (!acpi_DeviceIsPresent(dev))
return (ENXIO);
acpi_pcib_osc(sc);
/*
* Get our segment number by evaluating _SEG.
* It's OK for this to not exist.