Commit e446ed5a authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/cminyard/tags/ipmi-for-release-2019-09-20' into staging



ipmi: Some bug fixes and new interfaces

Some bug fixes for the watchdog and hopeful the BT tests.

Change the IPMI UUID handling to give the user the ability to set it or
not have it.

Add a PCI interface.

Add an SMBus interfaces.

-corey

# gpg: Signature made Fri 20 Sep 2019 20:11:21 BST
# gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
# gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
# gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81

* remotes/cminyard/tags/ipmi-for-release-2019-09-20:
  pc: Add an SMB0 ACPI device to q35
  ipmi: Fix SSIF ACPI handling to use the right CRS
  acpi: Add i2c serial bus CRS handling
  ipmi: Add an SMBus IPMI interface
  ipmi: Add PCI IPMI interfaces
  smbios:ipmi: Ignore IPMI devices with no fwinfo function
  ipmi: Allow a size value to be passed for I/O space
  ipmi: Split out BT-specific code from ISA BT code
  ipmi: Split out KCS-specific code from ISA KCS code
  ipmi: Add a UUID device property
  qdev: Add a no default uuid property
  tests:ipmi: Fix IPMI BT tests
  ipmi: Generate an interrupt on watchdog pretimeout expiry
  ipmi: Fix the get watchdog command
  ipmi: Fix watchdog NMI handling

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 4300b7c2 ebe15582
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@
#CONFIG_ISA_DEBUG=n
#CONFIG_ISA_IPMI_BT=n
#CONFIG_ISA_IPMI_KCS=n
#CONFIG_PCI_IPMI_KCS=n
#CONFIG_PCI_IPMI_BT=n
#CONFIG_IPMI_SSIF=n
#CONFIG_PCI_DEVICES=n
#CONFIG_PVPANIC=n
#CONFIG_QXL=n
+40 −0
Original line number Diff line number Diff line
@@ -1874,3 +1874,43 @@ build_hdr:
    build_header(linker, tbl, (void *)(tbl->data + fadt_start),
                 "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_id);
}

/* ACPI 5.0: 6.4.3.8.2 Serial Bus Connection Descriptors */
static Aml *aml_serial_bus_device(uint8_t serial_bus_type, uint8_t flags,
                                  uint16_t type_flags,
                                  uint8_t revid, uint16_t data_length,
                                  uint16_t resource_source_len)
{
    Aml *var = aml_alloc();
    uint16_t length = data_length + resource_source_len + 9;

    build_append_byte(var->buf, 0x8e); /* Serial Bus Connection Descriptor */
    build_append_int_noprefix(var->buf, length, sizeof(length));
    build_append_byte(var->buf, 1);    /* Revision ID */
    build_append_byte(var->buf, 0);    /* Resource Source Index */
    build_append_byte(var->buf, serial_bus_type); /* Serial Bus Type */
    build_append_byte(var->buf, flags); /* General Flags */
    build_append_int_noprefix(var->buf, type_flags, /* Type Specific Flags */
                              sizeof(type_flags));
    build_append_byte(var->buf, revid); /* Type Specification Revision ID */
    build_append_int_noprefix(var->buf, data_length, sizeof(data_length));

    return var;
}

/* ACPI 5.0: 6.4.3.8.2.1 I2C Serial Bus Connection Resource Descriptor */
Aml *aml_i2c_serial_bus_device(uint16_t address, const char *resource_source)
{
    uint16_t resource_source_len = strlen(resource_source) + 1;
    Aml *var = aml_serial_bus_device(AML_SERIAL_BUS_TYPE_I2C, 0, 0, 1,
                                     6, resource_source_len);

    /* Connection Speed.  Just set to 100K for now, it doesn't really matter. */
    build_append_int_noprefix(var->buf, 100000, 4);
    build_append_int_noprefix(var->buf, address, sizeof(address));

    /* This is a string, not a name, so just copy it directly in. */
    g_array_append_vals(var->buf, resource_source, resource_source_len);

    return var;
}
+1 −1
Original line number Diff line number Diff line
@@ -10,6 +10,6 @@
#include "qemu/osdep.h"
#include "hw/acpi/ipmi.h"

void build_acpi_ipmi_devices(Aml *table, BusState *bus)
void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource)
{
}
+7 −6
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#include "hw/acpi/acpi.h"
#include "hw/acpi/ipmi.h"

static Aml *aml_ipmi_crs(IPMIFwInfo *info)
static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char *resource)
{
    Aml *crs = aml_resource_template();

@@ -48,7 +48,8 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info)
                            info->register_spacing, info->register_length));
        break;
    case IPMI_MEMSPACE_SMBUS:
        aml_append(crs, aml_return(aml_int(info->base_address)));
        aml_append(crs, aml_i2c_serial_bus_device(info->base_address,
                                                  resource));
        break;
    default:
        abort();
@@ -61,7 +62,7 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info)
    return crs;
}

static Aml *aml_ipmi_device(IPMIFwInfo *info)
static Aml *aml_ipmi_device(IPMIFwInfo *info, const char *resource)
{
    Aml *dev;
    uint16_t version = ((info->ipmi_spec_major_revision << 8)
@@ -74,14 +75,14 @@ static Aml *aml_ipmi_device(IPMIFwInfo *info)
    aml_append(dev, aml_name_decl("_STR", aml_string("ipmi_%s",
                                                     info->interface_name)));
    aml_append(dev, aml_name_decl("_UID", aml_int(info->uuid)));
    aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info)));
    aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info, resource)));
    aml_append(dev, aml_name_decl("_IFT", aml_int(info->interface_type)));
    aml_append(dev, aml_name_decl("_SRV", aml_int(version)));

    return dev;
}

void build_acpi_ipmi_devices(Aml *scope, BusState *bus)
void build_acpi_ipmi_devices(Aml *scope, BusState *bus, const char *resource)
{

    BusChild *kid;
@@ -101,6 +102,6 @@ void build_acpi_ipmi_devices(Aml *scope, BusState *bus)
        iic = IPMI_INTERFACE_GET_CLASS(obj);
        memset(&info, 0, sizeof(info));
        iic->get_fwinfo(ii, &info);
        aml_append(scope, aml_ipmi_device(&info));
        aml_append(scope, aml_ipmi_device(&info, resource));
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ config PC
    imply HYPERV
    imply ISA_IPMI_KCS
    imply ISA_IPMI_BT
    imply PCI_IPMI_KCS
    imply PCI_IPMI_BT
    imply IPMI_SSIF
    imply ISA_DEBUG
    imply PARALLEL
    imply PCI_DEVICES
Loading