IPMI driver on Ampere?

From: John F Carr <jfc_at_mit.edu>
Date: Wed, 06 Sep 2023 14:16:28 UTC
My Ampere server has the usual ASPEED server management chip but the IPMI
kernel module does not load.  Does anybody know what is required to get it working?

The ACPI part of the driver, ipmi_acpi.c, looks for an ACPI device named "IPI0001".
If I run acpidump -dt I find one of those, but the kernel doesn't find it.

The PCI part of the driver, ipmi_pci.c, looks for the vendor:device pair 1028:000d.
I do not have that.  I have 1a03:1150 (ASPEED PCI-PCI bridge) and
1a03:2000 (ASPEED VGA).

Here is the relevant fragment of acpidump -dt from my Ampere eMAG:

        Device (I2C4)
        {
            Name (_HID, "APMC0D0F")  // _HID: Hardware ID
            Name (_UID, 0x04)  // _UID: Unique ID
            Name (_STR, Unicode ("eMAG I2C Device"))  // _STR: Description String

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x126B0000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000069,
                }
            })
            Device (IPI)
            {
                Name (_HID, "APMC0D8A")  // _HID: Hardware ID
                Name (_CID, "IPI0001")  // _CID: Compatible ID
                Name (_STR, Unicode ("IPMI_SSIF"))  // _STR: Description String
                Name (_UID, Zero)  // _UID: Unique ID
                Name (_CCA, One)  // _CCA: Cache Coherency Attribute
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_IFT, 0, NotSerialized)  // _IFT: IPMI Interface Type
                {
                    Return (0x04)
                }

                Method (_ADR, 0, NotSerialized)  // _ADR: Address
                {
                    Return (0x10)
                }

                Method (_SRV, 0, NotSerialized)  // _SRV: IPMI Spec Revision
                {
                    Return (0x0200)
                }

                Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                {
                    I2cSerialBusV2 (0x0010, ControllerInitiated, 0x00061A80,
                        AddressingMode7Bit, "\\_SB.I2C4",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                })
            }
            [...]
        }

Here is the fragment from an HPE amd64 server where the driver works:

            Device (LPC0)
            {
                Name (_ADR, 0x00140003)  // _ADR: Address
                OperationRegion (PMIO, SystemIO, 0x0CD6, 0x02)
                [...]
                Device (KCS)
                {
                    Name (_HID, EisaId ("IPI0001"))  // _HID: Hardware ID
                    Name (_STR, Unicode ("IPMI_KCS"))  // _STR: Description String
                    Name (_UID, 0x00)  // _UID: Unique ID
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0CA2,             // Range Minimum
                            0x0CA2,             // Range Maximum
                            0x00,               // Alignment
                            0x02,               // Length
                            )
                    })
                    Method (_IFT, 0, NotSerialized)  // _IFT: IPMI Interface Type
                    {
                        Return (0x01)
                    }

                    Method (_SRV, 0, NotSerialized)  // _SRV: IPMI Spec Revision
                    {
                        Return (0x0200)
                    }
                }
            }

The obvious difference is the HPE system uses old-fashioned I/O ports and the
Ampere system uses I2C.  The parent I2C bus is recognized:

ig4iic0: <Designware I2C Controller> iomem 0x126b0000-0x126b0fff irq 0 on acpi0
iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0
iicbus0: <unknown card> at addr 0x10
iic0: <I2C generic I/O> on iicbus0