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: 9074301 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C0E0EBF29F for ; Wed, 11 May 2016 19:51:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE9B22017D for ; Wed, 11 May 2016 19:51:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0960200E5 for ; Wed, 11 May 2016 19:51:31 +0000 (UTC) Received: from localhost ([::1]:53821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0aAN-0001BJ-6h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 May 2016 15:51:31 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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"