Support fixed size, variable location acpi resources
These have been found in some Arm ACPI tables generated by edk2, e.g. when describing the pl011 uart on the Arm AEMv8 model. Reviewed by: imp, jkim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31110
This commit is contained in:
@@ -421,6 +421,27 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
|
||||
(uintmax_t)min, (uintmax_t)length));
|
||||
set->set_ioport(dev, arc->context, min, length);
|
||||
}
|
||||
} else if (res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED &&
|
||||
res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED) {
|
||||
/* Fixed size, variable location resource descriptor */
|
||||
min = roundup(min, gran + 1);
|
||||
if ((min + length - 1) > max) {
|
||||
device_printf(dev,
|
||||
"invalid memory range: start: %jx end: %jx max: %jx\n",
|
||||
(uintmax_t)min, (uintmax_t)(min + length - 1),
|
||||
(uintmax_t)max);
|
||||
} else {
|
||||
if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
|
||||
"%s/Memory 0x%jx/%ju\n", name, (uintmax_t)min,
|
||||
(uintmax_t)length));
|
||||
set->set_memory(dev, arc->context, min, length);
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n",
|
||||
name, (uintmax_t)min, (uintmax_t)length));
|
||||
set->set_ioport(dev, arc->context, min, length);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
|
||||
|
||||
Reference in New Issue
Block a user