Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Nov 2017 18:52:54 +0100
From:      =?UTF-8?Q?Harald_B=c3=b6hm?= <harald.boehm@fau.de>
To:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@freebsd.org>
Subject:   ACPICA missing support for device I/O port ranges
Message-ID:  <e8699d73-f38b-3825-67ef-8d8f973e4ce0@fau.de>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e8699d73-f38b-3825-67ef-8d8f973e4ce0>