problem attaching driver at LPC bus

karu.pruun karu.pruun at gmail.com
Mon Aug 22 13:51:05 UTC 2016


Hello

I am trying to write a small driver for a device (gmux) attached to the LPC
bus, but am stuck with allocation of I/O ports. The device shows as
follows:

---
devinfo -rv | grep GMUX:

unknown pnpinfo _HID=APP000B _UID=0 at handle=\_SB_.PCI0.LPCB.GMUX
---

I took cue from sys/dev/acpica/acpi_ec.c. Probing works fine with
ACPI_ID_PROBE in analogy to acpi_ec.c:

--- ---
sys/dev/acpica/acpi_ec.c:
---

acpi_ec_probe(. . .)
{
    . . .

    ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)

    . . .
}
--- ---

Then attach() calls bus_alloc_resource():

--- ---
sys/dev/acpica/acpi_ec.c:
---

acpi_ec_attach(. . .)
{
    struct resource *res;
    . . .

    res = bus_alloc_resource_any(sc->ec_dev, SYS_RES_IOPORT,
&sc->ec_data_rid, RF_ACTIVE);

    . . .
}
--- ---

But this fails for my driver, res is always NULL. I looked up acpi tables
(acpidump -td), the IO resources for GMUX are there:

--- ---
    Scope (\_SB.PCI0.LPCB)
    {
        Device (GMUX)
        {
            Name (_HID, EisaId ("APP000B"))  // _HID: Hardware ID
            Name (_CID, "gmux")  // _CID: Compatible ID
            Name (_STA, 0x0B)  // _STA: Status
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource
Settings
            {
                IO (Decode16,
                    0x0700,             // Range Minimum
                    0x07FF,             // Range Maximum
                    0x01,               // Alignment
                    0xFF,               // Length
                    )
            })
--- ---

Could someone explain where I have gone wrong?

Thank you

Peeter

--


More information about the freebsd-hackers mailing list