From: Corey Minyard <minyard@acm.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: Corey Minyard <cminyard@mvista.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 14/15] acpi: Add hooks for adding things to the SSDT table
Date: Mon, 13 Apr 2015 11:00:53 -0500 [thread overview]
Message-ID: <552BE835.4080609@acm.org> (raw)
In-Reply-To: <552BC857.3040300@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
On 04/13/2015 08:44 AM, Paolo Bonzini wrote:
>
> On 13/04/2015 03:30, Corey Minyard wrote:
>>> Hmm, I don't see patch 15/15 so I don't know how this is used.
>> Yeah, I resent and I don't know what's happened. All the others were
>> sent exactly the same way. Something doesn't like that patch.
> Can you send that privately? Or put it somewhere on the web.
Ok, attaching it. Hopefully it goes through this way.
-corey
[-- Attachment #2: 0015-ipmi-Add-ACPI-table-entries-for-BMCs.patch --]
[-- Type: text/x-patch, Size: 3566 bytes --]
>From f2d3d72d517596385381ad565405cbaddee1d787 Mon Sep 17 00:00:00 2001
From: Corey Minyard <cminyard@mvista.com>
Date: Thu, 23 May 2013 16:58:30 -0500
Subject: [PATCH 15/22] ipmi: Add ACPI table entries for BMCs
Use the new ACPI table construction tools to create an ACPI
entry for IPMI.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
hw/ipmi/isa_ipmi.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/hw/ipmi/isa_ipmi.c b/hw/ipmi/isa_ipmi.c
index ff379ce..a14cb37 100644
--- a/hw/ipmi/isa_ipmi.c
+++ b/hw/ipmi/isa_ipmi.c
@@ -23,6 +23,9 @@
*/
#include "hw/hw.h"
#include "hw/isa/isa.h"
+#include "hw/acpi/aml-build.h"
+#include "hw/acpi/acpi.h"
+#include "hw/acpi/acpi-hooks.h"
#include "hw/i386/pc.h"
#include "qemu/timer.h"
#include "sysemu/char.h"
@@ -39,6 +42,8 @@ typedef struct ISAIPMIDevice {
char *interface;
int intftype;
uint32_t iobase;
+ uint32_t iolength;
+ uint8_t regspacing;
int32 isairq;
uint8_t slave_addr;
uint8_t version;
@@ -83,6 +88,55 @@ static void ipmi_encode_smbios(void *opaque)
}
#endif
+#ifdef CONFIG_ACPI
+static Aml *aml_ipmi_crs(ISAIPMIDevice *info)
+{
+ Aml *crs = aml_resource_template();
+ uint8_t regspacing = info->regspacing;
+
+ if (regspacing == 1) {
+ regspacing = 0;
+ }
+
+ aml_append(crs, aml_io(aml_decode16, info->iobase,
+ info->iobase + info->iolength - 1,
+ regspacing, info->iolength));
+ if (info->isairq) {
+ aml_append(crs, aml_irq_no_flags(info->isairq));
+ }
+
+ return crs;
+}
+
+static void
+ipmi_encode_acpi(Aml *ssdt, void *opaque)
+{
+ ISAIPMIDevice *info = opaque;
+ char *name;
+ Aml *scope = aml_scope("\\_SB.PCI0.ISA");
+ Aml *dev = aml_device("MI0");
+ Aml *method;
+ int version = ((info->version & 0xf0) << 4) | (info->version & 0x0f);
+
+ name = g_strdup_printf("ipmi_%s", info->interface);
+
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("IPI0001")));
+ aml_append(dev, aml_name_decl("_STR", aml_string("%s", name)));
+ aml_append(dev, aml_name_decl("_UID", aml_int(0)));
+ aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info)));
+ method = aml_method("_IFT", 0);
+ aml_append(method, aml_return(aml_int(info->intftype)));
+ aml_append(dev, method);
+ method = aml_method("_SRV", 0);
+ aml_append(method, aml_return(aml_int(version)));
+ aml_append(dev, method);
+
+ aml_append(scope, dev);
+
+ aml_append(ssdt, scope);
+}
+#endif
+
static void ipmi_isa_realizefn(DeviceState *dev, Error **errp)
{
ISADevice *isadev = ISA_DEVICE(dev);
@@ -112,6 +166,7 @@ static void ipmi_isa_realizefn(DeviceState *dev, Error **errp)
intfk = IPMI_INTERFACE_GET_CLASS(intf);
bmc->intf = intf;
intf->bmc = bmc;
+ ipmi->regspacing = 1;
intf->io_base = ipmi->iobase;
intf->slave_addr = ipmi->slave_addr;
ipmi->intftype = intfk->smbios_type;
@@ -120,6 +175,7 @@ static void ipmi_isa_realizefn(DeviceState *dev, Error **errp)
if (*errp) {
return;
}
+ ipmi->iolength = intf->io_length;
ipmi_bmc_init(bmc, errp);
if (*errp) {
return;
@@ -150,6 +206,9 @@ static void ipmi_isa_realizefn(DeviceState *dev, Error **errp)
#ifdef TARGET_I386
smbios_register_device_table_handler(ipmi_encode_smbios, ipmi);
#endif
+#ifdef CONFIG_ACPI
+ add_device_ssdt_encoder(ipmi_encode_acpi, ipmi);
+#endif
}
static void ipmi_isa_reset(DeviceState *qdev)
--
1.8.3.1
next prev parent reply other threads:[~2015-04-13 16:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 19:51 [Qemu-devel] [PATCH 00/15] IPMI device for qemu minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 01/15] Add a base IPMI interface minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 02/15] ipmi: Add a PC ISA type structure minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 03/15] ipmi: Add a KCS low-level interface minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 04/15] ipmi: Add a BT " minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 05/15] ipmi: Add a local BMC simulation minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 06/15] ipmi: Add an external connection simulation interface minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 07/15] ipmi: Add tests minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 08/15] ipmi: Add documentation minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 09/15] ipmi: Add migration capability to the IPMI device minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 10/15] smbios: Add a function to directly add an entry minyard
2015-04-12 16:05 ` Michael S. Tsirkin
2015-04-13 1:26 ` Corey Minyard
2015-04-13 7:00 ` Michael S. Tsirkin
2015-04-13 16:34 ` Corey Minyard
2015-04-13 16:40 ` Paolo Bonzini
2015-04-14 6:31 ` Michael S. Tsirkin
2015-04-14 15:30 ` Corey Minyard
2015-04-14 16:31 ` Paolo Bonzini
2015-04-14 6:41 ` Michael S. Tsirkin
2015-04-07 19:51 ` [Qemu-devel] [PATCH 11/15] pc: Postpone SMBIOS table installation to post machine init minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 12/15] ipmi: Add SMBIOS table entry minyard
2015-04-07 19:51 ` [Qemu-devel] [PATCH 13/15] configure: Copy some items from default configs to target configs minyard
2015-04-10 11:47 ` Paolo Bonzini
2015-04-07 19:51 ` [Qemu-devel] [PATCH 14/15] acpi: Add hooks for adding things to the SSDT table minyard
2015-04-10 11:29 ` Paolo Bonzini
2015-04-12 16:17 ` Michael S. Tsirkin
2015-04-13 1:30 ` Corey Minyard
2015-04-13 6:36 ` Michael S. Tsirkin
2015-04-13 8:39 ` Paolo Bonzini
2015-04-13 11:32 ` Michael S. Tsirkin
2015-04-13 13:47 ` Paolo Bonzini
2015-04-13 13:44 ` Paolo Bonzini
2015-04-13 16:00 ` Corey Minyard [this message]
2015-04-13 16:41 ` Paolo Bonzini
2015-04-10 11:48 ` [Qemu-devel] [PATCH 00/15] IPMI device for qemu Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552BE835.4080609@acm.org \
--to=minyard@acm.org \
--cc=cminyard@mvista.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).