From patchwork Wed May 11 19:46:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 67622 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp397439qge; Wed, 11 May 2016 12:51:53 -0700 (PDT) X-Received: by 10.140.31.2 with SMTP id e2mr5537097qge.58.1462996313182; Wed, 11 May 2016 12:51:53 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w6si6350817qge.10.2016.05.11.12.51.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 11 May 2016 12:51:53 -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]:53828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0aAi-0001Ya-PS for patch@linaro.org; Wed, 11 May 2016 15:51:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0a5P-0000Lk-Dq for qemu-devel@nongnu.org; Wed, 11 May 2016 15:46:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0a5G-000842-HS for qemu-devel@nongnu.org; Wed, 11 May 2016 15:46:22 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:35778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0a5G-00083i-93 for qemu-devel@nongnu.org; Wed, 11 May 2016 15:46:14 -0400 Received: by mail-pa0-x242.google.com with SMTP id zy2so5042457pac.2 for ; Wed, 11 May 2016 12:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0NuhZDK3cHi9vo0YGpPIUfbOt9RGRGkNepmB6KuYdiA=; b=u236MQX2bWLo2E3hKT0fH/aydqbXBT6qB+8628ZICoGfDtpAo9u0S5sQ7ZHvGhCGy0 7cCrT0dZuIhBiAevosxOLeGvo33nneHyCObcxPdLEv/eCykBnBslFxNeBdWvfDxdDN7g oH60CQos1K0fPaSWZPyYx4HCIFRCNPQUmC3JPyD4x6JpH8YoEL+E0+52b/+qV3WIrbxt cEZB8kKIWPHB7pp4gYxwby1JnCUx+R+eh5aDeZ2VvPL9GFtHcJmYs+EqCbsFbAjjrRlQ 1KlOzeMKnFP+HZu4r0X/+H2ySeJHT/UwsgJ3u5avpAwwlBDxDag+MNQfHb0yflAw2xlY i0AQ== 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:cc:subject:date:message-id :in-reply-to:references; bh=0NuhZDK3cHi9vo0YGpPIUfbOt9RGRGkNepmB6KuYdiA=; b=JKfxAUOQiyirjdcQFtcPE6WM3sYVreqemnVHklpJI1UtFmdO4LoRP1vHa0q8DGgHwl AuD0dV2AYWeEmK9UiqZBToAhv9zUbZT50PQryFvK26DCVEhnSlP0arQmAULqCfS7vhZp JYjy/DcX75DjJi1FqaJX00Bt0eMV0y4g6k3ry4NefIln1lSM77hj4zL5ysAyj9upUtlg GZ0LBrOOA10JhO4W/aRuyiwgd8FVgFDC5VLKQDl2NTE/z1P5Tlox8rHhYhhpnIE0SkOX RFr+X6tLj2oAfsisZiRuKUncZDr2N1zxG7XSU94mMiO+G7yP8VAQgESGY8S+SrqzXRTB DJ3Q== X-Gm-Message-State: AOPr4FWXObn1uE/zStqfZYs9IQYoieViTa08aaNdX2DDNhLSgN26d4m1eubieTOq8pi4fw== X-Received: by 10.66.237.66 with SMTP id va2mr7683605pac.2.1462995973611; Wed, 11 May 2016 12:46:13 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id zn12sm14170839pab.14.2016.05.11.12.46.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 12:46:11 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 5B4191995; Wed, 11 May 2016 14:46:10 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 7F513300548; Wed, 11 May 2016 14:46:07 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org, minyard@acm.org Date: Wed, 11 May 2016 14:46:02 -0500 Message-Id: <1462995966-1184-4-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462995966-1184-1-git-send-email-minyard@acm.org> References: <1462995966-1184-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:c03::242 Subject: [Qemu-devel] [PATCH 3/7] pc: Add the SMBus device to the ACPI tables 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: , Cc: Corey Minyard Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Corey Minyard Signed-off-by: Corey Minyard --- hw/i386/acpi-build.c | 15 +++++++++++++++ hw/i386/pc.c | 2 ++ hw/i386/pc_piix.c | 2 ++ hw/i386/pc_q35.c | 2 ++ include/hw/i386/pc.h | 4 ++++ tests/acpi-test-data/pc/DSDT | Bin 5587 -> 5626 bytes tests/acpi-test-data/pc/DSDT.bridge | Bin 7446 -> 7485 bytes tests/acpi-test-data/pc/DSDT.ipmikcs | Bin 5683 -> 5722 bytes tests/acpi-test-data/q35/DSDT | Bin 8357 -> 8396 bytes tests/acpi-test-data/q35/DSDT.bridge | Bin 8374 -> 8413 bytes tests/acpi-test-data/q35/DSDT.ipmibt | Bin 8456 -> 8495 bytes 11 files changed, 25 insertions(+) diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT index 9d1274d3c2e2b7a316d5133d013b0550024ee413..4cd234c972dea489c453e67f7b320d09438657b5 100644 GIT binary patch delta 63 zcmcbt{Y#t6CDSaCA*qhe6UlzfI@(?r$Ka+WU#N30Y|)trwb3800S#W SyrWAH4>JQJ!{#RTjeG#?{tjRO delta 24 gcmcbmvss7BCD-CDpci_smbus_devnr != -1) + build_smb0(dsdt, pcms->pci_smbus_devnr, pcms->pci_smbus_func); build_cpu_hotplug_aml(dsdt); build_memory_hotplug_aml(dsdt, nr_mem, pm->mem_hp_io_base, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5e78ef4..deb25db 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1889,6 +1889,8 @@ static void pc_machine_initfn(Object *obj) { PCMachineState *pcms = PC_MACHINE(obj); + pcms->pci_smbus_devnr = -1; + object_property_add(obj, PC_MACHINE_MEMHP_REGION_SIZE, "int", pc_machine_get_hotplug_memory_region_size, NULL, NULL, NULL, &error_abort); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7f50116..cf4fe53 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -261,6 +261,8 @@ static void pc_init1(MachineState *machine, pc_machine_is_smm_enabled(pcms), &piix4_pm); smbus_eeprom_init(smbus, 8, NULL, 0); + pcms->pci_smbus_devnr = piix3_devfn >> 3; + pcms->pci_smbus_func = 3; object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, TYPE_HOTPLUG_HANDLER, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 04aae89..5bc77d7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -244,6 +244,8 @@ static void pc_q35_init(MachineState *machine) PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), 0xb100), 8, NULL, 0); + pcms->pci_smbus_devnr = ICH9_SMB_DEV; + pcms->pci_smbus_func = ICH9_SMB_FUNC; pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 96f0b66..e0d2779 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -72,6 +72,10 @@ struct PCMachineState { uint64_t numa_nodes; uint64_t *node_mem; uint64_t *node_cpu; + + /* SMBus information: */ + int pci_smbus_devnr; + int pci_smbus_func; }; #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"