ACPICA missing support for device I/O port ranges
Harald Böhm
harald.boehm at fau.de
Sat Nov 18 17:53:11 UTC 2017
Hi all,
I've been working on a device driver lately and was having trouble
allocating its resources using bus_alloc_resource_any(), although its
I/O ports can be read from its _CRS.
This is the output of acpidump -td:
Device (GMUX)
{
...
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0700, // Range Minimum
0x07FF, // Range Maximum
0x01, // Alignment
0xFF, // Length
)
})
...
}
After digging into the code in /sys/dev/acpica/acpi_resources.c I was
able to find the problem. The function acpi_res_set_iorange(), which
seems to be responsible for calling bus_set_resource() is just a
function stub that prints a message that I/O ranges are not supported.
static void
acpi_res_set_iorange(device_t dev, void *context, uint64_t low,
uint64_t high, uint64_t length, uint64_t align)
{
struct acpi_res_context *cp = (struct acpi_res_context *)context;
if (cp == NULL)
return;
device_printf(dev, "I/O range not supported\n");
}
After adding a call to bus_set_resource() to that function, I was able
to allocate the device's resources.
Does anyone know, why the function has not been implemented or why I/O
ranges are not supported?
Thanks,
Harald
More information about the freebsd-hackers
mailing list