From patchwork Wed Jun 1 16:26:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 69049 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp196183qge; Wed, 1 Jun 2016 09:42:50 -0700 (PDT) X-Received: by 10.140.246.68 with SMTP id r65mr38532630qhc.80.1464799369686; Wed, 01 Jun 2016 09:42:49 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l55si35409880qta.73.2016.06.01.09.42.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 01 Jun 2016 09:42:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:43121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b89EH-0000Yb-70 for patch@linaro.org; Wed, 01 Jun 2016 12:42:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b88zG-0005SJ-9J for qemu-devel@nongnu.org; Wed, 01 Jun 2016 12:27:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b88z9-00058d-3a for qemu-devel@nongnu.org; Wed, 01 Jun 2016 12:27:17 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b88z8-00058Q-Pl for qemu-devel@nongnu.org; Wed, 01 Jun 2016 12:27:11 -0400 Received: by mail-pf0-x244.google.com with SMTP id 62so4443060pfd.3 for ; Wed, 01 Jun 2016 09:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=J9pXDvCB9VIDheP/OtPrmKGoFsIOi1UIVvR3mK6hpDc=; b=SILP5qE+5bbAQdFSnlFBWOeVQo9J6dIMwpA5cG9EZHnUaWRmDbaYaNG9HsdzUhG5WB gyr6IF3c0C0sXUdHUC2R1j0WsJYxOfWmwM4yCNJvcB8VGa4sRvTga3pf3jio82n9LJlC o88SxAzeGFjFZiVVh55hcqOkVM1HuEWcLmaeGbLxD3AEfsUazDzvawO9DOp6My/chaP9 qyotOwj+M8Iliwkz+fm0f+5IP65vXTSvUjmguNdnePYH3oOiinlVaiNAZoF0yMDPgel7 +D/7SdNuzxo+4+sAJIYmss30uylFM8daIQl7mTopzTuJH/cS7AwYtCjfyTjg3+WS/20m 4AhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=J9pXDvCB9VIDheP/OtPrmKGoFsIOi1UIVvR3mK6hpDc=; b=gtqatzcmDV2oX/2tMTykAvs00gXsZZyON+r9fDbBHT/7wyMCGexD7MNHJeZl8Aho+d kdHNeh/QlOXFAK/ceq1pbNUY886UR+OaXJDFq0axDr9vN5i4f8QSWF9K8Z0MQGsrK/t7 QRLTyL43zog7mOMhZDP8rNsoS3LmBfD9viWRqSrdG9qVPyat81zQQS5cslb+I5vgXkmV ui2qjpMunCEpG4IzYaqR7L5NabCK0P9mWOh48yaKDebJrCuH8SqgTx9CqrK6M+oMpcC1 Q+uWa95qVw2oAhUpc0judB6V57bEpI+/ZoQ2IO6kCORHltJpdn4AJyqtePcG1LnWHNwk BE8A== X-Gm-Message-State: ALyK8tLtoZxgKTMERirl9RxBbmwQTjkNfxVNIA7LXYxFrJN4Sh1OUvv9/UMbGPrQHN5zlQ== X-Received: by 10.98.157.89 with SMTP id i86mr10126008pfd.121.1464798430079; Wed, 01 Jun 2016 09:27:10 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id w23sm49312898pfa.38.2016.06.01.09.27.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 09:27:09 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 92D181CAA; Wed, 1 Jun 2016 11:27:05 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 6615E300528; Wed, 1 Jun 2016 11:27:03 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org, minyard@acm.org, cminyard@mvista.com Date: Wed, 1 Jun 2016 11:26:58 -0500 Message-Id: <1464798420-12018-6-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464798420-12018-1-git-send-email-minyard@acm.org> References: <1464798420-12018-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v2 5/7] ipmi: Fix SSIF ACPI handling to use the right CRS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Corey Minyard Signed-off-by: Corey Minyard --- hw/acpi/ipmi.c | 13 +++++++------ hw/acpi/noipmi.c | 2 +- hw/i386/acpi-build.c | 2 +- include/hw/acpi/ipmi.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/hw/acpi/ipmi.c b/hw/acpi/ipmi.c index 7e74ce4..628130a 100644 --- a/hw/acpi/ipmi.c +++ b/hw/acpi/ipmi.c @@ -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; @@ -100,6 +101,6 @@ void build_acpi_ipmi_devices(Aml *scope, BusState *bus) ii = IPMI_INTERFACE(obj); iic = IPMI_INTERFACE_GET_CLASS(obj); iic->get_fwinfo(ii, &info); - aml_append(scope, aml_ipmi_device(&info)); + aml_append(scope, aml_ipmi_device(&info, resource)); } } diff --git a/hw/acpi/noipmi.c b/hw/acpi/noipmi.c index 98b6dce..6c71d6c 100644 --- a/hw/acpi/noipmi.c +++ b/hw/acpi/noipmi.c @@ -9,6 +9,6 @@ #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) { } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 4b05bc2..b11fd3b 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1470,7 +1470,7 @@ static void build_isa_devices_aml(Aml *table) } else if (!obj) { error_report("No ISA bus, unable to define IPMI ACPI data"); } else { - build_acpi_ipmi_devices(scope, BUS(obj)); + build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); } aml_append(table, scope); diff --git a/include/hw/acpi/ipmi.h b/include/hw/acpi/ipmi.h index ab2bb29..d68bc85 100644 --- a/include/hw/acpi/ipmi.h +++ b/include/hw/acpi/ipmi.h @@ -17,6 +17,6 @@ * bus matches the given bus. The resource is the ACPI resource that * contains the IPMI device, this is required for the I2C CRS. */ -void build_acpi_ipmi_devices(Aml *table, BusState *bus); +void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource); #endif /* HW_ACPI_IPMI_H */