Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi.c
Show First 20 Lines • Show All 2,079 Lines • ▼ Show 20 Lines | case ACPI_TYPE_POWER: | ||||
*/ | */ | ||||
if (ACPI_SUCCESS(AcpiGetHandle(handle, "_DCK", &h))) | if (ACPI_SUCCESS(AcpiGetHandle(handle, "_DCK", &h))) | ||||
break; | break; | ||||
device_disable(child); | device_disable(child); | ||||
break; | break; | ||||
} | } | ||||
/* | |||||
* Get the device's resource settings and attach them. | |||||
* Note that if the device has _PRS but no _CRS, we need | |||||
* to decide when it's appropriate to try to configure the | |||||
* device. Ignore the return value here; it's OK for the | |||||
* device not to have any resources. | |||||
*/ | |||||
acpi_parse_resources(child, handle, &acpi_res_parse_set, NULL); | |||||
ad = device_get_ivars(child); | ad = device_get_ivars(child); | ||||
ad->ad_cls_class = 0xffffff; | ad->ad_cls_class = 0xffffff; | ||||
if (ACPI_SUCCESS(AcpiGetObjectInfo(handle, &devinfo))) { | if (ACPI_SUCCESS(AcpiGetObjectInfo(handle, &devinfo))) { | ||||
if ((devinfo->Valid & ACPI_VALID_CLS) != 0 && | if ((devinfo->Valid & ACPI_VALID_CLS) != 0 && | ||||
devinfo->ClassCode.Length >= ACPI_PCICLS_STRING_SIZE) { | devinfo->ClassCode.Length >= ACPI_PCICLS_STRING_SIZE) { | ||||
ad->ad_cls_class = strtoul(devinfo->ClassCode.String, | ad->ad_cls_class = strtoul(devinfo->ClassCode.String, | ||||
NULL, 16); | NULL, 16); | ||||
} | } | ||||
#ifdef __aarch64__ | #ifdef __aarch64__ | ||||
jhb: It is still not clear to me why this code is here rather than in the attach routine of the… | |||||
Not Done Inline ActionsI haven't written this code, but pci_host_generic (for fdt and acpi) depends on resource which is set by this code. I think one wanted to keep it symetric with fdt. I think it is possible to move it to attach routine. pdk_semihalf.com: I haven't written this code, but `pci_host_generic` (for fdt and acpi) depends on resource… | |||||
Not Done Inline ActionsI've checked and it can't be moved to attach routine because in attach we can't edit our resources. pdk_semihalf.com: I've checked and it can't be moved to attach routine because in attach we can't edit our… | |||||
if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { | if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { | ||||
if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { | if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { | ||||
acpi_enable_pcie(child, segment); | acpi_enable_pcie(child, segment); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
AcpiOsFree(devinfo); | AcpiOsFree(devinfo); | ||||
} | } | ||||
/* | |||||
Not Done Inline ActionsWhy is this moved? jhb: Why is this moved? | |||||
Not Done Inline ActionsBecause acpi_enable_pcie always overwrite first resource (rid 0), so if we call acpi_parse_resources earlier we lose 1 resource. pdk_semihalf.com: Because `acpi_enable_pcie` always overwrite first resource (rid 0), so if we call… | |||||
* Get the device's resource settings and attach them. | |||||
* Note that if the device has _PRS but no _CRS, we need | |||||
* to decide when it's appropriate to try to configure the | |||||
* device. Ignore the return value here; it's OK for the | |||||
* device not to have any resources. | |||||
*/ | |||||
acpi_parse_resources(child, handle, &acpi_res_parse_set, NULL); | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return_ACPI_STATUS (AE_OK); | return_ACPI_STATUS (AE_OK); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 2,065 Lines • Show Last 20 Lines |
It is still not clear to me why this code is here rather than in the attach routine of the relevant bridge driver.