Re: svn commit: r298372 - head/sys/dev/acpica

2016-04-20 Thread John Baldwin
On Wednesday, April 20, 2016 08:58:30 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 20 20:58:30 2016
> New Revision: 298372
> URL: https://svnweb.freebsd.org/changeset/base/298372
> 
> Log:
>   Invoke _OSC on Host-PCI bridges.
>   
>   Tell the firmware that we support PCI-express config space access
>   and MSI.

We should perhaps have some constants for some of the _OSC related fields.
I'm surprised ACPI-CA doesn't include constants for at least the return
values in the first word _OSC returns since that is defined by ACPI and
common to all the different _OSC variants.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r298372 - head/sys/dev/acpica

2016-04-20 Thread John Baldwin
Author: jhb
Date: Wed Apr 20 20:58:30 2016
New Revision: 298372
URL: https://svnweb.freebsd.org/changeset/base/298372

Log:
  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

Modified:
  head/sys/dev/acpica/acpi_pcib_acpi.c

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==
--- head/sys/dev/acpica/acpi_pcib_acpi.cWed Apr 20 20:56:06 2016
(r298371)
+++ head/sys/dev/acpica/acpi_pcib_acpi.cWed Apr 20 20:58:30 2016
(r298372)
@@ -295,6 +295,40 @@ first_decoded_bus(struct acpi_hpcib_soft
 }
 #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.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"