diff options
author | jhb <jhb@FreeBSD.org> | 2008-03-10 22:18:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-03-10 22:18:07 +0000 |
commit | 18300325cbb0d05941fff043af793858b4aef3dd (patch) | |
tree | 9434f84ce46229a380631770a44da3d379da5c99 /sys/dev/acpica | |
parent | e0c2a8245edf31dd9da5a9938c1ab8be11802de9 (diff) | |
download | FreeBSD-src-18300325cbb0d05941fff043af793858b4aef3dd.zip FreeBSD-src-18300325cbb0d05941fff043af793858b4aef3dd.tar.gz |
Probe CPUs after the PCI hierarchy on i386, amd64, and ia64. This allows
the cpufreq drivers to reliably use properties of PCI devices for quirks,
etc.
- For the legacy drivers, add CPU devices via an identify routine in the
CPU driver itself rather than in the legacy driver's attach routine.
- Add CPU devices after Host-PCI bridges in the acpi bus driver.
- Change the ichss(4) driver to use pci_find_bsf() to locate the ICH and
check its device ID rather than having a bogus PCI attachment that only
checked for the ID in probe and always failed. As a side effect, you
can now kldload ichss after boot.
- Fix the ichss(4) driver to use the correct device_t for the ICH (and not
for ichss0) when doing PCI config space operations to enable SpeedStep.
MFC after: 2 weeks
Reviewed by: njl, Andriy Gapon avg of icyb.net.ua
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index dba4edd..44a9012 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1533,18 +1533,31 @@ acpi_probe_children(device_t bus) static int acpi_probe_order(ACPI_HANDLE handle, int *order) { + ACPI_OBJECT_TYPE type; + u_int addr; /* * 1. I/O port and memory system resource holders * 2. Embedded controllers (to handle early accesses) * 3. PCI Link Devices + * 11 - 266. Host-PCI bridges sorted by _ADR + * 280. CPUs */ + AcpiGetType(handle, &type); if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) *order = 1; else if (acpi_MatchHid(handle, "PNP0C09")) *order = 2; else if (acpi_MatchHid(handle, "PNP0C0F")) *order = 3; + else if (acpi_MatchHid(handle, "PNP0A03")) { + if (ACPI_SUCCESS(acpi_GetInteger(handle, "_ADR", &addr))) + *order = 11 + ACPI_ADR_PCI_SLOT(addr) * (PCI_FUNCMAX + 1) + + ACPI_ADR_PCI_FUNC(addr); + else + *order = 11; + } else if (type == ACPI_TYPE_PROCESSOR) + *order = 280; return (0); } @@ -1591,14 +1604,17 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) break; /* - * Create a placeholder device for this node. Sort the placeholder - * so that the probe/attach passes will run breadth-first. Orders - * less than ACPI_DEV_BASE_ORDER are reserved for special objects - * (i.e., system resources). Larger values are used for all other - * devices. + * Create a placeholder device for this node. Sort the + * placeholder so that the probe/attach passes will run + * breadth-first. Orders less than ACPI_DEV_BASE_ORDER + * are reserved for special objects (i.e., system + * resources). Orders between ACPI_DEV_BASE_ORDER and 300 + * are used for Host-PCI bridges (and effectively all + * their children) and CPUs. Larger values are used for + * all other devices. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); - order = (level + 1) * ACPI_DEV_BASE_ORDER; + order = level * 10 + 300; acpi_probe_order(handle, &order); child = BUS_ADD_CHILD(bus, order, NULL, -1); if (child == NULL) |