Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jun 2012 23:24:29 -0400
From:      Garrett Wollman <wollman@bimajority.org>
To:        freebsd-acpi@freebsd.org
Subject:   IPMI attachment fails: vendor bug, or just unusual choice?
Message-ID:  <20453.14061.23653.52464@hergotha.csail.mit.edu>

next in thread | raw e-mail | index | archive | help
On my Quanta QSSC-S99Q, the IPMI driver has trouble using the ACPI
attachment.  It reports:

ipmi0: <IPMI System Interface> on acpi0
ipmi0: unknown resource type
device_attach: ipmi0 attach returned 6

It then goes on to find it the old-fashioned way as ipmi1, which
sometimes works and sometiems doesn't.  (Not worrying about that part
yet -- I think it's a timing issue.)

Looking at the code, it looks like this can only happen if there are
neither I/O port nor memory resources defined for this device.
However, there clearly is one in the AML:

        Device (MI0)
        {
            Name (_HID, EisaId ("IPI0001"))
            Method (_STA, 0, NotSerialized)
            {
                If (LEqual (OSN, Zero))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Name (_STR, Unicode ("IPMI_KCS"))
            Name (_UID, Zero)
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0CA2,             // Range Minimum
                    0x0CA3,             // Range Maximum
                    0x00,               // Alignment
                    0x02,               // Length
                    )
            })
            Method (_IFT, 0, NotSerialized)
            {
                Return (One)
            }

            Method (_SRV, 0, NotSerialized)
            {
                Return (0x0200)
            }
        }

Did the vendor screw this up by writing this as a port range?  Or is
this perfectly legitimate and just not implemented?

I will be trying the following when I am next in physical proximity to
one of these machines:

Index: dev/acpica/acpi_resource.c
===================================================================
--- dev/acpica/acpi_resource.c  (revision 237411)
+++ dev/acpica/acpi_resource.c  (working copy)
@@ -504,7 +504,29 @@
 
     if (cp == NULL)
        return;
-    device_printf(dev, "I/O range not supported\n");
+    /* HACK HACK HACK */
+    /*
+     * On my Quanta QSSC-S99Q, with the following DSDT, the IPMI interface
+     * shows up as a port range resource.  I think this is actually a bug
+     * in the vendor's ASL, but haven't verified this with ACPI experts.
+     *     Signature        "DSDT"
+     *     Length           0x00006122 (24866)
+     *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
+     *     Checksum         0x6A
+     *     OEM ID           "Z99_3"
+     *     OEM Table ID     "Z99_3A03"
+     *     OEM Revision     0x00000A03 (2563)
+     *     Compiler ID      "INTL"
+     *     Compiler Version 0x20051117 (537202967)
+     *
+     * If the port range contains exactly as many ports as the specified
+     * length, assume the vendor screwed it up and treat like a fixed
+     * port resource.
+     */
+    if (high == low + length - 1 && align == 0)
+       acpi_res_set_ioport(dev, context, low, length);
+    else
+       device_printf(dev, "I/O range not supported\n");
 }
 
 static void

-GAWollman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20453.14061.23653.52464>