From patchwork Mon Jan 8 02:45:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856658 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MNtwHcwq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKRW0WfHz9s7n for ; Mon, 8 Jan 2018 13:46:45 +1100 (AEDT) Received: from localhost ([::1]:59304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNST-0006SL-7U for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:46:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNRy-0006S2-Rq for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNRy-00026J-22 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:10 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:38818) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNRx-000266-U2 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:09 -0500 Received: by mail-qk0-x242.google.com with SMTP id j185so1737680qkc.5 for ; Sun, 07 Jan 2018 18:46:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+CLSqHTCH79W6mcqb3+vWmBqPVUGChPJKMrT/faNNTw=; b=MNtwHcwqiDmcr0fItIMBToVgfqRuysW+2NkB9P/futQmfSQWewrSUb8SuwVoHyKKyS aWjp6aYBmF90N9hhuOQyEzQ4fyJ2cE4rTLQTUOb/5xwaBfrCv7a0nmyprv2QXeckdDTE XS2nK0IddfsnSr4MfsDZNa5aKTRy2zfupPApk/OLjmZkOx28ap6vHUqy8Zg6q1fKkeNG ViG2mOgHL7dlOuGO123RnN7V0o6OBl7zbmqkHsUMdm1S5fhQYgqctpQ7ViPRAjK/KVjd gj3z3/wkeZbkGooqed0N3bbTAx9cbRZl3TSoG8QL3a5LN5XtlZq7wYhSdlSr2ZPsV/Zt r9pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+CLSqHTCH79W6mcqb3+vWmBqPVUGChPJKMrT/faNNTw=; b=i+VIsU3Mx2VFiZPjixLm33BN6pITsRYI4zGnzCKm691V+jLeQrTlBjRqtC1RO3r/g6 i3NpRaX1gx9MG/0Yx9P1heSYK6GQpkwQx4ZF4/4iGe/HQFWiDxgFneFoaxwwvnHnq+vK amQoLKHJgO1D3gplqKBoc9i4+n+BTTXH/JBi2nmrB+QtXPfk3ZuLmkUOMgaNMZF/yrB2 a+78ILD3we7Le15XnCXhAve1XcJBpjpGz22M10UqmRQjDy3rcgZT9q6XXDczI3L6oolZ 36mEBFkuzVfP3NOCCmQaItNKNgHG1Z7prCVaw7tNiXOTydtX7ZM53g8E+WUM9YfiqLfu 7a6g== X-Gm-Message-State: AKwxytfvRc9QaWlCpW/Z+Ztws0KHkzOjoLqJVXmE0EZsoyaBhBf5hnzx rvIfjUFVKaoqWs6yZqr2GBI= X-Google-Smtp-Source: ACJfBouP/12AMXrDNVNn3txLsrzQ2VYPgfhO0tEQT43r/rrCTx8jSiRGgYPBlGXQThMzQTdwxRzQeg== X-Received: by 10.55.20.234 with SMTP id 103mr12466298qku.274.1515379569371; Sun, 07 Jan 2018 18:46:09 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , Keith Busch Date: Sun, 7 Jan 2018 23:45:30 -0300 Message-Id: <20180108024558.17983-2-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 01/29] hw/acpi: add mem/nvdimm.h dependency 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/ich9.c | 1 + hw/acpi/piix4.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index c5d8646abc..26aa87fa1a 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -37,6 +37,7 @@ #include "hw/i386/ich9.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/nvdimm.h" //#define DEBUG diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index a0fb1ce037..32caa4f0fc 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -37,6 +37,7 @@ #include "hw/acpi/cpu.h" #include "hw/hotplug.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/nvdimm.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/xen/xen.h" From patchwork Mon Jan 8 02:45:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ahrF5M6U"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKRb4b22z9s7n for ; Mon, 8 Jan 2018 13:46:51 +1100 (AEDT) Received: from localhost ([::1]:59308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSb-0006Uy-N9 for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:46:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNS1-0006TG-Sa for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNS1-00028r-0y for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:13 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:34503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNS0-000287-SJ for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:12 -0500 Received: by mail-qt0-x244.google.com with SMTP id 33so12077970qtv.1 for ; Sun, 07 Jan 2018 18:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6wxBBs/03Mo+0EhVUUEo7md83HLIefz8urcf7Y9mnVU=; b=ahrF5M6Ur0gdbbYSNt5lVTZbP3FxeGVfdc/1y5pwElWy22/QtV86n17m4InXk81uuO jR5xcY4g+JbsmSNCaSh4OfVDHmW+f8kNyhUBAdySx73w5l8HMLqEPdsbd9JU3nLq3KlU KaYoxPdCR9vW4Su46jd1BqMT0U0iwPS03AKd+YzNlzLrg7bulVruK6cgshU8cJKu1sI+ qVZ9QtOfZEO6Oq4/vzjzqAer1hsZClpvR/hAjxHH/IUD1kXa82GLg3z1vU4N8bx0vSq8 XkP8aCfdQqte2HXPE/auy1F70Q5JePaxFW6i2vZnSjALh0OjaSYhJ9DSRqmgg6CTZ/Gb 2t0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6wxBBs/03Mo+0EhVUUEo7md83HLIefz8urcf7Y9mnVU=; b=OqeOlV+V5T+5PHw4PlEGqSaj37Kf7G+EeYtOchqGF+aLXKkq9y/6dGos1IA6HPpoyf 822TRrB0fZXCXDUmEc0gbCChHs1lPJ1vauzv9NLvBRewSHk0ka9fOR6d4Rn/m6bnzShe KsIFXsC0I/R91IRkwT54aMbktCxQdSaZ1k9PwQ4HtsiKtk0clqi+pe7F10MRpjX+YvkK l0zfJhtQ0akmy4e4pfm2NGMszNwQGBRoggwmNzib15Na1Mt1DK5eaos1jEwqBqdYrSPo aQ+Gt8m8+SxaV/2UuBr63J7e4PtIDbp4ncSVwQLfHuPuqQTL/PkN6WgZIhHt5gejrUuL OceA== X-Gm-Message-State: AKwxyteznhKlg0WXJEvBeoPw5TJWGfg3/EjpztuppcIgYENRMevSmS8d lVfHdkcDF9ElPeUS3YX8oVc= X-Google-Smtp-Source: ACJfBosVSxDwpQ7Aa/ETOaHXrW/X6N0e62xrnf/f3720BLUQWZ7FG5r8bYy+rrmfdMze53D+Aw8QnA== X-Received: by 10.200.52.171 with SMTP id w40mr14652662qtb.205.1515379572335; Sun, 07 Jan 2018 18:46:12 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:31 -0300 Message-Id: <20180108024558.17983-3-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 02/29] pci/pci_host: move generic definitions out of i386/pc.h 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 9 --------- include/hw/pci/pci_host.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 6f77eb0665..780fa049d7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -218,15 +218,6 @@ void pc_acpi_init(const char *default_dsdt); void pc_guest_info_init(PCMachineState *pcms); -#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start" -#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end" -#define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start" -#define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end" -#define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size" -#define PCI_HOST_BELOW_4G_MEM_SIZE "below-4g-mem-size" -#define PCI_HOST_ABOVE_4G_MEM_SIZE "above-4g-mem-size" - - void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, MemoryRegion *pci_address_space); diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index ba31595fc7..5239adf7e6 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -56,6 +56,14 @@ typedef struct PCIHostBridgeClass { const char *(*root_bus_path)(PCIHostState *, PCIBus *); } PCIHostBridgeClass; +#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start" +#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end" +#define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start" +#define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end" +#define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size" +#define PCI_HOST_BELOW_4G_MEM_SIZE "below-4g-mem-size" +#define PCI_HOST_ABOVE_4G_MEM_SIZE "above-4g-mem-size" + /* common internal helpers for PCI/PCIe hosts, cut off overflows */ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, uint32_t limit, uint32_t val, uint32_t len); From patchwork Mon Jan 8 02:45:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f6npLLEI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKW00L9Vz9s7h for ; Mon, 8 Jan 2018 13:49:48 +1100 (AEDT) Received: from localhost ([::1]:59334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNVS-0000MK-2u for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:49:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNS8-0006YA-JV for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNS5-0002GN-GT for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:20 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:34501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNS5-0002FZ-Ay for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:17 -0500 Received: by mail-qt0-x241.google.com with SMTP id 33so12078096qtv.1 for ; Sun, 07 Jan 2018 18:46:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uEgVdjSGc95ojJ4vYAvP/LbuDkYLJZrulBhcByNi/7g=; b=f6npLLEIKiLkzMVnFE+aDNXhJPhvPAbDUbFkOvPfrRXPllbWz4kGf/3wEZIykF93HU wjel5734c4H1LMSUHwbh1Sn318d7GN7WPVYojh8vbQorpyjkutXxweszkAshMZrbnTml ym8+XfbrcAu+q7xjLLdgkAPL3OIPVFz4badMMdcn7Dh1ctZ60tesANR+PPRSJ82AEDuR 9w3pfvcX7tdYESsNwdjdFfaixQsk7iZ9o1dQFkNjTtIW6dKxsxFi1l2gauSQ9VCUnTTA a7vzof/I4cakiEWUaL2JOWoOzXwlSF7pTN6pnXVXbTlFnGarYQNAYxCaOq6t8SZU35gO p4lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uEgVdjSGc95ojJ4vYAvP/LbuDkYLJZrulBhcByNi/7g=; b=Y4yYh+Kp5PncKrTJTzXgA196Or7zACj4TKo2gIVi7LFMj8qEbmcXleMB+XpknEOb8j ap/3svQzj8FS0ZCLg6w61m0tyEnUTDV+xbEprd9QWEL6l/KAHZIh4hYrvFDfisRWjbQZ cwXTTqBoGp1wvyEBGY/2gXD7nmxkr8pepDqcfiBhiusj5RDO8yHx+MWUCaGxai5dGIDu O0ktiLqo2H+V3obHN0Gf3XrQsZq98pc/qBAWxP8odpJaXSRy87woEExB7t8m2gNA5mt2 amy8A343wii76Yk8BVRFqb9nJtNdZbm0aExfL+sJJfzcurvw0G8k/M7rA25jodZyIU6y X+dA== X-Gm-Message-State: AKwxytdof0OU8yoE900CTZyhUInCI3VyeQARrgRDHy/OdTd+4JqoX10w M/EEkYOWx6tB68GxSl8cINM= X-Google-Smtp-Source: ACJfBotaFG1o7xGC7kbxwM+8MtLActx5RAqEFFoB8sYigAmbB94vgJhx7BY27mNz2FNNAPJP51J6ng== X-Received: by 10.200.40.115 with SMTP id 48mr15451896qtr.335.1515379576711; Sun, 07 Jan 2018 18:46:16 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:32 -0300 Message-Id: <20180108024558.17983-4-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 03/29] hw/isa: extract parallel-isa specific code 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: Mark Cave-Ayland , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Igor Mammedov , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/char/parallel.h | 14 ++++++++++++++ include/hw/i386/pc.h | 8 -------- hw/char/parallel-isa.c | 29 +++++++++++++++++++++++++++++ hw/char/parallel.c | 2 +- hw/i386/pc.c | 1 + hw/isa/isa-bus.c | 26 -------------------------- hw/mips/mips_fulong2e.c | 1 + hw/mips/mips_jazz.c | 1 + hw/mips/mips_malta.c | 1 + hw/sparc64/sun4u.c | 1 + MAINTAINERS | 3 ++- hw/char/Makefile.objs | 1 + 12 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 include/hw/char/parallel.h create mode 100644 hw/char/parallel-isa.c diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h new file mode 100644 index 0000000000..d6dd62fb9f --- /dev/null +++ b/include/hw/char/parallel.h @@ -0,0 +1,14 @@ +#ifndef HW_PARALLEL_H +#define HW_PARALLEL_H + +#include "exec/memory.h" +#include "hw/isa/isa.h" +#include "chardev/char.h" + +void parallel_hds_isa_init(ISABus *bus, int n); + +bool parallel_mm_init(MemoryRegion *address_space, + hwaddr base, int it_shift, qemu_irq irq, + Chardev *chr); + +#endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 780fa049d7..87a377011b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -151,14 +151,6 @@ struct PCMachineClass { #define PC_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE) -/* parallel.c */ - -void parallel_hds_isa_init(ISABus *bus, int n); - -bool parallel_mm_init(MemoryRegion *address_space, - hwaddr base, int it_shift, qemu_irq irq, - Chardev *chr); - /* i8259.c */ extern DeviceState *isa_pic; diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c new file mode 100644 index 0000000000..906a55a07d --- /dev/null +++ b/hw/char/parallel-isa.c @@ -0,0 +1,29 @@ +#include "qemu/osdep.h" +#include "sysemu/sysemu.h" +#include "hw/isa/isa.h" +#include "hw/char/parallel.h" + +static void parallel_init(ISABus *bus, int index, Chardev *chr) +{ + DeviceState *dev; + ISADevice *isadev; + + isadev = isa_create(bus, "isa-parallel"); + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "index", index); + qdev_prop_set_chr(dev, "chardev", chr); + qdev_init_nofail(dev); +} + +void parallel_hds_isa_init(ISABus *bus, int n) +{ + int i; + + assert(n <= MAX_PARALLEL_PORTS); + + for (i = 0; i < n; i++) { + if (parallel_hds[i]) { + parallel_init(bus, i, parallel_hds[i]); + } + } +} diff --git a/hw/char/parallel.c b/hw/char/parallel.c index f79dc76543..1542d62201 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -28,7 +28,7 @@ #include "chardev/char-parallel.h" #include "chardev/char-fe.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" +#include "hw/char/parallel.h" #include "sysemu/sysemu.h" //#define DEBUG_PARALLEL diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3fcf318a95..6d3b2a8d1c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/i386/apic.h" #include "hw/i386/topology.h" #include "sysemu/cpus.h" diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 348e0eab9d..0f732b5b58 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -23,7 +23,6 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" static ISABus *isabus; @@ -287,28 +286,3 @@ MemoryRegion *isa_address_space_io(ISADevice *dev) } type_init(isabus_register_types) - -static void parallel_init(ISABus *bus, int index, Chardev *chr) -{ - DeviceState *dev; - ISADevice *isadev; - - isadev = isa_create(bus, "isa-parallel"); - dev = DEVICE(isadev); - qdev_prop_set_uint32(dev, "index", index); - qdev_prop_set_chr(dev, "chardev", chr); - qdev_init_nofail(dev); -} - -void parallel_hds_isa_init(ISABus *bus, int n) -{ - int i; - - assert(n <= MAX_PARALLEL_PORTS); - - for (i = 0; i < n; i++) { - if (parallel_hds[i]) { - parallel_init(bus, i, parallel_hds[i]); - } - } -} diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 725e25a134..d3c3a6ab61 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -23,6 +23,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/block/fdc.h" #include "net/net.h" #include "hw/boards.h" diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 0d2c0683ba..afb33beffd 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -28,6 +28,7 @@ #include "hw/mips/cpudevs.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "sysemu/sysemu.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 37f19428d6..95d22288f4 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -28,6 +28,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/block/fdc.h" #include "net/net.h" #include "hw/boards.h" diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 1672f256e7..8bbc210fc8 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -31,6 +31,7 @@ #include "hw/pci-host/apb.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/timer/m48t59.h" #include "hw/block/fdc.h" #include "net/net.h" diff --git a/MAINTAINERS b/MAINTAINERS index 73a5555735..f11c0386e9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -867,7 +867,7 @@ M: Michael S. Tsirkin M: Paolo Bonzini S: Supported F: hw/char/debugcon.c -F: hw/char/parallel.c +F: hw/char/parallel* F: hw/char/serial* F: hw/dma/i8257* F: hw/i2c/pm_smbus.c @@ -882,6 +882,7 @@ F: hw/timer/i8254* F: hw/timer/mc146818rtc* F: hw/watchdog/wdt_ib700.c F: include/hw/display/vga.h +F: include/hw/char/parallel.h F: include/hw/i2c/pm_smbus.h F: include/hw/isa/i8257.h F: include/hw/timer/hpet.h diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs index 1bcd37e98d..1b979100b7 100644 --- a/hw/char/Makefile.objs +++ b/hw/char/Makefile.objs @@ -1,6 +1,7 @@ common-obj-$(CONFIG_IPACK) += ipoctal232.o common-obj-$(CONFIG_ESCC) += escc.o common-obj-$(CONFIG_PARALLEL) += parallel.o +common-obj-$(CONFIG_PARALLEL) += parallel-isa.o common-obj-$(CONFIG_PL011) += pl011.o common-obj-$(CONFIG_SERIAL) += serial.o common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o From patchwork Mon Jan 8 02:45:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ROboD9ly"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKZJ6lBDz9ryr for ; Mon, 8 Jan 2018 13:52:40 +1100 (AEDT) Received: from localhost ([::1]:59370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNYF-0002t7-0V for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:52:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSB-0006aR-G1 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSA-0002Ix-8l for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:23 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:37633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSA-0002IN-2w; Sun, 07 Jan 2018 21:46:22 -0500 Received: by mail-qk0-x243.google.com with SMTP id p13so12550588qke.4; Sun, 07 Jan 2018 18:46:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q7/3VcbWeM3aDqKgGbf3pUwSCsecpGWMWj/B9Bdd/uA=; b=ROboD9lyCrTUt5AHDxjtg9UXMoPTASXBdmxvGRWMuPv3NtOU3FJextoOa31i4IvoMj dn9Qr4hzdcJupgLx6XdOVk+nm/rl24NSXUClh0+kptgaDIlLjj6JSxigdRfLM3xIWjJO ZKM0YAOpnwQgXvJuDzKseXutoapYLcpsnJ+kG4Qt7ygWIVdTnSAWxFy7TZ2dAOI31kWn hOciDVpUA109iI792GG9KOg5HPUK7MfU7sosTfcqdNU3k4z0sihSC5YN8FoRoDbGS9la z1GXs76PSaF55BUhwwG30Vj0xo1PXHxub19EyytABeV4IRRKAMi1cJi1IUnMZ/UKz5cV W3QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=q7/3VcbWeM3aDqKgGbf3pUwSCsecpGWMWj/B9Bdd/uA=; b=iKk2+GR14fKMeoKTZFZ7mKSpEau9Jp2Gge9vQEliq7yMBRdc60I3jys212f1FrypLI sr/VljKivWXp34JgJeNmiB18NeVMGemcVofok192J+4+8fOCW2gglct4lMYE0tvGWsIf 4q6sJfg9NbvEzy5WmkBqnaMGG2UidzuEXdB5H2G4uYGFNwut4R2wzHtz0deSbrXktoy/ R0IEzLHjtl7Llwh6iCwHWIWoQnsBxOhvWxBeJaIwL51UGCJFqF1nV99LfSCLbdtn0pBR x9mCEO0AdiaY57ZjqxzBlN7gT9qneQxgIFWaJnSIUKCXSrW948WHfqq/DAD6P6eVHijq iTwA== X-Gm-Message-State: AKwxyteJjc2Pfjf67qjZVu9wnUFzCEcmSWrYp4u/MKNkiutmrEyUjsiR QbQz95u10G1oDANwP8HncVk= X-Google-Smtp-Source: ACJfBovVlUET7r76EwkKwm6UUS7nwITqxEIr/5WWKLlEvQvr65jFj/Z/ijqfAlIheG/ButELOjF0rA== X-Received: by 10.55.222.14 with SMTP id h14mr14099293qkj.197.1515379581450; Sun, 07 Jan 2018 18:46:21 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:33 -0300 Message-Id: <20180108024558.17983-5-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 04/29] hw/dma/i8257: rename DMA_init() to i8257_dma_init() 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: Mark Cave-Ayland , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:PReP" , Igor Mammedov , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" - move the header from hw/isa/ to hw/dma/ - remove the old i386/pc dependency Signed-off-by: Philippe Mathieu-Daudé --- include/hw/{isa => dma}/i8257.h | 6 ++++++ include/hw/isa/isa.h | 2 -- hw/dma/i82374.c | 3 ++- hw/dma/i8257.c | 4 ++-- hw/i386/pc.c | 3 ++- hw/mips/mips_fulong2e.c | 3 ++- hw/mips/mips_jazz.c | 3 ++- hw/mips/mips_malta.c | 3 ++- hw/sparc/sun4m.c | 4 ---- hw/sparc64/sun4u.c | 4 ---- MAINTAINERS | 2 +- 11 files changed, 19 insertions(+), 18 deletions(-) rename include/hw/{isa => dma}/i8257.h (86%) diff --git a/include/hw/isa/i8257.h b/include/hw/dma/i8257.h similarity index 86% rename from include/hw/isa/i8257.h rename to include/hw/dma/i8257.h index 88a2766a3f..0041565177 100644 --- a/include/hw/isa/i8257.h +++ b/include/hw/dma/i8257.h @@ -1,6 +1,10 @@ #ifndef HW_I8257_H #define HW_I8257_H +#include "hw/hw.h" +#include "hw/isa/isa.h" +#include "exec/ioport.h" + #define TYPE_I8257 "i8257" typedef struct I8257Regs { @@ -40,4 +44,6 @@ typedef struct I8257State { PortioList portio_pageh; } I8257State; +void i8257_dma_init(ISABus *bus, int high_page_enable); + #endif diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 95593408ef..b9dbab24b4 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d) return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); } -/* i8257.c */ -void DMA_init(ISABus *bus, int high_page_enable); #endif diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 6c0f975df0..0b8a6f4a80 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "hw/isa/isa.h" +#include "hw/dma/i8257.h" #define TYPE_I82374 "i82374" #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374) @@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp) portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), s->iobase); - DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1); + i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), 1); memset(s->commands, 0, sizeof(s->commands)); } diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index bd23e893bf..07bfbdb618 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/isa/isa.h" -#include "hw/isa/i8257.h" +#include "hw/dma/i8257.h" #include "qemu/main-loop.h" #include "trace.h" @@ -622,7 +622,7 @@ static void i8257_register_types(void) type_init(i8257_register_types) -void DMA_init(ISABus *bus, int high_page_enable) +void i8257_dma_init(ISABus *bus, int high_page_enable) { ISADevice *isa1, *isa2; DeviceState *d; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6d3b2a8d1c..e39af3d48c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -40,6 +40,7 @@ #include "elf.h" #include "multiboot.h" #include "hw/timer/mc146818rtc.h" +#include "hw/dma/i8257.h" #include "hw/timer/i8254.h" #include "hw/audio/pcspk.h" #include "hw/pci/msi.h" @@ -1605,7 +1606,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, port92_init(port92, a20_line[1]); g_free(a20_line); - DMA_init(isa_bus, 0); + i8257_dma_init(isa_bus, 0); for(i = 0; i < MAX_FD; i++) { fd[i] = drive_get(IF_FLOPPY, 0, i); diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index d3c3a6ab61..cbe159034d 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -22,6 +22,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/dma/i8257.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/block/fdc.h" @@ -361,7 +362,7 @@ static void mips_fulong2e_init(MachineState *machine) /* init other devices */ pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - DMA_init(isa_bus, 0); + i8257_dma_init(isa_bus, 0); /* Super I/O */ isa_create_simple(isa_bus, "i8042"); diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index afb33beffd..6ed4b83f40 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -27,6 +27,7 @@ #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/i386/pc.h" +#include "hw/dma/i8257.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/isa/isa.h" @@ -219,7 +220,7 @@ static void mips_jazz_init(MachineState *machine, /* ISA devices */ i8259 = i8259_init(isa_bus, env->irq[4]); isa_bus_irqs(isa_bus, i8259); - DMA_init(isa_bus, 0); + i8257_dma_init(isa_bus, 0); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk_init(isa_bus, pit); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 95d22288f4..0a9e3dedf4 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -27,6 +27,7 @@ #include "cpu.h" #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/dma/i8257.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/block/fdc.h" @@ -1210,7 +1211,7 @@ void mips_malta_init(MachineState *machine) smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); g_free(smbus_eeprom_buf); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - DMA_init(isa_bus, 0); + i8257_dma_init(isa_bus, 0); /* Super I/O */ isa_create_simple(isa_bus, "i8042"); diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index e71648404c..2ed28c4d25 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -99,10 +99,6 @@ struct sun4m_hwdef { uint8_t nvram_machine_id; }; -void DMA_init(ISABus *bus, int high_page_enable) -{ -} - static void fw_cfg_boot_set(void *opaque, const char *boot_device, Error **errp) { diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 8bbc210fc8..135f8088ca 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -87,10 +87,6 @@ typedef struct EbusState { MemoryRegion bar1; } EbusState; -void DMA_init(ISABus *bus, int high_page_enable) -{ -} - static void fw_cfg_boot_set(void *opaque, const char *boot_device, Error **errp) { diff --git a/MAINTAINERS b/MAINTAINERS index f11c0386e9..89810df375 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -883,8 +883,8 @@ F: hw/timer/mc146818rtc* F: hw/watchdog/wdt_ib700.c F: include/hw/display/vga.h F: include/hw/char/parallel.h +F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h -F: include/hw/isa/i8257.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* F: include/hw/timer/mc146818rtc* From patchwork Mon Jan 8 02:45:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jZT3ogyl"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKdS05v3z9s82 for ; Mon, 8 Jan 2018 13:55:24 +1100 (AEDT) Received: from localhost ([::1]:59390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNas-0005aI-3o for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:55:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSI-0006fu-GT for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSF-0002Kv-Cg for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:30 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:34503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSF-0002Kp-7O; Sun, 07 Jan 2018 21:46:27 -0500 Received: by mail-qt0-x241.google.com with SMTP id 33so12078340qtv.1; Sun, 07 Jan 2018 18:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4GHBgIZCeTO84twvIoYGLN19prlhZb/LtmGjl7KG7/Y=; b=jZT3ogylBAyQ9tOJvV5cY8dphbCAD6+Wgh0pG2macVzqmnHhm4951gRi3jyA5Lec0Q 5Ikb46zjIxRcwuDPAIY2ha5iwUDHwNvoPXPdLl2u12LywfA3w6IMNxlrnJ5fTzMIMzVF U0XRPiVWvpUsc5YvFo1BnfcmM0/pvOtHBluQTpEHb1AR0E/8w7u0Db4Ft2Tx4K9Y4DgP fsEkD1X/H3WDwzhPKogUDviTdCjnVvRPDXXZ+eFK8V0oY7AyXoj0EAZ9JiLW6Qq/LF2J M6DfHmbV2kOqzDdNW8yseNdBZ5FRGTAtgX8nv2SvZTXvw7E9MVNMuHXuDwwB6EPQwdYL T83Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4GHBgIZCeTO84twvIoYGLN19prlhZb/LtmGjl7KG7/Y=; b=evJHWHK1fVGfUvTS1FNnvuZhFDfbwR5qNGBYIiasSRNXjULqTOBvnq5h5nwi3m5muz bik5wnSrFggLG7BhcIs76WAygtRq0JyDGAANlxd/H7xBeARkETdtsAwlp8OIGAgtW2Cf w/YfrnXyPRJ6iAaaQQPqUUFnU4YV0toWJoQyrW2/8Y7dYEoCqINk2CdB/7gIkQRXBn8M vPFaHnpWmrO1pTvUREj9+Vtem61pqB7Tx1jGj61OScSbN+9pUZDpEV+BhcTnB9ctXEeb gpqoeXpLdsqSmGprdyY9aILxm4723O6taa/Ud3I3eA5estqIJ+tlHj8Qvkph1+pBHc3s b1Zw== X-Gm-Message-State: AKwxytepJw2qBUxESipMFcuh00P0Z4dIriHj0HrbdV36alO5whSvxJ9R psquUGB1CJqJew+uYtQ1Ebs= X-Google-Smtp-Source: ACJfBosB+FJQvMNbh4zCLjpU/WqCopJKUUr0DMJ87VQ1Jq74bPSh8FmSvUPpKMzwOMRFJj2Axt18+g== X-Received: by 10.237.53.50 with SMTP id a47mr14998162qte.29.1515379586639; Sun, 07 Jan 2018 18:46:26 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:34 -0300 Message-Id: <20180108024558.17983-6-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 05/29] hw/input/i8042: extract declarations from i386/pc.h into input/i8042.h 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: Alexander Graf , Guan Xuetao , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathi?= =?utf-8?b?ZXUtRGF1ZMOp?= , qemu-devel@nongnu.org, "open list:PReP" , Igor Mammedov , David Gibson , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson --- include/hw/i386/pc.h | 9 --------- include/hw/input/i8042.h | 25 +++++++++++++++++++++++++ hw/alpha/dp264.c | 3 ++- hw/i386/pc.c | 1 + hw/i386/vmmouse.c | 1 + hw/i386/vmport.c | 1 + hw/input/pckbd.c | 2 +- hw/mips/mips_fulong2e.c | 3 ++- hw/mips/mips_jazz.c | 1 + hw/mips/mips_malta.c | 3 ++- hw/mips/mips_r4k.c | 3 ++- hw/ppc/prep.c | 5 +++-- hw/sparc64/sun4u.c | 3 ++- hw/unicore32/puv3.c | 1 + MAINTAINERS | 1 + 15 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 include/hw/input/i8042.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 87a377011b..103c7a9916 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -188,15 +188,6 @@ void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque); void vmmouse_get_data(uint32_t *data); void vmmouse_set_data(const uint32_t *data); -/* pckbd.c */ -#define I8042_A20_LINE "a20" - -void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, - MemoryRegion *region, ram_addr_t size, - hwaddr mask); -void i8042_isa_mouse_fake_event(void *opaque); -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); - /* pc.c */ extern int fd_bootchk; diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h new file mode 100644 index 0000000000..15115004a3 --- /dev/null +++ b/include/hw/input/i8042.h @@ -0,0 +1,25 @@ +/* + * QEMU PS/2 Controller + * + * Copyright (c) 2003 Fabrice Bellard + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_INPUT_I8042_H +#define HW_INPUT_I8042_H + +#include "hw/hw.h" +#include "hw/isa/isa.h" + +#define TYPE_I8042 "i8042" + +#define I8042_A20_LINE "a20" + +void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, + MemoryRegion *region, ram_addr_t size, + hwaddr mask); +void i8042_isa_mouse_fake_event(void *opaque); +void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); + +#endif /* HW_INPUT_I8042_H */ diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 766373eec7..e13cb576fd 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -19,6 +19,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/ide.h" #include "hw/timer/i8254.h" +#include "hw/input/i8042.h" #include "hw/char/serial.h" #include "qemu/cutils.h" @@ -81,7 +82,7 @@ static void clipper_init(MachineState *machine) mc146818_rtc_init(isa_bus, 1900, rtc_irq); i8254_pit_init(isa_bus, 0x40, 0, NULL); - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); /* VGA setup. Don't bother loading the bios. */ pci_vga_init(pci_bus); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e39af3d48c..e5c4e48ebb 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -42,6 +42,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/dma/i8257.h" #include "hw/timer/i8254.h" +#include "hw/input/i8042.h" #include "hw/audio/pcspk.h" #include "hw/pci/msi.h" #include "hw/sysbus.h" diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index 65ef55329e..5d2d278be4 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "ui/console.h" #include "hw/i386/pc.h" +#include "hw/input/i8042.h" #include "hw/qdev.h" /* debug only vmmouse */ diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 116aa09819..3bf8cfe041 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "hw/isa/isa.h" #include "hw/i386/pc.h" +#include "hw/input/i8042.h" #include "sysemu/hw_accel.h" #include "hw/qdev.h" #include "qemu/log.h" diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index c479f827b6..f17f18e51b 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -26,6 +26,7 @@ #include "hw/isa/isa.h" #include "hw/i386/pc.h" #include "hw/input/ps2.h" +#include "hw/input/i8042.h" #include "sysemu/sysemu.h" /* debug PC keyboard */ @@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, qemu_register_reset(kbd_reset, s); } -#define TYPE_I8042 "i8042" #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) typedef struct ISAKBDState { diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index cbe159034d..8660d078c8 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -44,6 +44,7 @@ #include "hw/isa/vt82c686.h" #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" +#include "hw/input/i8042.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" @@ -365,7 +366,7 @@ static void mips_fulong2e_init(MachineState *machine) i8257_dma_init(isa_bus, 0); /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); mc146818_rtc_init(isa_bus, 2000, NULL); diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 6ed4b83f40..7a83009059 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -43,6 +43,7 @@ #include "hw/timer/i8254.h" #include "hw/display/vga.h" #include "hw/audio/pcspk.h" +#include "hw/input/i8042.h" #include "sysemu/block-backend.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 0a9e3dedf4..28cc37ee08 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -47,6 +47,7 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/timer/i8254.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" @@ -1214,7 +1215,7 @@ void mips_malta_init(MachineState *machine) i8257_dma_init(isa_bus, 0); /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); mc146818_rtc_init(isa_bus, 2000, NULL); serial_hds_isa_init(isa_bus, 0, 2); diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 244bd41813..92acae149d 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -28,6 +28,7 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/timer/i8254.h" #include "sysemu/block-backend.h" #include "exec/address-spaces.h" @@ -288,7 +289,7 @@ void mips_r4k_init(MachineState *machine) hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]); - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); } static void mips_machine_init(MachineClass *mc) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index af08ac319a..4304e93ada 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -41,6 +41,7 @@ #include "hw/ide.h" #include "hw/loader.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/isa/pc87312.h" #include "hw/net/ne2000-isa.h" #include "sysemu/block-backend.h" @@ -641,7 +642,7 @@ static void ppc_prep_init(MachineState *machine) hd[2 * i], hd[2 * i + 1]); } - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); cpu = POWERPC_CPU(first_cpu); sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET]; @@ -771,7 +772,7 @@ static void ibm_40p_init(MachineState *machine) /* add some more devices */ if (defaults_enabled()) { - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59")); dev = DEVICE(isa_create(isa_bus, "cs4231a")); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 135f8088ca..2a60f5c1d6 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -33,6 +33,7 @@ #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/timer/m48t59.h" +#include "hw/input/i8042.h" #include "hw/block/fdc.h" #include "net/net.h" #include "qemu/timer.h" @@ -513,7 +514,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_init_nofail(&pci_dev->qdev); pci_ide_create_devs(pci_dev, hd); - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); /* Floppy */ for(i = 0; i < MAX_FD; i++) { diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index db26959a1d..830fe3face 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -20,6 +20,7 @@ #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" +#include "hw/input/i8042.h" #define KERNEL_LOAD_ADDR 0x03000000 #define KERNEL_MAX_SIZE 0x00800000 /* Just a guess */ diff --git a/MAINTAINERS b/MAINTAINERS index 89810df375..7f9e98a046 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -885,6 +885,7 @@ F: include/hw/display/vga.h F: include/hw/char/parallel.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h +F: include/hw/input/i8042.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* F: include/hw/timer/mc146818rtc* From patchwork Mon Jan 8 02:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jVs4cb5U"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKZW559wz9ryr for ; Mon, 8 Jan 2018 13:52:51 +1100 (AEDT) Received: from localhost ([::1]:59371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNYP-00034I-Ka for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:52:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSJ-0006gk-G5 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSI-0002MB-IU for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:31 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:42609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSI-0002Lz-EU for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:30 -0500 Received: by mail-qt0-x243.google.com with SMTP id g9so12060521qth.9 for ; Sun, 07 Jan 2018 18:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pN54l5060qnSKve+RUs6hFoj4ulmEP357iz1qzBmy3Q=; b=jVs4cb5UkvqXvKg9ou6HA75I0dyU8xXmr24IJiFsSZmng8OwmlEqu0zYKXUMx9VlHd NuqYaWvvKtODc7LJOFl0mjdSt0byDAMb6cxi+WJNyPOjTAjF/cFga2G8bCQ0T1LcoRX6 adM5hql/DZ73SeqMnVMAB1e/nEipynUoUxivzJEaT/mbSp4lT1ySaeuIbihGl+9RXYod tggzAbC1vJDFIrn5Ec/3xnArh8lGLMYzarggyGDjzA7RGUQ6yGLDiiqC/JIp1S038P/x gvd5Cs3zYenb5OUpvXYjqEDPXj7ziRbwly4uWMgoegbATGHuiooRktnC7TZ2J9+Xntnt TWqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pN54l5060qnSKve+RUs6hFoj4ulmEP357iz1qzBmy3Q=; b=INVhIISN1qRiGp9NJA3wWwkEDzV+I/Beya9LV6dn+zubdmbZAiuDdCSn+DKJHsCLe8 yYy4bBMCLi0Z219+vfNBnO7msdrslK6UeKbN47frVlaj2bm4qW7G3HUba1myywahoKWQ YeGgHfJ0QIkS1pgpSOoMAL9K6nNxf9/k4vN4Uox61D3Is25Pu4Y1aZcwuwp4vZ7PWhoc rjJ8CIBa/dfhKMb06qevGoKrVT83DRkuwrCwpg6FVnWnQNoP5cpaBAECHo44nQ6ios+/ DopUkCmuX4ZXB+xPHZGrFgC8y/rM7llB7I9fB5PRvF8B7bEFNdq3j1YE90P8UvMu2AiX hMyg== X-Gm-Message-State: AKwxytfCE6iRrSF3v4+VeyIV6iOeDjcZiccAYjABeZlHnFtJcCjV4DMw hh4/jmg7wpT8GVhLPzSbwac= X-Google-Smtp-Source: ACJfBotJWz9uGylSNjF1OQooNqSz3uhSe60PCP7RTT9z8+ODlrbiJJtAECq1McB9MH5hseUvrLiwwQ== X-Received: by 10.200.24.197 with SMTP id o5mr14272694qtk.79.1515379589858; Sun, 07 Jan 2018 18:46:29 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:35 -0300 Message-Id: <20180108024558.17983-7-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 06/29] hw/isa: add a generic isa_superio_init() 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/superio.h | 17 +++++++++++++++++ hw/isa/isa-superio.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 2 ++ hw/isa/Makefile.objs | 1 + 4 files changed, 65 insertions(+) create mode 100644 include/hw/isa/superio.h create mode 100644 hw/isa/isa-superio.c diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h new file mode 100644 index 0000000000..e685b96653 --- /dev/null +++ b/include/hw/isa/superio.h @@ -0,0 +1,17 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_ISA_SUPERIO_H +#define HW_ISA_SUPERIO_H + +#include "hw/isa/isa.h" + +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count, + int parallel_count, int drive_count); + +#endif diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c new file mode 100644 index 0000000000..93d8457c6b --- /dev/null +++ b/hw/isa/isa-superio.c @@ -0,0 +1,45 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "sysemu/blockdev.h" +#include "hw/isa/superio.h" +#include "hw/char/serial.h" +#include "hw/char/parallel.h" +#include "hw/block/fdc.h" +#include "hw/input/i8042.h" + +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count, + int parallel_count, int drive_count) +{ + serial_hds_isa_init(isa_bus, 0, serial_count); + + parallel_hds_isa_init(isa_bus, parallel_count); + + if (drive_count) { + DriveInfo **fd; + int i; + + if (drive_count > MAX_FD) { + warn_report("superio: ignoring %d floppy controllers", + drive_count - MAX_FD); + drive_count = MAX_FD; + } + fd = g_new(DriveInfo *, drive_count); + + for (i = 0; i < drive_count; i++) { + fd[i] = drive_get(IF_FLOPPY, 0, i); + } + fdctrl_init_isa(isa_bus, fd); + + g_free(fd); /* FIXME */ + } + + return isa_create_simple(isa_bus, TYPE_I8042); +} diff --git a/MAINTAINERS b/MAINTAINERS index 7f9e98a046..6f867da743 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -875,6 +875,7 @@ F: hw/input/pckbd.c F: hw/intc/apic* F: hw/intc/ioapic* F: hw/intc/i8259* +F: hw/isa/isa-superio.c F: hw/misc/debugexit.c F: hw/misc/pc-testdev.c F: hw/timer/hpet* @@ -885,6 +886,7 @@ F: include/hw/display/vga.h F: include/hw/char/parallel.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h +F: include/hw/isa/superio.h F: include/hw/input/i8042.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs index fb37c55cf2..cac655ba58 100644 --- a/hw/isa/Makefile.objs +++ b/hw/isa/Makefile.objs @@ -1,4 +1,5 @@ common-obj-$(CONFIG_ISA_BUS) += isa-bus.o +common-obj-$(CONFIG_ISA_BUS) += isa-superio.o common-obj-$(CONFIG_APM) += apm.o common-obj-$(CONFIG_I82378) += i82378.o common-obj-$(CONFIG_PC87312) += pc87312.o From patchwork Mon Jan 8 02:45:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dscQdBiv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKhf1qTxz9ryr for ; Mon, 8 Jan 2018 13:58:10 +1100 (AEDT) Received: from localhost ([::1]:59426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNdY-0008HG-8T for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:58:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSR-0006ms-AP for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSO-0002Of-8e for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:39 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:41722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSO-0002OV-3g for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:36 -0500 Received: by mail-qt0-x244.google.com with SMTP id i40so12055850qti.8 for ; Sun, 07 Jan 2018 18:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OyXBDoIQWzI2frpS1vRP6vtUZc5iSiVS21RSq72TzP4=; b=dscQdBiv/pGpMuCHAFTTYOX8V09fsHTKRYYyjzPCA8UCbMvE4zg3mMoYbJjeYeeEhl peMo/GJGATSbcFb96q6ytuhfRxfRZrhbnN0GV8MMVM+ElbLT8G7bTqurdPk7SSzroBWk Ehm0jq6syvLWnJFftq3I+SgRSeu3gujySTfeqEfISQNUeMFt9hPvAbA1v8H6FEa4xCAT XlhAcpHNr8nYekmo1Uaa3Gmd8nsAMNdKMmp765beXWtk8wf6MORuRx0uqXKQBjV9riiE YDk+9gFpfwHvlUZlqb6hhz+KCSzarTIwozuX2I9eO/Q87hd2pGYAhhr5ISEhjM9avZ5/ sGkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OyXBDoIQWzI2frpS1vRP6vtUZc5iSiVS21RSq72TzP4=; b=RbBoVIuTBApl8ryYlfzMo66ioBpaKETMg3vMFDr3l0x9LBLK6/5YmSBdJ9QQzdAYtc /E0uzPPHPGZ3t9SQZZyP09QA5EAzxwtrw64GYH7mCCyq+GrntWIG8t/CDI9ukHswT+sA C01CrxONj0jijyUH8K9pjfvpPRrzTQccnI5S3pnzRE1r2zYMa9AAtSducUD6L4884t7e MXOKe8uyuuaxAoiSfcdWvFJIlsKyMnELGxRO/0gjYGS3bCzEC35zUUVrHu+XnEhVEot/ NKDgkp3QleYV+IBNvNTttyr56Bnwx/gmUZg7gSNXdSPVohZfufZDgudJ/4ScfiOqxdx6 v/cQ== X-Gm-Message-State: AKwxytfaH35raiVI2OiSyM7kYMmWcwNk9b6/OWHuuS1vEpl/8CWm/Stn CaH+J5Xi0l1c+g/Jigr1ueE= X-Google-Smtp-Source: ACJfBou5VTLSUKkSBKYngLW+c6tPxBfZkB5HetL0rKoJjuP25D7aUnNW1bn6ofUAy2xgbOf1AUxg3g== X-Received: by 10.200.42.196 with SMTP id c4mr14505545qta.208.1515379593394; Sun, 07 Jan 2018 18:46:33 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:36 -0300 Message-Id: <20180108024558.17983-8-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 07/29] hw/i386/pc: use isa_superio_init() 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: Igor Mammedov , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e5c4e48ebb..f9479351f3 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -24,12 +24,9 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/i386/pc.h" -#include "hw/char/serial.h" -#include "hw/char/parallel.h" #include "hw/i386/apic.h" #include "hw/i386/topology.h" #include "sysemu/cpus.h" -#include "hw/block/fdc.h" #include "hw/ide.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" @@ -41,6 +38,7 @@ #include "multiboot.h" #include "hw/timer/mc146818rtc.h" #include "hw/dma/i8257.h" +#include "hw/isa/superio.h" #include "hw/timer/i8254.h" #include "hw/input/i8042.h" #include "hw/audio/pcspk.h" @@ -1523,7 +1521,6 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, uint32_t hpet_irqs) { int i; - DriveInfo *fd[MAX_FD]; DeviceState *hpet = NULL; int pit_isa_irq = 0; qemu_irq pit_alt_irq = NULL; @@ -1586,11 +1583,9 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, pcspk_init(isa_bus, pit); } - serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); - parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); - a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2); - i8042 = isa_create_simple(isa_bus, "i8042"); + i8042 = isa_superio_init(isa_bus, MAX_SERIAL_PORTS, 1, + create_fdctrl ? MAX_FD : 0); i8042_setup_a20_line(i8042, a20_line[0]); if (!no_vmport) { vmport_init(isa_bus); @@ -1608,14 +1603,6 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, g_free(a20_line); i8257_dma_init(isa_bus, 0); - - for(i = 0; i < MAX_FD; i++) { - fd[i] = drive_get(IF_FLOPPY, 0, i); - create_fdctrl |= !!fd[i]; - } - if (create_fdctrl) { - fdctrl_init_isa(isa_bus, fd); - } } void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus) From patchwork Mon Jan 8 02:45:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jTejRKnl"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKSN49SPz9s7n for ; Mon, 8 Jan 2018 13:47:32 +1100 (AEDT) Received: from localhost ([::1]:59321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTG-0006qw-Lo for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:47:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSR-0006mt-Av for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSP-0002P4-Br for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:39 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:39486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSP-0002Ov-7R for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:37 -0500 Received: by mail-qt0-x242.google.com with SMTP id k19so12087600qtj.6 for ; Sun, 07 Jan 2018 18:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V79M0vlxWnlAkroOVqDurfjyeopATnekif/q2z8wcgU=; b=jTejRKnlOYB6oC0cGaE5Wq8TIkO7/fTLRUvFNLm4Ul7XZkDcPK2aedLEm85LDShJCg dhMZNCVNZpOBB1Yr74S0lqk/xhtysHvXDIDaOTl+nrhR2qGHXf2uM+2Ffm7nc+ap6Y6o 9d16s3jT57w1GHyzZyEkxby+rf2Kjet3x9q8jdIVNNzAqe596bP/nxZ4dDdm8TWi2uM6 +CrJCSbk0yVq1WFRNVaNWkyPIqgCt1LDQlLcqEIcHTPYCgiy2q5lJNbiLz+YKqwWfXDA T592SyIQeQojIUIqGe/YLSlEDnKKW8iCylUE7+oOV3I8DNCDcGTBRyGYhU8ELEGmuV5U ZRmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=V79M0vlxWnlAkroOVqDurfjyeopATnekif/q2z8wcgU=; b=DJsa0hyQSfhiPcFN0RjsGDzV2/SG9POZ7cU9+rx2l+IPG5iiNo0oZ9pWpvGGeWjNTg hA9mcerGYShepPkrCXLn66GTgGU/L1O6FylSiLLd3fc2ndyRcCEqBxmTbJGNj5kizEh2 9yhfvaKhM/khYSCORspu42NLK3cul+8Vye9ktWfD5vLNBZaB6JQuVnFLkHjqr5QS25zE ZHNZ5+/5mUeEsWj2lZEOSwSXhvbZkYU45KfurUoreDFZ1V3aaXXdSUaHLZVk56zg7tny SRscLL74wTgG9CnFhkWqQwir1qiL5TOWdxY4SwTOS9/0jThBStcNGLmYuOBR35x5Yscx Sk1A== X-Gm-Message-State: AKwxytf8CWE1fDHTP5M7fEaKRp7AsvUvH1nRfKRzqroAXTE0tNbC5MZ1 y2xMnyfnvANg6YUHYMfiFaU= X-Google-Smtp-Source: ACJfBoug/GQiSaAuW24bupr+zycgufJHf1dw4FVyLruejp+97Mkoaol8yusu49XM95fVx1ElhgvYzQ== X-Received: by 10.237.56.164 with SMTP id k33mr13726135qte.276.1515379596682; Sun, 07 Jan 2018 18:46:36 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum , Yongbok Kim Date: Sun, 7 Jan 2018 23:45:37 -0300 Message-Id: <20180108024558.17983-9-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 08/29] hw/mips/fulong2e: use isa_superio_init() 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/mips_fulong2e.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 8660d078c8..2f4cc5d05e 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -23,13 +23,10 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/dma/i8257.h" -#include "hw/char/serial.h" -#include "hw/char/parallel.h" -#include "hw/block/fdc.h" +#include "hw/isa/superio.h" #include "net/net.h" #include "hw/boards.h" #include "hw/i2c/smbus.h" -#include "sysemu/block-backend.h" #include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" @@ -44,7 +41,6 @@ #include "hw/isa/vt82c686.h" #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" -#include "hw/input/i8042.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" @@ -366,13 +362,10 @@ static void mips_fulong2e_init(MachineState *machine) i8257_dma_init(isa_bus, 0); /* Super I/O */ - isa_create_simple(isa_bus, TYPE_I8042); + isa_superio_init(isa_bus, MAX_SERIAL_PORTS, 1, 0); mc146818_rtc_init(isa_bus, 2000, NULL); - serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); - parallel_hds_isa_init(isa_bus, 1); - /* Sound card */ audio_init(pci_bus); /* Network card */ From patchwork Mon Jan 8 02:45:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GxSXG9lg"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKSc0xhtz9s82 for ; Mon, 8 Jan 2018 13:47:44 +1100 (AEDT) Received: from localhost ([::1]:59324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTS-00071y-5v for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:47:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNST-0006pV-Rt for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNST-0002RQ-4e for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:41 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:47093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSS-0002R2-WB for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:41 -0500 Received: by mail-qt0-x241.google.com with SMTP id r39so12053430qtr.13 for ; Sun, 07 Jan 2018 18:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kEw6fJIOLjx1iG1GEgavYsjnjGhVwVBiUq73JJhPHgo=; b=GxSXG9lgmziBJGRSUuQ2KVVKDN057ndsko2Parq2ZgUfpvJTpOZymPtxdvVR3c5sPh tTxN+In9O5hnrJuSYyCxDGasJEOKuRkeUUmTOcv02Ap9jsPWc4DZNmxadh8LrHcdQFx6 x8MO9BazlB+7+kG2dIwTVp9hdb10Z7EjSJTSRuYbKnFeZ6ClmMdAO8ID6s2mybBDEEJV fAXczrgB8nudJLNJYhDFBIFvcPNo6Qs7TljyvInC9nFgFSTBTDspWVR9M8SbyKwzOKeh QqwHG4KeRt5vvXpNTQAHDpZ39ImqYmygWO1xQ0cvadYx/48ZH5qX9X9aBuO4WKxwHOGg bLBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kEw6fJIOLjx1iG1GEgavYsjnjGhVwVBiUq73JJhPHgo=; b=fVZnbxsO5Pyt3rP9UZY4dI+dvgNcNPUgtJHbCCwYP3aeOn/Fk/Ye8EViwAf0nu7Ozj ZEKPeb4vWX6Vkgwic7igppK9aPt1Ir79x5Br+y1ubT6hhsOByHiAthZX8gA/8TZfA/cR 4znhQ1b9LiSrQzVfhaTLP3zSlds3k0ajt/tOvTqQGq5SgSTF6mKAxEP49oex06SyZ039 j1j2Y1EWYQVin8QzJ72X2BCMOiNv8me97r7i4kermUzEwsHUSldHzztCSImlgn/rFPjf /tvdXxyKquFPR1BvXLD2xEj85H4FVaxDW7sZsWZL45Rd8QduKov6desePEcGUugli9ds IJMA== X-Gm-Message-State: AKwxytfRXRRzXgInTUNvNUqrnFEzEGukaczeYz1JdvwFtVzJvr196PXm Thl3YCcC14Wa4ZOAjRVsYx4= X-Google-Smtp-Source: ACJfBosb26RCvZNJvB1YRN1lpAuVm4m6Pf4Gmwbr9wv26C15B1B5V+tfd9LJBhIsUtPneVnnPfcTPw== X-Received: by 10.200.52.171 with SMTP id w40mr14653759qtb.205.1515379600496; Sun, 07 Jan 2018 18:46:40 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:38 -0300 Message-Id: <20180108024558.17983-10-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 09/29] hw/mips/malta: code movement 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: Igor Mammedov , Yongbok Kim , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/mips_malta.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 28cc37ee08..195d7dd59e 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1063,10 +1063,6 @@ void mips_malta_init(MachineState *machine) memory_region_add_subregion(system_memory, 512 << 20, ram_low_postio); } - /* generate SPD EEPROM data */ - generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size); - generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]); - #ifdef TARGET_WORDS_BIGENDIAN be = 1; #else @@ -1209,15 +1205,19 @@ void mips_malta_init(MachineState *machine) pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL); - smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); - g_free(smbus_eeprom_buf); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); + mc146818_rtc_init(isa_bus, 2000, NULL); + + /* generate SPD EEPROM data */ + generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size); + generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]); + smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); + g_free(smbus_eeprom_buf); /* Super I/O */ isa_create_simple(isa_bus, TYPE_I8042); - mc146818_rtc_init(isa_bus, 2000, NULL); serial_hds_isa_init(isa_bus, 0, 2); parallel_hds_isa_init(isa_bus, 1); From patchwork Mon Jan 8 02:45:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="atUznCc6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKnM5TNJz9s71 for ; Mon, 8 Jan 2018 14:02:14 +1100 (AEDT) Received: from localhost ([::1]:59463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNhT-0003Er-V8 for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:02:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSX-0006so-DS for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSW-0002UO-C6 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:45 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:45868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSW-0002U9-7y for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:44 -0500 Received: by mail-qt0-x243.google.com with SMTP id g10so12057518qtj.12 for ; Sun, 07 Jan 2018 18:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2M4CPDtQw804+K03gLhnzrLOY4ogYrHD0fbnsgknilU=; b=atUznCc6i6Cy04yVUK+Sm9L1tQRY5tMsMtMRRxYxAoirWjEwl7K78tMUI0vaJCE9aX e47XGjV+kUlJaZ//EacN0jIGISZ9HukOHUyHFIFc7vRXFau0naFJBBaUyLZvfICakOZZ b5ASWWpp7C25/KxI0ueypGY3Py6OIlQhpKKCHgs17xU/uhutu8uqf8Qg43VabGq74aWV LxI9vf0XKLdGNONj9jge8h98Yf/si1kZSkuiQdUJrqpDavJ6G6+wH5BwcfC1Nbr1u6QC Z0jJdYDiBUEhM1rR9iH1NezpcK1HTt8uN8AkKw/9HqEUi05/FnJx231+AzIWr92Atz01 DjJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2M4CPDtQw804+K03gLhnzrLOY4ogYrHD0fbnsgknilU=; b=jp0klXeJgI2b6kNtRemdZtbhlK4n3EBk9+8Jod3NTq/NjZtGUiVqnOMbjMZOiEyC3M wD/LlsHZ/QSjcwjCe6cFJNKHzM3F4BChOCDEC3BMWIF7dDYlfd10qGPND00lYvvsN9IR xjSRdGw1yyxxbuGonKXNO0Ss230DzT6V2ShxygJKaES1Xgee+WCiyEGBOv8lYSegN2dY zirSuusSn5mGl3CmxVBbfZibcfiV7PpALVt/ZKKyvGIKYrwxSQCV/wVnPqUd8DKJRMs+ QYpJZ/hQ+hqIs3i3P5NMYkvftEzAGJcnGC9Q4Zx3NT7na/jhA/A/lsxMwZ715PpVzy0R pPzg== X-Gm-Message-State: AKwxytehVYqXGNVuxdi4pfICGv9BD9kOaYs2uNVABebfKRy9CLtp7NU3 cHgTK8kQWIMC6OBhPTQdzQ4= X-Google-Smtp-Source: ACJfBovmb4HvWs+xHf7vizbj+akoA3R/N5uHxyIO3qwzA3er9RJ5Pa1giacVTk3eBC+L+iLvvwmTEg== X-Received: by 10.200.51.185 with SMTP id c54mr14257926qtb.177.1515379603765; Sun, 07 Jan 2018 18:46:43 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:39 -0300 Message-Id: <20180108024558.17983-11-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 10/29] hw/mips/malta: add fdc37m81x_init() which uses isa_superio_init() 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: Igor Mammedov , Yongbok Kim , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/mips_malta.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 195d7dd59e..bfa79c374d 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -27,14 +27,12 @@ #include "cpu.h" #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/isa/superio.h" #include "hw/dma/i8257.h" #include "hw/char/serial.h" -#include "hw/char/parallel.h" -#include "hw/block/fdc.h" #include "net/net.h" #include "hw/boards.h" #include "hw/i2c/smbus.h" -#include "sysemu/block-backend.h" #include "hw/block/flash.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" @@ -47,7 +45,6 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" -#include "hw/input/i8042.h" #include "hw/timer/i8254.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" @@ -980,6 +977,16 @@ static void mips_create_cpu(MaltaState *s, const char *cpu_type, } } +#define FDC37M81X_SERIAL_COUNT 2 +#define FDC37M81X_DRIVE_COUNT 2 +#define FDC37M81X_PARALLEL_COUNT 1 + +static ISADevice *fdc37m81x_init(ISABus *isa_bus) +{ + return isa_superio_init(isa_bus, FDC37M81X_SERIAL_COUNT, + FDC37M81X_PARALLEL_COUNT, FDC37M81X_DRIVE_COUNT); +} + static void mips_malta_init(MachineState *machine) { @@ -1008,7 +1015,6 @@ void mips_malta_init(MachineState *machine) int i; DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; - DriveInfo *fd[MAX_FD]; int fl_idx = 0; int fl_sectors = bios_size >> 16; int be; @@ -1215,16 +1221,8 @@ void mips_malta_init(MachineState *machine) smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); g_free(smbus_eeprom_buf); - /* Super I/O */ - isa_create_simple(isa_bus, TYPE_I8042); - - serial_hds_isa_init(isa_bus, 0, 2); - parallel_hds_isa_init(isa_bus, 1); - - for(i = 0; i < MAX_FD; i++) { - fd[i] = drive_get(IF_FLOPPY, 0, i); - } - fdctrl_init_isa(isa_bus, fd); + /* SuperI/O: SMS FDC37M817 */ + fdc37m81x_init(isa_bus); /* Network card */ network_init(pci_bus); From patchwork Mon Jan 8 02:45:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Yi6gu94Q"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKWj1qHGz9s7n for ; Mon, 8 Jan 2018 13:50:25 +1100 (AEDT) Received: from localhost ([::1]:59336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNW3-0000uh-A5 for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:50:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSa-0006vb-JV for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSZ-0002Vh-GX for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:48 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:44107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSZ-0002VY-Cq for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:47 -0500 Received: by mail-qk0-x244.google.com with SMTP id v188so12535823qkh.11 for ; Sun, 07 Jan 2018 18:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XDFVDszPM59jDh1dUr6/6FsEEUzm7pgA8ycgI6wOzf0=; b=Yi6gu94QfLSqlNOnG60z7TUW19RsuFwpsaLh/iUWoWN+k6PhsO/8YYuQN2F/H2A5Pq vdjmz5b6RDqXaK0Kk6cb+hImj6lgviwiPgEV+fYPZpCY6aEzN0KERRYL2VPPFJ+u0Y25 iP+ujr6lOnMt25RONZOFwtWXOecrWEJKeo3t6U4GRrpTPi6+B3+vyqO9Gyt8GMBoTtKQ GI62IJG6wQUeZj+1Cdc/bcw733smOH5kl43rT0lnAxXduWrhnSkUMunTEtqa1SlvMWCE B8POtpg3RN9Fl62q3MmcQq1KD/m8KZXlA59HQc9JcmQuZ2hKhz2bWgELttumrpS+TlX2 z7Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XDFVDszPM59jDh1dUr6/6FsEEUzm7pgA8ycgI6wOzf0=; b=XiMjEacN8q1lCzlknexezlIJniEpaU1hRVkI+13zmKZQJ+Yq+yRN/rAbO9Gq7AQ6sS mixWa0T6XcpSQZPBBL7oLsDtwk0n1NHu/MNFHRFltBEJRfg83e3Jz75RgjZTw6ARY3ld y0lLSh5yXkbcLVWqOkf5ksoZ2d4o0tz24K1b4IDxL1uHLWnZemGn5Tk7RpzmPQZeMtlx oGx0zuryc0ploxgDBNXVWQGWYt2UQ6ycqpZduvy8NS+M5g+5FWooHwNhbqOlKlFcaNbf HqhkAx/EtNrqru571Dw/Cug3OdTdC41S1cDYEwDe477ViZ99MdTTuNFlcOUUKJbJGL7M MJ/A== X-Gm-Message-State: AKwxytfG95Uho0ZzMNFzjkvOGgecfJebp2cla/v2GxwpY+hUMn4FcMeM ebS58RRtSbCzDCppUWzHYYs= X-Google-Smtp-Source: ACJfBovsjyfz1v7PICymkeTF+3KpIsCOUcq7Tjt+f51IH4m4jGFpJAnMPGqZHRHslVJxqhwyY+wcjQ== X-Received: by 10.55.217.132 with SMTP id q4mr12383067qkl.236.1515379606879; Sun, 07 Jan 2018 18:46:46 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:40 -0300 Message-Id: <20180108024558.17983-12-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 11/29] mc146818rtc: always register rtc to rtc list 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau We are not required anymore to use rtc_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/timer/mc146818rtc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 35a05a64cc..b0027e8f62 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -997,17 +997,16 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) OBJECT(s), "date", NULL); qdev_init_gpio_out(dev, &s->irq, 1); + QLIST_INSERT_HEAD(&rtc_devices, s, link); } ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) { DeviceState *dev; ISADevice *isadev; - RTCState *s; isadev = isa_create(bus, TYPE_MC146818_RTC); dev = DEVICE(isadev); - s = MC146818_RTC(isadev); qdev_prop_set_int32(dev, "base_year", base_year); qdev_init_nofail(dev); if (intercept_irq) { @@ -1015,7 +1014,6 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) } else { isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); } - QLIST_INSERT_HEAD(&rtc_devices, s, link); return isadev; } @@ -1046,8 +1044,6 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) dc->reset = rtc_resetdev; dc->vmsd = &vmstate_rtc; dc->props = mc146818rtc_properties; - /* Reason: needs to be wired up by rtc_init() */ - dc->user_creatable = false; } static void rtc_finalize(Object *obj) From patchwork Mon Jan 8 02:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qCvHRpdf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKry4ZHfz9s71 for ; Mon, 8 Jan 2018 14:05:22 +1100 (AEDT) Received: from localhost ([::1]:59575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNkW-0005jv-Ld for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:05:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSd-0006yC-Al for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSc-0002XM-Jr for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:51 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:40334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSc-0002XF-FQ for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:50 -0500 Received: by mail-qk0-x243.google.com with SMTP id d18so2145448qke.7 for ; Sun, 07 Jan 2018 18:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uydIT8gqvnn8TqxGE/MpxbAQQJWpZ4BDA+4Odyh42bY=; b=qCvHRpdf5D7NnT/pqU6+E3J0TZFAvBb6jYGn7lj/batiMuXQtoog9wj9h04hSL130o d9l/m1hMKhPN1yoOmeZxo993D39icVF+punM63KpGiWVJQIZQ1E702kZd7bAtiZ2DUzw 6DqpagouMv/Q8fGN5329LkxxYpeqr13wyLwlsbQdwrpebxErHe5qSLSJxHxk/fd2XFiT 3U/TrqH2CC+g0uhRCPGEAIXLJIEXZRUzhZPB/BCuwsH0HMYlzC3Pmyov5zwmEBnI5ZWR 1WKUSqv0IiaU1wjH98FTgTXNzyBU92mLhrrrzPRcZ+xVrGG7SgG0bdL7IUFLQ2hlRxMt UVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uydIT8gqvnn8TqxGE/MpxbAQQJWpZ4BDA+4Odyh42bY=; b=QATMSkzzPy8kFZ7Zt0JqMoGK5clfMyA1wm0gp4j1PAx2buX0LNgqlVEShDjr8/cNkL UDWkVOK/x6TgyCdih0koqbtN3mLjznRyPAMZvCgHM+yhL4qoxar03us7UkaZgqloPikL AnC85yfbxdIPQ592CWo9euHd+19uFSZTq2JOvEs1MWfEzBe/C4YiJT0QMcvoVAxNafF8 Y4wy5BSImkTIrgbzATpJ+Av2tiHRjK3jlb0fXv4uFlw8vz0VSqlWIhZ8kyChnhAg4arO 00Y7ZcNhrskbMsWJxvbdZRfPMTowcV023xrNMgrsq3yeE92G9+iJJMfVZ8JwJf1vq8DL Sxyw== X-Gm-Message-State: AKwxytf8Pki9RC6e9V9D1a4dM20HQiXJ5hkML+v3Qkxn2WsmdWRTjBFA OblPsRYPrmZgXKGxcTNys9I= X-Google-Smtp-Source: ACJfBots0iNi6gQUTe0a867steJvFMi/xJAKAPFGYBgPjBUu3hejVqFu5zy9stEOpDOdioZPhDbXww== X-Received: by 10.55.136.135 with SMTP id k129mr14657654qkd.3.1515379609996; Sun, 07 Jan 2018 18:46:49 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:41 -0300 Message-Id: <20180108024558.17983-13-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 12/29] piix4: rename some variables in realize function 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau PIIX4 structure is now 's' PCI device is now 'pci_dev' DeviceState is now 'dev' Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 6b8bc3faf0..7b231b704b 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -87,16 +87,17 @@ static const VMStateDescription vmstate_piix4 = { } }; -static void piix4_realize(PCIDevice *dev, Error **errp) +static void piix4_realize(PCIDevice *pci_dev, Error **errp) { - PIIX4State *d = PIIX4_PCI_DEVICE(dev); + DeviceState *dev = DEVICE(pci_dev); + PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); - if (!isa_bus_new(DEVICE(d), pci_address_space(dev), - pci_address_space_io(dev), errp)) { + if (!isa_bus_new(dev, pci_address_space(pci_dev), + pci_address_space_io(pci_dev), errp)) { return; } - piix4_dev = &d->dev; - qemu_register_reset(piix4_reset, d); + piix4_dev = pci_dev; + qemu_register_reset(piix4_reset, s); } int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) From patchwork Mon Jan 8 02:45:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gyi+nOyP"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKb15nstz9s7n for ; Mon, 8 Jan 2018 13:53:17 +1100 (AEDT) Received: from localhost ([::1]:59376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNYp-0003Sx-Pz for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:53:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSg-0006zY-ES for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSf-0002Yn-NB for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:54 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:43133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSf-0002Yc-Id for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:53 -0500 Received: by mail-qt0-x243.google.com with SMTP id w10so12061456qtb.10 for ; Sun, 07 Jan 2018 18:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HNW4/gvFil7lDbbY47/WAmP4CZ8NxhCc5olKTRqzabg=; b=gyi+nOyPAUucBDfJn4+rRhxxkg89leiAk6aWbS6R1bdpbc7UnEiShgwWz3tUm3ckcz ZQQiNyV0wEsd0inDOcnTL1kaKEGu9fJoJa7BLkUZycXfSRSCD5M/rssWR8Y9Jc6zmWhj G1DWB//WrH1FLX9sFQiL2oawvt0yS3TZO9D6xvEai0r2+hRhnD+E7l2pKvDoVf2d19U4 ksI0RXVcz38s94DrfGltZVRTiMSC/iztLonIoJmbd5IlpxtpQItJO07YAoWIaib/BjoP IJPPdIhZ1pFXjOoRqL1JQ7/02Ej0gMUmA8fOJqLi6yTIYmzUSGC9/YdjK3h1xEqLS8e4 BF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HNW4/gvFil7lDbbY47/WAmP4CZ8NxhCc5olKTRqzabg=; b=CTYuFQ88dFMqouUeGFH/ihghqzczwWkqXK6BTRKi2xviQ9fRdtOvl7ii99C2i4Jijh SdXjcLEtoTCM3gAgr58KH3tMwOqlCEiueNNKtNgPunDla3OK+Y/zPHfeUFQrJ8zOvW4S tKWoOUccGzv11CRN2gOJ73I3Fa5NdrsxdrFtw42WfDudk6VjKHbOSBjUI3m3n3XG4wet WxGYkSjds5y4PxeT8zDqH/ud6U/G9XgxrI29BOGOVorRFrj94lzU/6FP/p4PihHFuwX3 h4nYiCQROMi3TTlj9HdAAT4RWsttyXiJbs6KeuX8J/JdFj+HrCNZNjMhJZJhBccP3+Ya Qj1Q== X-Gm-Message-State: AKwxytfdJrlLERlh/Enh7ofzE9YPLOULUIY8HxPbJHfG/0NyjebPDZx3 F83+28l0zLmrzOtERa5HljU= X-Google-Smtp-Source: ACJfBot9oOSxfB8kEC2fJMryziPRKjPhgqEi1NrADtOMUR7NuJnPzqCnubMb4SMcnYFwhGgrUtg5yg== X-Received: by 10.237.42.198 with SMTP id t64mr13830564qtd.132.1515379613091; Sun, 07 Jan 2018 18:46:53 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:42 -0300 Message-Id: <20180108024558.17983-14-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 13/29] piix4: convert reset function to QOM 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 7b231b704b..314f7f7359 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -39,10 +39,10 @@ typedef struct PIIX4State { #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) -static void piix4_reset(void *opaque) +static void piix4_reset(DeviceState *dev) { - PIIX4State *d = opaque; - uint8_t *pci_conf = d->dev.config; + PIIX4State *s = PIIX4_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; pci_conf[0x04] = 0x07; // master, memory and I/O pci_conf[0x05] = 0x00; @@ -97,7 +97,6 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) return; } piix4_dev = pci_dev; - qemu_register_reset(piix4_reset, s); } int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) @@ -118,6 +117,7 @@ static void piix4_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; k->class_id = PCI_CLASS_BRIDGE_ISA; + dc->reset = piix4_reset; dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix4; /* From patchwork Mon Jan 8 02:45:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rMPM8bwn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKw01738z9s7n for ; Mon, 8 Jan 2018 14:07:58 +1100 (AEDT) Received: from localhost ([::1]:59930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNn2-0008I1-5y for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:07:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSj-00072r-MI for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSi-0002cc-RW for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:57 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:39182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSi-0002c5-MZ for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:56 -0500 Received: by mail-qk0-x243.google.com with SMTP id r8so8244073qke.6 for ; Sun, 07 Jan 2018 18:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pAgvLUCO+EF1HuNrh0zdqYdEE2+70gvpBwJ+DSvZcHM=; b=rMPM8bwnBSHInKV2N5femdmz+iyDtuAnihO7qmetDWtO1xDls97504n2NxS2KKluJv 6vBY6sBDiRTUZIDhTt0B7FlPY+uG7g0tsdwWydbULmSGBvdkyWHJCjMKKkfjYLfmBR1j qHLN27IWNaJn0+1KaVSnEDvzu57SFJ2SEnMjrtPOWUFTYH7iLQerohXbdg63Ij1ROmbu 71MGSVlq8AXFfRsEnpU5FSuuogeuZKgmpiUXVWlrsW1GOugIsgp1/oJUeRVXI/7WubC7 CFCDakz8D5TGXDCed2jyHK7BvNFS/mbQGaVAEy64ny5HTN4AFwSvzFKuK5ZumAcgNnlL HxYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pAgvLUCO+EF1HuNrh0zdqYdEE2+70gvpBwJ+DSvZcHM=; b=pl6HU8RJZz4ycK6g8XByQpqzHBSnKJHBSMYXaClQ2Pr/UjtzzqF45bay68KCwf4zn6 NZQvyjD4mK3WUuJcdRM2Q4uyDdmN/33v/Hnq2KJx9pW4CTeyofSbMrjXzCNMFtacpxPD xruwL5n2dalenzndmuqq4ASbV0RmW697FPAnuoCPKB3vY9VeuVzPLIZozb1Sw+Q/Wp+L NlhpGz4GJZbfBQfh6BSfAM5/6F75slrxe9KU0AXCtKgWjEVXUPVIeyNpLDtjdb4/EKym 3+KOwGi2CrFRbGOm+1zMlDb9G7JrMPBRnY+obSTGn53SoO5zD587vKy2PV8MxPhubBxn 0eLQ== X-Gm-Message-State: AKwxytcU/5qHGBzFRVBHPovYNdp9Iy1QvasC3ffNto+zJpRsY8EX6+Qu 9WO4jbSJbtpDBqIqpON3f6c= X-Google-Smtp-Source: ACJfBotpg6y4toE37J3MNHgYH1Mq+tr4titxDs8DuYQt++aShrg6o2mZuT3p2HF1zZC2Y2j615n/Bg== X-Received: by 10.55.209.137 with SMTP id o9mr11944830qkl.234.1515379616189; Sun, 07 Jan 2018 18:46:56 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:43 -0300 Message-Id: <20180108024558.17983-15-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 14/29] piix4: add Reset Control Register 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau The RCR I/O port (0xcf9) is used to generate a hard reset or a soft reset. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 314f7f7359..13f4eaa2dd 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -2,6 +2,7 @@ * QEMU PIIX4 PCI Bridge Emulation * * Copyright (c) 2006 Fabrice Bellard + * Copyright (c) 2018 Hervé Poussineau * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,6 +34,10 @@ PCIDevice *piix4_dev; typedef struct PIIX4State { PCIDevice dev; + + /* Reset Control Register */ + MemoryRegion rcr_mem; + uint8_t rcr; } PIIX4State; #define TYPE_PIIX4_PCI_DEVICE "PIIX4" @@ -87,6 +92,34 @@ static const VMStateDescription vmstate_piix4 = { } }; +static void piix4_rcr_write(void *opaque, hwaddr addr, uint64_t val, + unsigned int len) +{ + PIIX4State *s = opaque; + + if (val & 4) { + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + s->rcr = val & 2; /* keep System Reset type only */ +} + +static uint64_t piix4_rcr_read(void *opaque, hwaddr addr, unsigned int len) +{ + PIIX4State *s = opaque; + return s->rcr; +} + +static const MemoryRegionOps piix4_rcr_ops = { + .read = piix4_rcr_read, + .write = piix4_rcr_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .impl = { + .min_access_size = 1, + .max_access_size = 1, + }, +}; + static void piix4_realize(PCIDevice *pci_dev, Error **errp) { DeviceState *dev = DEVICE(pci_dev); @@ -96,6 +129,12 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) pci_address_space_io(pci_dev), errp)) { return; } + + memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, + "reset-control", 1); + memory_region_add_subregion_overlap(pci_address_space_io(pci_dev), 0xcf9, + &s->rcr_mem, 1); + piix4_dev = pci_dev; } From patchwork Mon Jan 8 02:45:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vQuPvif9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKxb4RDpz9s71 for ; Mon, 8 Jan 2018 14:09:23 +1100 (AEDT) Received: from localhost ([::1]:60272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNoP-0001TN-No for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:09:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSn-00078c-K8 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSm-0002gh-Jq for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:01 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:35537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSm-0002gT-Dd for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:00 -0500 Received: by mail-qk0-x243.google.com with SMTP id w184so4359121qka.2 for ; Sun, 07 Jan 2018 18:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R9hCFeNlG3nHUXwQYsh5pac9rVBEjIdVIAPvmOJC+lU=; b=vQuPvif9Dj1TllKprfbleZLeBssTw7/0qaa2OMMKBMhv68DGZHuKNR3CaImZL3wjiC WQ29/ySnIrkyeVB/C3HkadnRJnV/p7wdCj6sF2DnCsCE29WB8lEbJNkW+exKOx5qoN9t mT2ks3o16mLsyECUSHSlP1NyCWkLOuk0OpgeefvaVTPXf/xlpvtl6GvJw9pcG/53iVRz tItKT+D7tGXFFVmh8tOatjKx62z2ov3+X2OLxP+Cb65rzv8T0YGvE11UU//zAlw4wBPj b2pSDxWPKPrxz0GjmWMkAU5KVmombura6OhQW8sr46wiroWt7y3H6kfKjQFJBFqJpshh m5yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R9hCFeNlG3nHUXwQYsh5pac9rVBEjIdVIAPvmOJC+lU=; b=TwmYshZUzYGAIr6LDjDrMWkiAGz5B2Q9hsaie39KeSiqWE+amjbcTZwG5z0VTSRBl1 7i1Otmn68F2MzzNP3D4eB3TDU7DrAdup6pdcpv1n6/bzPCN3ze+KUvWNaoqILdkUy0/8 GrCm9vxwzTAOHMCfwU/p0agMun4Jd8yrdj5B1R4o2hFiwhYr59/bBH5YXbSM0GTmfIaE qmMu6huOAta6+t2OcnjHQSXdoNOq3baPRWa+iL10cVgK+rg+VRX2DmccvW4N1CC9R3cN Lhbcxvyo3sMxprKbuAMe5TyRFadX2MBkNja8ZywHkO/2wL47Gak8FzcSwOhBxX9mDXcN d1DA== X-Gm-Message-State: AKwxytf5dej6b6L0jKn/SLQSt26m1R5crVurHSZ1tE4fQ08llX7Fv5QN +P+f5IsmsOkUsfYALnUXtbw= X-Google-Smtp-Source: ACJfBos29puPJiG3MDp7Y11ekue1IF6e4z3ChmL4Dqyuz//mDrrWNG4tWLTVcYG593ZDYJ/MTQdqAg== X-Received: by 10.55.204.18 with SMTP id r18mr14082153qki.212.1515379619853; Sun, 07 Jan 2018 18:46:59 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:44 -0300 Message-Id: <20180108024558.17983-16-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 15/29] piix4: add a i8259 interrupt controller as specified in datasheet 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: Igor Mammedov , Yongbok Kim , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau Add ISA irqs as piix4 gpio in, and CPU interrupt request as piix4 gpio out. Remove i8259 instanciated in malta board, to not have it twice. We can also remove the now unused piix4_init() function. Signed-off-by: Hervé Poussineau [PMD: rebased] Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - hw/isa/piix4.c | 38 ++++++++++++++++++++++++++++---------- hw/mips/mips_malta.c | 28 ++++++++++++---------------- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 103c7a9916..d2b67e44a7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -274,7 +274,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCIBus *find_i440fx(void); /* piix4.c */ extern PCIDevice *piix4_dev; -int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn); /* pc_sysfw.c */ void pc_system_firmware_init(MemoryRegion *rom_memory, diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 13f4eaa2dd..c19aa5a74f 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -34,6 +34,8 @@ PCIDevice *piix4_dev; typedef struct PIIX4State { PCIDevice dev; + qemu_irq cpu_intr; + qemu_irq *isa; /* Reset Control Register */ MemoryRegion rcr_mem; @@ -92,6 +94,18 @@ static const VMStateDescription vmstate_piix4 = { } }; +static void piix4_request_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->cpu_intr, level); +} + +static void piix4_set_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->isa[irq], level); +} + static void piix4_rcr_write(void *opaque, hwaddr addr, uint64_t val, unsigned int len) { @@ -124,27 +138,31 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) { DeviceState *dev = DEVICE(pci_dev); PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); + ISABus *isa_bus; + qemu_irq *i8259_out_irq; - if (!isa_bus_new(dev, pci_address_space(pci_dev), - pci_address_space_io(pci_dev), errp)) { + isa_bus = isa_bus_new(dev, pci_address_space(pci_dev), + pci_address_space_io(pci_dev), errp); + if (!isa_bus) { return; } + qdev_init_gpio_in_named(dev, piix4_set_i8259_irq, "isa", ISA_NUM_IRQS); + qdev_init_gpio_out_named(dev, &s->cpu_intr, "intr", 1); + memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, "reset-control", 1); memory_region_add_subregion_overlap(pci_address_space_io(pci_dev), 0xcf9, &s->rcr_mem, 1); - piix4_dev = pci_dev; -} + /* initialize i8259 pic */ + i8259_out_irq = qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); + s->isa = i8259_init(isa_bus, *i8259_out_irq); -int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) -{ - PCIDevice *d; + /* initialize ISA irqs */ + isa_bus_irqs(isa_bus, s->isa); - d = pci_create_simple_multifunction(bus, devfn, true, "PIIX4"); - *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(d), "isa.0")); - return d->devfn; + piix4_dev = pci_dev; } static void piix4_class_init(ObjectClass *klass, void *data) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index bfa79c374d..d31e144b70 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -96,7 +96,7 @@ typedef struct { SysBusDevice parent_obj; MIPSCPSState *cps; - qemu_irq *i8259; + qemu_irq i8259[16]; } MaltaState; static ISADevice *pit; @@ -1008,8 +1008,8 @@ void mips_malta_init(MachineState *machine) int64_t kernel_entry, bootloader_run_addr; PCIBus *pci_bus; ISABus *isa_bus; - qemu_irq *isa_irq; qemu_irq cbus_irq, i8259_irq; + PCIDevice *pci; int piix4_devfn; I2CBus *smbus; int i; @@ -1185,28 +1185,24 @@ void mips_malta_init(MachineState *machine) /* Board ID = 0x420 (Malta Board with CoreLV) */ stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420); - /* - * We have a circular dependency problem: pci_bus depends on isa_irq, - * isa_irq is provided by i8259, i8259 depends on ISA, ISA depends - * on piix4, and piix4 depends on pci_bus. To stop the cycle we have - * qemu_irq_proxy() adds an extra bit of indirection, allowing us - * to resolve the isa_irq -> i8259 dependency after i8259 is initialized. - */ - isa_irq = qemu_irq_proxy(&s->i8259, 16); - /* Northbridge */ - pci_bus = gt64120_register(isa_irq); + pci_bus = gt64120_register(s->i8259); /* Southbridge */ ide_drive_get(hd, ARRAY_SIZE(hd)); - piix4_devfn = piix4_init(pci_bus, &isa_bus, 80); + pci = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), + true, "PIIX4"); + dev = DEVICE(pci); + isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); + piix4_devfn = pci->devfn; /* Interrupt controller */ - /* The 8259 is attached to the MIPS CPU INT0 pin, ie interrupt 2 */ - s->i8259 = i8259_init(isa_bus, i8259_irq); + qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); + for (i = 0; i < 16; i++) { + s->i8259[i] = qdev_get_gpio_in_named(dev, "isa", i); + } - isa_bus_irqs(isa_bus, s->i8259); pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1); pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, From patchwork Mon Jan 8 02:45:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aAGwFlq9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKf75DlSz9ryr for ; Mon, 8 Jan 2018 13:55:59 +1100 (AEDT) Received: from localhost ([::1]:59414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNbR-0006OA-Py for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:55:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSs-0007DY-FV for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSq-0002lA-0J for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:06 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:43134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSp-0002l0-SC for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:03 -0500 Received: by mail-qt0-x243.google.com with SMTP id w10so12061767qtb.10 for ; Sun, 07 Jan 2018 18:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/RvJqlN2+piT0QB6kj4RaqGrBYycjmBaOoE+74QduwI=; b=aAGwFlq9FJcfHPtXzCaFvl239lmDESb5p3Qn+15Y2iZfiO0fEBe3dQET/G7IkqWVIu 9++PTvPOqsQNp0jy1KdAOlqe45rKOuHSR/4u/KOLX3jmJx20Bj7g7wZ5ccvz2EkwSWoQ YWSjysgDB2+6LOtMnZzAteG2Jtpmoa+++38p3ucOCH4JzwIESpbRwszJq3a1BTc6A19X 7aJHDZmSlJmEDmEWg0gHJNxBSl6UMs+s+sJRDa+0H082UVctfs3sedFdhQ7HV8SNzDZz qRUzj4XUbfavSdNWnlht4RizVEE5acFrvmwW/tiQIENwdR8tgERDirin2TEf4hLo2ke6 Urhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/RvJqlN2+piT0QB6kj4RaqGrBYycjmBaOoE+74QduwI=; b=UN1Q0KO3VDowlsm99UjgblERl3wPbKyWcxt0RpKf3VBjc+LgSBKL0jw4LYKwQnbc+J P1LdY5ZqWH0HiYxQ6EjgKSfYeJaE+hoSGKh10DCwmvEBF+49o7CPrHR/d3FsE4dOokCM ORWTq+EE5h3M/754kgCWo9X9PGkfSsEkAxtQ6DilfV8E/q/dU/xZd3oQo/q3UESF2wVI x+x0URkteeBc2tItwyUorI6KcsslIxbpmC9irN/fe/jehEUSWEE+U7ruWbwl+hfnVoLe JW16NV11fMojiKB3vEhEezO1rX/5fzSpOsuZElG2dmNmZTfsO2l59mPWjblewqiHTwtp Kuqw== X-Gm-Message-State: AKwxytd79McnFoBQz1jncWTTj36uhvOfLQJEKHyAjd86GFihlo49aPr0 dETKFkV3kZxL1Em6XCxJWBk0AWRL X-Google-Smtp-Source: ACJfBos1uXjBHSKSZ+Gses5qpTUhB37CB7pPMsYRvSIpmyUF9GRuULpr+FsP2KpXa+w+gbMHh3/EJQ== X-Received: by 10.200.35.6 with SMTP id a6mr14720101qta.311.1515379623380; Sun, 07 Jan 2018 18:47:03 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum , Peter Maydell Date: Sun, 7 Jan 2018 23:45:45 -0300 Message-Id: <20180108024558.17983-17-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [RFC PATCH 16/29] Revert "irq: introduce qemu_irq_proxy()" 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This function isn't used anymore. This reverts commit 22ec3283efba9ba0792790da786d6776d83f2a92. Signed-off-by: Philippe Mathieu-Daudé --- I think circular IRQ dependencies should be avoided with today's QOM devices. include/hw/irq.h | 5 ----- hw/core/irq.c | 14 -------------- 2 files changed, 19 deletions(-) diff --git a/include/hw/irq.h b/include/hw/irq.h index 4c4c2eaf9a..ee823177e6 100644 --- a/include/hw/irq.h +++ b/include/hw/irq.h @@ -53,11 +53,6 @@ qemu_irq qemu_irq_invert(qemu_irq irq); /* Returns a new IRQ which feeds into both the passed IRQs */ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2); -/* Returns a new IRQ set which connects 1:1 to another IRQ set, which - * may be set later. - */ -qemu_irq *qemu_irq_proxy(qemu_irq **target, int n); - /* For internal use in qtest. Similar to qemu_irq_split, but operating on an existing vector of qemu_irq. */ void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n); diff --git a/hw/core/irq.c b/hw/core/irq.c index b98d1d69f5..c8e96f122a 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -121,20 +121,6 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2) return qemu_allocate_irq(qemu_splitirq, s, 0); } -static void proxy_irq_handler(void *opaque, int n, int level) -{ - qemu_irq **target = opaque; - - if (*target) { - qemu_set_irq((*target)[n], level); - } -} - -qemu_irq *qemu_irq_proxy(qemu_irq **target, int n) -{ - return qemu_allocate_irqs(proxy_irq_handler, target, n); -} - void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n) { int i; From patchwork Mon Jan 8 02:45:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856677 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P2DJt+9+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKjD4YjHz9s82 for ; Mon, 8 Jan 2018 13:58:40 +1100 (AEDT) Received: from localhost ([::1]:59432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNe2-0000LQ-JV for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:58:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSu-0007FQ-EL for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSt-0002mc-Ji for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:08 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:34509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSt-0002mT-Ee for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:07 -0500 Received: by mail-qt0-x244.google.com with SMTP id 33so12079467qtv.1 for ; Sun, 07 Jan 2018 18:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SkgBRYF+Vfsu+2dJcRnSemO8p5LNSTPMjSVtAoxIXtU=; b=P2DJt+9+wNqgsVm4hzfO8HiB6fGcPogdYgVXUPoPuvGj636XQ5t7Z4/mN0mi25xdEq MlqI+nqcrrbpYyJztsIkQ0Cbdrj9A4qUmw+/FfLz6T9sMTHLwl96/u90c3L84DUTpdBY PUr7L5E9pjFkGm0UWKDkg2zb/DQptwySKcVs09pYg6WUir9czyG4CmVSEzPO774n+MUV bUzENI33grwsOoqAOzub+8DY9Ro7FUvwiSqhWk2Y04Y5dJCYEAqVeY82X1ttVUotTLgP MSBTyOBQQg6fdQYnvPQrIDZZviRkoOAHUuExJWBwmnki3zxhJPxhkXoU/c+KA4xqhWOn D1og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SkgBRYF+Vfsu+2dJcRnSemO8p5LNSTPMjSVtAoxIXtU=; b=ip6GTR9KLd4L++ne+iuB9Htu6STq3JkgluoX8pLQxjEw6THJRo9KTILCl8L6s/yCkn WqxRW5PvM0JGXqCAOyKnjuLKKJ1a6TWk6xswRRiNsDelMpKa1HnmvCj2A307LyEvujoc sCoHHUG5mdv5EduS8v2jEn22noByrDi5qB6H9ItHI89elsNcPEJvDCgu7oFHcajLgXp8 BYWsz7axseylMz1l/QQwajFLJvZojcbVanBFliBmSx0St+UMXNDRponMqgrGD2QVi4eP UwfUzWSfHtHIkIIyAfMUZN8Aad/w70gE23c19zRXq4Gqv/JAs9lXFNqTOuUZi2Xltku4 8xXA== X-Gm-Message-State: AKwxytd5harb1irghO8wW4xVqbQn/3H+CVIOGUUCXhVdRKpivmcBnEmE mauDqAq8UgOQmfeBnsoUNZs= X-Google-Smtp-Source: ACJfBosFrzNOVmne2NqtK5UFCsRVO0ObMcRrKjREnxyDQRRbxPPJQGov8hZvgkA0n5itdwA4F+giTQ== X-Received: by 10.237.44.7 with SMTP id f7mr14645044qtd.118.1515379626919; Sun, 07 Jan 2018 18:47:06 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:46 -0300 Message-Id: <20180108024558.17983-18-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 17/29] piix: move piix4 declaration into new southbridge/i82371_piix.h 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: Igor Mammedov , Yongbok Kim , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 -- include/hw/southbridge/i82371_piix.h | 17 +++++++++++++++++ hw/isa/piix4.c | 1 + hw/mips/gt64xxx_pci.c | 1 + MAINTAINERS | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 include/hw/southbridge/i82371_piix.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d2b67e44a7..195c02febe 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -272,8 +272,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, MemoryRegion *ram_memory); PCIBus *find_i440fx(void); -/* piix4.c */ -extern PCIDevice *piix4_dev; /* pc_sysfw.c */ void pc_system_firmware_init(MemoryRegion *rom_memory, diff --git a/include/hw/southbridge/i82371_piix.h b/include/hw/southbridge/i82371_piix.h new file mode 100644 index 0000000000..95ac25becd --- /dev/null +++ b/include/hw/southbridge/i82371_piix.h @@ -0,0 +1,17 @@ +/* + * Intel 82371 PIIX South Bridge Emulation + * + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_ISA_PIIX_H +#define HW_ISA_PIIX_H + +#include "hw/pci/pci.h" + +/* piix4.c */ +extern PCIDevice *piix4_dev; + +#endif /* HW_ISA_PIIX_H */ diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index c19aa5a74f..b0f6a0a342 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -28,6 +28,7 @@ #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/isa/isa.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/sysbus.h" PCIDevice *piix4_dev; diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 5a9dad9aae..24cc4044d7 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -28,6 +28,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/i386/pc.h" +#include "hw/southbridge/i82371_piix.h" #include "exec/address-spaces.h" //#define DEBUG diff --git a/MAINTAINERS b/MAINTAINERS index 6f867da743..cead15b69b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -888,6 +888,7 @@ F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h F: include/hw/isa/superio.h F: include/hw/input/i8042.h +F: include/hw/southbridge/i82371_piix.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* F: include/hw/timer/mc146818rtc* From patchwork Mon Jan 8 02:45:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856665 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Js5iNTio"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKWy1SnRz9s7h for ; Mon, 8 Jan 2018 13:50:38 +1100 (AEDT) Received: from localhost ([::1]:59345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNWG-00015o-6X for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:50:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSx-0007JD-Un for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSx-0002qc-4W for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:11 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:45642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSx-0002q4-0B for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:11 -0500 Received: by mail-qk0-x244.google.com with SMTP id o126so12537278qke.12 for ; Sun, 07 Jan 2018 18:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=chbMtJzKXNsi6pGw2kwMddPyBzpG3dOnZoSmZJuwMPs=; b=Js5iNTioV5TaurcipQa3LkGXVnqWG7qAgIfJu2Xw7Tk+Qedx9mCCLirx22Y2JE293P iZPagohM8vZTo6iko/3rqB32KEbg75bJzIlV597IgR86nKrj8ghYMC3XNgAfjv05LWJe owzOjIe93o1QOVcgRPtTJCY72iLt7Qsml+uyfAUhcTZqN4AlMDvznRSN0ia0UnGhNM+M K9qLwQbr59g5U9LrnXfCsZBpWwChgoWw5+8zxYUJA+gzx/ZJw8chCy6x258+NBJMlt7L DaDS8mV6/ooq6ufBHufkooiNkPYCj1CmXJTbQAJ2TJ/FzgufvcWmIPQZLhHbYpIIUhp4 1WZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=chbMtJzKXNsi6pGw2kwMddPyBzpG3dOnZoSmZJuwMPs=; b=iDqCmGdItjlgjnRblZJ4u+4Rke4cTHJoPf9KtVnW5TWwodlhf0pN+RPW76i+N6BoUc DmunnLySmxv1HMhVCvqBRVqSwSbt34L9xTmX6Jl3Y0piuS/d5JShOf/rTGCjuNqmddQ5 Z1hTDlh2dGHZP2Z89rGvwmGtShXlFc6M7tLQ4csiO2gzkM+hrRO8Z/3mjqMuJbjm1tLK GtUisU9Qx2Fyliq9/qJvshVxLsB/xs8bgRBA6uExu4HlsrpAtJoESI4qTsa+veAAaeSz TjBE+lwIBVqcR1m7LIVyFEjS1ZnFVZ2Gb9v6suEzTcFglfP+vXdsl9v90ab5UUf2M0N9 Ay+w== X-Gm-Message-State: AKwxytfGxm3+PI7D4AKsFEiE/s1Yd3mjr/2YMLM8qN6kM8lWp7z93YBF p76DbipW550/tz4EVlLY7AU= X-Google-Smtp-Source: ACJfBovjMK9DxqBDqOBYf8DvAPXezOBvw9/umGDbAJ7uYyQPhvIU+gYsqnTBwi5CnoiULiwjIDf1sg== X-Received: by 10.55.167.130 with SMTP id q124mr14660617qke.167.1515379630494; Sun, 07 Jan 2018 18:47:10 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:47 -0300 Message-Id: <20180108024558.17983-19-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 18/29] piix4: add a i8257 dma controller as specified in datasheet 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: Igor Mammedov , Yongbok Kim , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau Remove i8257 instanciated in malta board, to not have it twice. Signed-off-by: Hervé Poussineau [PMD: rebased] Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 4 ++++ hw/mips/mips_malta.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index b0f6a0a342..56a1c7d429 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #include "hw/isa/isa.h" #include "hw/southbridge/i82371_piix.h" +#include "hw/dma/i8257.h" #include "hw/sysbus.h" PCIDevice *piix4_dev; @@ -163,6 +164,9 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* initialize ISA irqs */ isa_bus_irqs(isa_bus, s->isa); + /* DMA */ + i8257_dma_init(isa_bus, 0); + piix4_dev = pci_dev; } diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index d31e144b70..db5a8b1811 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -28,7 +28,6 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/isa/superio.h" -#include "hw/dma/i8257.h" #include "hw/char/serial.h" #include "net/net.h" #include "hw/boards.h" @@ -1208,7 +1207,6 @@ void mips_malta_init(MachineState *machine) smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); mc146818_rtc_init(isa_bus, 2000, NULL); /* generate SPD EEPROM data */ From patchwork Mon Jan 8 02:45:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Bgs+ZTfu"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKz64dBLz9s71 for ; Mon, 8 Jan 2018 14:10:42 +1100 (AEDT) Received: from localhost ([::1]:60322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNpg-0002Rp-Or for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:10:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNT1-0007L4-HL for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNT0-0002w1-L7 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:15 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:42455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNT0-0002vK-GN for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:14 -0500 Received: by mail-qk0-x241.google.com with SMTP id d202so12534550qkc.9 for ; Sun, 07 Jan 2018 18:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hBi79hDIgEKjjopvztu2QDJ3BpIh5Nt3kAqhiadNHys=; b=Bgs+ZTfud/aOfO1xQiT+m4CK9fYEgdRUXU0C1wwEv537uboMZcgt+poolm0a/FI+oO ap3ujdpmDeSbuFOvW2cUb1V38ulL9OGhMn7T5wIjYwxQ4rq36VUXD0yk+A9faWO3vLrI Jjx1hNIGbesvNownA4/fC2zuKEGXJyfd1jGHJj9gXozMxgNhni+J9CIJ29msgXmHjX/4 Aqc22CTfr4aCmcsnrKlCQDxPW0PY0Mw7D/gXm/gktv4CLcNfZUBQTksQ6dg55od8hN7Q FhyfcPGDpDqeIzUApHD12aXZTqH47rv8hvQb0rqSLOYSeAuY2+gV+ex08jiqAWKY5Jmz 1LtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hBi79hDIgEKjjopvztu2QDJ3BpIh5Nt3kAqhiadNHys=; b=Wvq9rSS+kzGR9p0O0lTaaL7v/6VNvc01qi8H//pmZ0k2aJt6Ia4q0BwYk3W6TJnrF5 uvoWKNLd8BYQQwdEPHLmEGQWadqMCfB6obQK7DoF8zPj0W65ybyvFFY9oxnd0hkFefpP k3DjfZuQag4vGXyNGr/mdki1V0h7ggG3Y4nEyVPWr6BWya4dR80TQduzGUeSyT1QixkV ztlFp2NyoqYYIvW0MxeHbPzHdXbTo0vYqSQlWyvSLt1ZETz05pyIdDPWR1YcbgKes8YM CKiGJD9aSobfiq13V31GnizMq1N52sLQDvpUa6r16wjgKzubaJ5fxPU4haEliY790aQx YB9g== X-Gm-Message-State: AKwxytd/KwaWCife0CwEapJFegW3K/NWhqStn9f3bZoWdMSUiO06Mpl1 Hnp0ANa8iID6kXAMbZ+1EvY= X-Google-Smtp-Source: ACJfBovCXey5NbFUZkbjv6kqU0J8pHnMNExnw7SOLBjaZG+Z7ZlOuUYtafUq3lU5kE/JnMj42DXMmg== X-Received: by 10.55.152.69 with SMTP id a66mr13204291qke.120.1515379633930; Sun, 07 Jan 2018 18:47:13 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:48 -0300 Message-Id: <20180108024558.17983-20-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 19/29] piix4: add a i8254 pit controller as specified in datasheet 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: Igor Mammedov , Yongbok Kim , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau Remove i8254 instanciated in malta board, to not have it twice. Signed-off-by: Hervé Poussineau [PMD: rebased] Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 4 ++++ hw/mips/mips_malta.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 56a1c7d429..04b13f97c6 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -31,6 +31,7 @@ #include "hw/southbridge/i82371_piix.h" #include "hw/dma/i8257.h" #include "hw/sysbus.h" +#include "hw/timer/i8254.h" PCIDevice *piix4_dev; @@ -164,6 +165,9 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* initialize ISA irqs */ isa_bus_irqs(isa_bus, s->isa); + /* initialize pit */ + i8254_pit_init(isa_bus, 0x40, 0, NULL); + /* DMA */ i8257_dma_init(isa_bus, 0); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index db5a8b1811..84b4d5c423 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -44,7 +44,6 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" -#include "hw/timer/i8254.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "hw/sysbus.h" /* SysBusDevice */ @@ -98,8 +97,6 @@ typedef struct { qemu_irq i8259[16]; } MaltaState; -static ISADevice *pit; - static struct _loaderparams { int ram_size, ram_low_size; const char *kernel_filename; @@ -1206,7 +1203,6 @@ void mips_malta_init(MachineState *machine) pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL); - pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); mc146818_rtc_init(isa_bus, 2000, NULL); /* generate SPD EEPROM data */ From patchwork Mon Jan 8 02:45:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSYk01Ut"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKmV5Mczz9s71 for ; Mon, 8 Jan 2018 14:01:30 +1100 (AEDT) Received: from localhost ([::1]:59455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNgm-0002mC-R7 for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:01:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNT4-0007O7-Br for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNT3-00030b-GM for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:18 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:43136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNT3-000305-C4 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:17 -0500 Received: by mail-qt0-x244.google.com with SMTP id w10so12062126qtb.10 for ; Sun, 07 Jan 2018 18:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AJHJOScOE4XUF0ELJwKZ0IbemnlPuK/drz5w6C4Fc8w=; b=uSYk01UtYBQem0+Rkzy2oVpK4hIt0E6SDuqIQgJ22KgnumC8aORSTgrzgRufwlM9GI Q/oDxBdAhe7XptyHoypSPyiPChuw4YMBdyJWXbAvO07uJgBKIcF/DjlIRVRPfnnFLmKn j1TySD4l8X6Sgj/GXw6rF4BFLWZfxbK5hB+gZX0DyUnzkKvfkUOpRWE3nWtQY11J4zOn 8sS6Lq3HoXVrRrMxLty5dLrcu7O/fOLeN99wrrNqk+S1/Dr/JCVSxg6cdCDCzI6kXdkM Fxe0Y1g/e2NCaF7iVceNW94PJCtI27pxoEpuS0TLGCjBU7QBOY1l6UshufV3+kS07d6+ FycQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AJHJOScOE4XUF0ELJwKZ0IbemnlPuK/drz5w6C4Fc8w=; b=c/A1EL+SWma230T9kkReVtva9ZQjpV1I9cq783vjECRa+cy6lCrcHwROl34SyH3vRx s1gjAdNdgYjSFhhGTRIcpoqhgBRpvthuUTotAofiTeOf9XOVgH9TztdT8415qY72eYpq C3NS0fTklNRyvbe7megA/Qioza0sP1UQ3HjCq0uyGfTbgMVjkfJrYIT0EgDVE8TQYcAz +JAu7eUDNNgMQPlgzbWwLKuWw17YsOCvX5aZAvLp7Biqi28FYfC+Lnw97DfAtic6gayx ZFVIM0ASXWNazjx6kWYWrmUsFluElKMbNJBzRbFDjuGCMizzYrxvV+VqcJiW3E8wOykr PG1g== X-Gm-Message-State: AKwxytdkZGlsrvzjYSf/tlRLNozI16KSysN8DxkvjCk61Ae8uqXSOJoY YQ3HTwQmQ/GwV8JrilUwmNgU+fV+ X-Google-Smtp-Source: ACJfBot/n8Qy/LzsuJwiBY+lLVDDQQCEdWoH5pMKt1sjeo61O7dCc5UtsO7REVIeQIl/bcaSgjoOZA== X-Received: by 10.237.46.66 with SMTP id j60mr14165710qtd.168.1515379636886; Sun, 07 Jan 2018 18:47:16 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:49 -0300 Message-Id: <20180108024558.17983-21-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 20/29] piix4: add a speaker as specified in datasheet 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Hervé Poussineau Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 04b13f97c6..c78516e595 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -31,6 +31,7 @@ #include "hw/southbridge/i82371_piix.h" #include "hw/dma/i8257.h" #include "hw/sysbus.h" +#include "hw/audio/pcspk.h" #include "hw/timer/i8254.h" PCIDevice *piix4_dev; @@ -142,6 +143,7 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) DeviceState *dev = DEVICE(pci_dev); PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); ISABus *isa_bus; + ISADevice *pit; qemu_irq *i8259_out_irq; isa_bus = isa_bus_new(dev, pci_address_space(pci_dev), @@ -166,7 +168,10 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) isa_bus_irqs(isa_bus, s->isa); /* initialize pit */ - i8254_pit_init(isa_bus, 0x40, 0, NULL); + pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); + + /* speaker */ + pcspk_init(isa_bus, pit); /* DMA */ i8257_dma_init(isa_bus, 0); From patchwork Mon Jan 8 02:45:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856673 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YOlktY1d"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKdl0K00z9ryr for ; Mon, 8 Jan 2018 13:55:39 +1100 (AEDT) Received: from localhost ([::1]:59406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNb7-0005qP-46 for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:55:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTA-0007U5-Tv for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNT7-00035a-RO for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:24 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:43137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNT7-00035A-MH for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:21 -0500 Received: by mail-qt0-x244.google.com with SMTP id w10so12062257qtb.10 for ; Sun, 07 Jan 2018 18:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IZkFUGCPcOH70lwEh1534Z6FkDQByklmdgX3pP3aY3k=; b=YOlktY1dZLcIVGmAbPNoN1hCUIGwbEVYJP/ulIaSGtYsCQAk3dpEZ4Pxm2V/W+BoNQ wRDzHpP9KMeu/VzcCiaSNWWEy+0waeuQbY3E23DFnghJAiXfYROmADVufd648pEKIzy1 R503SYrav6cADUUVIvRyIwqWkY/kEwgRAKicsfB3/rPGLVC/5CdwMS20KEPTgj+QQpIg TXxwoz99rMqylS3eWT/mXRYF8l81NnKr6jzoVZmEXbE6xDi+G53Jro+cfy+ju2DH2Czu lKCpy11JKRe8eFBDXXo5ZfhHz4OGtaoV9JNDkolNnS1lwUPdgfEXIVrHJrb2H0SQSL/4 Cu9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IZkFUGCPcOH70lwEh1534Z6FkDQByklmdgX3pP3aY3k=; b=Xjr6P63sDBg86vH+l5Mm9llI3umSMFugLRC+xcFYKFETOw0AiojRTNonKEScW7UxDx UctsXCh/AykotcZO1ax0XR6qZFJ1rtn8oCFG/v4rQxALtks0jjDKc42iDvRiR4KP5FOa GPgbF8xN548u/EwRBzP8jlErRziTBpBCCW/UQjb4Hsq4pvLjGycK4K+HccwkcG/P1ALm pyKT5bfOfkMGUz5kIhZcZ4anqvA5YgmkIeK+YwvqgOGzZsacCdLwG7gKowU2sAqCwgZ2 luZoo6Ufwdy0Gc5H0oWKmir0du/k2PqDVyzeXC3s5PX743Y5FkrJtvcbppJEBgxEWP8Y S0uQ== X-Gm-Message-State: AKwxytfGJPHK/PlDOEfGqQGBhxwQ4Sc4KowY0HhJLgYSi2BP+Lh/kY32 0WXLEldHil2uGbrlaS+SUcg= X-Google-Smtp-Source: ACJfBota2P3mg3n0oTMjXho6dAX9c1D9SEoYyWb66dpXAjeJHHyWTeGrsnegHyDf3uYDyHMpnm994Q== X-Received: by 10.200.40.115 with SMTP id 48mr15454527qtr.335.1515379641139; Sun, 07 Jan 2018 18:47:21 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:50 -0300 Message-Id: <20180108024558.17983-22-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 21/29] piix: move southbridge related declarations/definitions to i82371_piix.h 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: Igor Mammedov , Richard Henderson , Yongbok Kim , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/acpi/piix4.h | 6 ------ include/hw/i386/pc.h | 12 ------------ include/hw/southbridge/i82371_piix.h | 17 +++++++++++++++++ hw/acpi/piix4.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/pc_piix.c | 1 + hw/mips/mips_malta.c | 2 +- hw/pci-host/piix.c | 1 - MAINTAINERS | 1 - 9 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 include/hw/acpi/piix4.h diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h deleted file mode 100644 index 26c2370e30..0000000000 --- a/include/hw/acpi/piix4.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HW_ACPI_PIIX4_H -#define HW_ACPI_PIIX4_H - -Object *piix4_pm_find(void); - -#endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 195c02febe..768428db3b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -236,12 +236,6 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0); #define PORT92_A20_LINE "a20" -/* acpi_piix.c */ - -I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, - qemu_irq sci_irq, qemu_irq smi_irq, - int smm_enabled, DeviceState **piix4_pm); - /* hpet.c */ extern int no_hpet; @@ -254,12 +248,6 @@ typedef struct PCII440FXState PCII440FXState; #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" -/* - * Reset Control Register: PCI-accessible ISA-Compatible Register at address - * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000). - */ -#define RCR_IOPORT 0xcf9 - PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCII440FXState **pi440fx_state, int *piix_devfn, ISABus **isa_bus, qemu_irq *pic, diff --git a/include/hw/southbridge/i82371_piix.h b/include/hw/southbridge/i82371_piix.h index 95ac25becd..8a5f9a7596 100644 --- a/include/hw/southbridge/i82371_piix.h +++ b/include/hw/southbridge/i82371_piix.h @@ -10,8 +10,25 @@ #define HW_ISA_PIIX_H #include "hw/pci/pci.h" +#include "hw/isa/isa.h" + +#define TYPE_PIIX4_PCI_DEVICE "PIIX4" + +#define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */ + +/* + * Reset Control Register: PCI-accessible ISA-Compatible Register at address + * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000). + */ +#define RCR_IOPORT 0xcf9 /* piix4.c */ extern PCIDevice *piix4_dev; +/* acpi_piix.c */ +Object *piix4_pm_find(void); +I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq, qemu_irq smi_irq, + int smm_enabled, DeviceState **piix4_pm); + #endif /* HW_ISA_PIIX_H */ diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 32caa4f0fc..7e37587f3a 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/isa/apm.h" #include "hw/i2c/pm_smbus.h" #include "hw/pci/pci.h" @@ -31,7 +32,6 @@ #include "exec/ioport.h" #include "hw/nvram/fw_cfg.h" #include "exec/address-spaces.h" -#include "hw/acpi/piix4.h" #include "hw/acpi/pcihp.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 5a6dee081c..d166187bc5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -48,7 +48,7 @@ #include "sysemu/numa.h" /* Supported chipsets: */ -#include "hw/acpi/piix4.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/acpi/pcihp.h" #include "hw/i386/ich9.h" #include "hw/pci/pci_bus.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5e47528993..89606c85db 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -31,6 +31,7 @@ #include "hw/smbios/smbios.h" #include "hw/pci/pci.h" #include "hw/pci/pci_ids.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/usb.h" #include "net/net.h" #include "hw/boards.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 84b4d5c423..03fe98e35e 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -26,7 +26,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" -#include "hw/i386/pc.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/isa/superio.h" #include "hw/char/serial.h" #include "net/net.h" diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index a684a7cca9..0bd22fa33a 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -55,7 +55,6 @@ typedef struct I440FXState { } I440FXState; #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ -#define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */ #define XEN_PIIX_NUM_PIRQS 128ULL #define PIIX_PIRQC 0x60 diff --git a/MAINTAINERS b/MAINTAINERS index cead15b69b..968f32f93d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -859,7 +859,6 @@ F: hw/i2c/smbus_ich9.c F: hw/acpi/piix4.c F: hw/acpi/ich9.c F: include/hw/acpi/ich9.h -F: include/hw/acpi/piix4.h F: hw/misc/sga.c PC Chipset From patchwork Mon Jan 8 02:45:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tEJiJhGy"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKbC2gmrz9ryr for ; Mon, 8 Jan 2018 13:53:27 +1100 (AEDT) Received: from localhost ([::1]:59380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNYz-0003ch-Dh for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:53:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTC-0007VJ-6g for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTB-0003AU-9v for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:26 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:41726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTB-0003AA-50 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:25 -0500 Received: by mail-qt0-x242.google.com with SMTP id i40so12057254qti.8 for ; Sun, 07 Jan 2018 18:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PPA/A1gVNYwsrQhN89Facs2FeGYi8DTMHXHNVDmaTSk=; b=tEJiJhGy61d+J7TSRbgleKKji9Q3KfKCqn9jW3jZrCwVXf23ZJO9QawSRDnkoumn6R A1yJlO77Eidqi55RTvLdSMBQFRecN0rjuB2sn8L9c9Ay/t6ky97Omlw/OBlF7sqvodVT 696Iu4Ehwc055Mq6h8LSrOf/yry7g4RfXI+AWDzPEBSBE/CYkBXPqXeLsiwl2GSeE8V2 IjhBijXCqpDyX2Ew+LTUdSBgxCBUg8zyMvUFCO8rdFRAJ3YxrFSy0FvPgIrxNzb0R8T7 iiGEt09B2uuO0tPghG770RmXQaYvin6Nw7oUagwbQsgpyzd4Xsxtx9Kl5Y7RB3KlRWAe 5D8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PPA/A1gVNYwsrQhN89Facs2FeGYi8DTMHXHNVDmaTSk=; b=EDcm3zbiZg9iDZG2ze22s1jQFZe+f6tJUyq4ywLrHSTj8Qq7j/yUadHLacD9yeVykg edu1NbvUVbw9X7W/yw8C5/RopdriIl9x547o4QZgJt1V4bsBd1A5e6QlZABBirWGfVjy iKh0/zJ2fPIRDFAEDESYKduUbhtEICbewhSb74SyM5tcXBci+oKuGefc+EPLhrVFwAMQ bbdi+cQJenZSP2JGsTxwi2wQikiEWfGyLqeN/uFvsJtin2BW8FRhgX3WLV8bEgb1gWTl 5YzMstwFq7LOzr0gH0noc5izwb3S9yfh6ZIH0gGmeDVNbBJEwyjRpI+LBsXNOnBHnW2C cDUQ== X-Gm-Message-State: AKwxytc/k93VjErqtcQOEmSVL2WVw2j93za8fBW9HxCyL9uOPmLkdtzy cunRGzeFbqWl8QSuWOnFhHtgYWXj X-Google-Smtp-Source: ACJfBotMW138HztQgKaqqseIZAKDfXrRCWenmGYd8vyNE2xm51dY6nTU8R3uFm405eh4oz7dHeDsfg== X-Received: by 10.200.24.197 with SMTP id o5mr14274667qtk.79.1515379644545; Sun, 07 Jan 2018 18:47:24 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:51 -0300 Message-Id: <20180108024558.17983-23-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 22/29] piix3: extract piix3_init() from i440fx_init() 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/southbridge/i82371_piix.h | 4 +++ hw/pci-host/piix.c | 62 ++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/include/hw/southbridge/i82371_piix.h b/include/hw/southbridge/i82371_piix.h index 8a5f9a7596..00a9f4d5b9 100644 --- a/include/hw/southbridge/i82371_piix.h +++ b/include/hw/southbridge/i82371_piix.h @@ -22,6 +22,10 @@ */ #define RCR_IOPORT 0xcf9 +/* piix.c */ +PCIDevice *piix3_init(PCIBus *bus, ISABus **isa_bus, + qemu_irq *pic, int *piix3_devfn); + /* piix4.c */ extern PCIDevice *piix4_dev; diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0bd22fa33a..6e8cea8372 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -27,6 +27,7 @@ #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" +#include "hw/southbridge/i82371_piix.h" #include "hw/isa/isa.h" #include "hw/sysbus.h" #include "qapi/error.h" @@ -120,11 +121,6 @@ struct PCII440FXState { */ #define I440FX_COREBOOT_RAM_SIZE 0x57 -static void piix3_set_irq(void *opaque, int pirq, int level); -static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pci_intx); -static void piix3_write_config_xen(PCIDevice *dev, - uint32_t address, uint32_t val, int len); - /* return the global irq number corresponding to a given device irq pin. We could also use the bus number to have a more precise mapping. */ @@ -353,7 +349,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCIBus *b; PCIDevice *d; PCIHostState *s; - PIIX3State *piix3; PCII440FXState *f; unsigned i; I440FXState *i440fx; @@ -406,28 +401,7 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, PAM_EXPAN_SIZE); } - /* Xen supports additional interrupt routes from the PCI devices to - * the IOAPIC: the four pins of each PCI device on the bus are also - * connected to the IOAPIC directly. - * These additional routes can be discovered through ACPI. */ - if (xen_enabled()) { - PCIDevice *pci_dev = pci_create_simple_multifunction(b, - -1, true, "PIIX3-xen"); - piix3 = PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(b, xen_piix3_set_irq, xen_pci_slot_get_pirq, - piix3, XEN_PIIX_NUM_PIRQS); - } else { - PCIDevice *pci_dev = pci_create_simple_multifunction(b, - -1, true, "PIIX3"); - piix3 = PIIX3_PCI_DEVICE(pci_dev); - pci_bus_irqs(b, piix3_set_irq, pci_slot_get_pirq, piix3, - PIIX_NUM_PIRQS); - pci_bus_set_route_irq_fn(b, piix3_route_intx_pin_to_irq); - } - piix3->pic = pic; - *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); - - *piix3_devfn = piix3->dev.devfn; + piix3_init(b, isa_bus, pic, piix3_devfn); ram_size = ram_size / 8 / 1024 / 1024; if (ram_size > 255) { @@ -508,6 +482,38 @@ static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pin) return route; } +PCIDevice *piix3_init(PCIBus *bus, ISABus **isa_bus, + qemu_irq *pic, int *piix3_devfn) +{ + PCIDevice *pci_dev; + PIIX3State *piix3; + + /* Xen supports additional interrupt routes from the PCI devices to + * the IOAPIC: the four pins of each PCI device on the bus are also + * connected to the IOAPIC directly. + * These additional routes can be discovered through ACPI. */ + if (xen_enabled()) { + pci_dev = pci_create_simple_multifunction(bus, + -1, true, "PIIX3-xen"); + piix3 = PIIX3_PCI_DEVICE(pci_dev); + pci_bus_irqs(bus, xen_piix3_set_irq, xen_pci_slot_get_pirq, + piix3, XEN_PIIX_NUM_PIRQS); + } else { + pci_dev = pci_create_simple_multifunction(bus, + -1, true, "PIIX3"); + piix3 = PIIX3_PCI_DEVICE(pci_dev); + pci_bus_irqs(bus, piix3_set_irq, pci_slot_get_pirq, piix3, + PIIX_NUM_PIRQS); + pci_bus_set_route_irq_fn(bus, piix3_route_intx_pin_to_irq); + } + piix3->pic = pic; + *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); + + *piix3_devfn = piix3->dev.devfn; + + return pci_dev; +} + /* irq routing is changed. so rebuild bitmap */ static void piix3_update_irq_levels(PIIX3State *piix3) { From patchwork Mon Jan 8 02:45:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SUVBihjs"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKfK0xhKz9ryr for ; Mon, 8 Jan 2018 13:56:09 +1100 (AEDT) Received: from localhost ([::1]:59417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNbb-0006Wi-8A for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:56:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTG-0007Yj-3G for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTE-0003Bs-VM for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:30 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:46954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTE-0003Bh-Pq for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:28 -0500 Received: by mail-qk0-x241.google.com with SMTP id l12so12196081qke.13 for ; Sun, 07 Jan 2018 18:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q0mJs1CiBgULiGXLtq3Ilxs8jSZUTUdrkdbGZi3wh04=; b=SUVBihjs338HqYhRgA/x+HMTyfN5UJ8zjFyMHX612hwIDg213xCQBLdxJl9NQSOGdj tX0XdP+j6Qjaig+3cEnWH1r9eW2RG5D5ZUs+3SqC4fQ5M8xGjnem7vyH/jFVlwidCL0j +E9OyIL04KM+qYDslRszkBM2X/V7GV7fLYbL4JquHXiTdGFZqoBjWx1Z4mSx2xtW0oKh XSjG7yWP19U7czvBvfKieJGmeEJCO+LCLte6q8to1Dx79cGCDa1g/QwKaHHAtqEWYD2V WwTh0H29z211jnVcD2lts+rFJYrbaCb/WYtD9QbeZczuplS7xhHTkDTEC1s+9OqlxCEE U0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Q0mJs1CiBgULiGXLtq3Ilxs8jSZUTUdrkdbGZi3wh04=; b=mFLNB+Cnt31aornTc8YmRjcgdeHjdFst1Y56mMgZ2KIysiTHnX+2wyBfU/SwgaxBh/ 2gnMwrSNbjwlKPsPhiUG8VFUP+rsX8Aa21VgIYYu7iptCROaP2Olp+C0HzgCyxcv9lOT 8E4IVJtq5nPzF6WrBLnTVRuWzz7SY8Vhme+ZtmooFjqkpkpWKF7M7/p4ntkoC6IjUopf 52RbvB3dgc18WK9dlPLVTBVyphZGgBhhFrvFffa0Y53f8UZGrGtqSdU+yxz3N90ZaNJa SrOWZsiMBINmVGfaxQcZMwppNumie6EHW5h7c75G/nPkLKZtLXc1mdZR1SGTMdfjBJMV q17g== X-Gm-Message-State: AKwxytcypqH0l+nYrlxl/FcQp/ono5c/XMp582X5Pk+4udag4V3QzCux 1U/rnuW6GZQqTmXu4lQYg98= X-Google-Smtp-Source: ACJfBou0DOchj2cIZ3NeFClYFP0KTiqZryqGyZmZ2B/i4LOmpLrzJ1l7kJwCotaSt9yI9ODvpqpenA== X-Received: by 10.55.158.65 with SMTP id h62mr14580918qke.158.1515379648251; Sun, 07 Jan 2018 18:47:28 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:52 -0300 Message-Id: <20180108024558.17983-24-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 23/29] hw/i386: extract i440fx related declarations/definitions to i440fx.h 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: Igor Mammedov , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 22 ------------------- include/hw/pci-host/i440fx.h | 51 ++++++++++++++++++++++++++++++++++++++++++++ hw/acpi/pcihp.c | 2 +- hw/i386/pc_piix.c | 1 + hw/pci-host/piix.c | 1 + stubs/pci-host-piix.c | 3 ++- MAINTAINERS | 1 + 7 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 include/hw/pci-host/i440fx.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 768428db3b..b63fdbd9e2 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -239,28 +239,6 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0); /* hpet.c */ extern int no_hpet; -/* piix_pci.c */ -struct PCII440FXState; -typedef struct PCII440FXState PCII440FXState; - -#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" -#define TYPE_I440FX_PCI_DEVICE "i440FX" - -#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" - -PCIBus *i440fx_init(const char *host_type, const char *pci_type, - PCII440FXState **pi440fx_state, int *piix_devfn, - ISABus **isa_bus, qemu_irq *pic, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, - ram_addr_t ram_size, - ram_addr_t below_4g_mem_size, - ram_addr_t above_4g_mem_size, - MemoryRegion *pci_memory, - MemoryRegion *ram_memory); - -PCIBus *find_i440fx(void); - /* pc_sysfw.c */ void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw); diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h new file mode 100644 index 0000000000..c796382d52 --- /dev/null +++ b/include/hw/pci-host/i440fx.h @@ -0,0 +1,51 @@ +/* + * QEMU i440FX North Bridge Emulation + * + * Copyright (c) 2006 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef HW_PCI_HOST_I440FX_H +#define HW_PCI_HOST_I440FX_H + +#include "qemu-common.h" +#include "hw/hw.h" + +struct PCII440FXState; +typedef struct PCII440FXState PCII440FXState; + +#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" +#define TYPE_I440FX_PCI_DEVICE "i440FX" + +#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" + +PCIBus *i440fx_init(const char *host_type, const char *pci_type, + PCII440FXState **pi440fx_state, int *piix_devfn, + ISABus **isa_bus, qemu_irq *pic, + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io, + ram_addr_t ram_size, + ram_addr_t below_4g_mem_size, + ram_addr_t above_4g_mem_size, + MemoryRegion *pci_memory, + MemoryRegion *ram_memory); + +PCIBus *find_i440fx(void); + +#endif /* HW_PCI_HOST_I440FX_H */ diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 7da51c0569..51a65a34a1 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -28,8 +28,8 @@ #include "hw/acpi/pcihp.h" #include "hw/hw.h" -#include "hw/i386/pc.h" #include "hw/pci/pci.h" +#include "hw/pci-host/i440fx.h" #include "hw/acpi/acpi.h" #include "sysemu/sysemu.h" #include "exec/ioport.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 89606c85db..326ca302dc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -31,6 +31,7 @@ #include "hw/smbios/smbios.h" #include "hw/pci/pci.h" #include "hw/pci/pci_ids.h" +#include "hw/pci-host/i440fx.h" #include "hw/southbridge/i82371_piix.h" #include "hw/usb.h" #include "net/net.h" diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 6e8cea8372..6f963b5a07 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -27,6 +27,7 @@ #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" +#include "hw/pci-host/i440fx.h" #include "hw/southbridge/i82371_piix.h" #include "hw/isa/isa.h" #include "hw/sysbus.h" diff --git a/stubs/pci-host-piix.c b/stubs/pci-host-piix.c index 6ed81b1f21..93975adbfe 100644 --- a/stubs/pci-host-piix.c +++ b/stubs/pci-host-piix.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" -#include "hw/i386/pc.h" +#include "hw/pci-host/i440fx.h" + PCIBus *find_i440fx(void) { return NULL; diff --git a/MAINTAINERS b/MAINTAINERS index 968f32f93d..c3efcd2316 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -859,6 +859,7 @@ F: hw/i2c/smbus_ich9.c F: hw/acpi/piix4.c F: hw/acpi/ich9.c F: include/hw/acpi/ich9.h +F: include/hw/pci-host/i440fx.h F: hw/misc/sga.c PC Chipset From patchwork Mon Jan 8 02:45:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="USrQPSKV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFL0W6SCXz9s71 for ; Mon, 8 Jan 2018 14:11:55 +1100 (AEDT) Received: from localhost ([::1]:60366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNqs-0003Fy-0r for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:11:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTN-0007eD-Kr for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTJ-0003Gy-Qb for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:37 -0500 Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:34179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTJ-0003Fz-IZ for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:33 -0500 Received: by mail-qk0-x22d.google.com with SMTP id m193so4290966qke.1 for ; Sun, 07 Jan 2018 18:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wbwemXjrNzydoZJzZElOwzcM2tIhwETP2/vBVfOJwRA=; b=USrQPSKV9Tfjr25+fw9FkT+kfFNbgiCqExYMfnLVIGxNFXvojVEndjHojGULmEXHC2 gM4/cev6Bluc6Po/e7TMUvrUkR4OJgcGiq8LGFZkqIu0KBIJb1kKlTfeiQ/pt+4/LCw5 FFzbJbJBUa+VFkFdOJwXZASQk6eYfViUky3B1X5GbJY0QXwq2PfjnLmKAorwxjt3zRna BVX8eFe8ZXmeRyron+zuV8ZJ2eWKnVGwk2PgcCjTvKRVHeB9lgyjHaLNKZG6870fgm8L 91tA96jx+AbUGTEf9t5WgrY2l8xN1xlOe5yX+X0CZYkO00h/SRw/0HlY33gcN/HXn+0A gexA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wbwemXjrNzydoZJzZElOwzcM2tIhwETP2/vBVfOJwRA=; b=TVxbA0BslIRdfvM1er5bhP/K2L53HVR4WisnEs1HRfTCZjcboa9JzMmwOv18TmUM8R cT/UZ5b/nRIdKisNG4KCGmgKeCVt45muJIKoBvWRCpLFl6Kfx1uBQqGUsd/pDUBXNgkH NDBVG6xB8/T9Y2twHMnq6TFsajFssFEQmqqscnZFtK9KaK6ArMSikwXNA6lN1gFapNQ7 dkEs9RL05GsCe417wgsBQlgHpkZ0C41T46vZAtoPU33xGdMhkMelfD2pg0fNzn8qslCV oVEQIYnmfc0tcQ4/XMg2j+oiKPj6ZvANnGp5K/IxES2EwTYAm3SFYmQjhvRGN1M8MWBJ EMyw== X-Gm-Message-State: AKwxyteEUwZJBBeoUwJ2NVgaua9FHPM/ziwJ20XV362haJYnoAbbRl0d yqB1Ch9VeBpy0heEL9GjTbouCa+N X-Google-Smtp-Source: ACJfBotJbIjK44pibRKu5GwL2hpbqLTVAXhQQXsag7CtkY9OY1yCC0afUrsPF0X0J3g4zKcdajGKmg== X-Received: by 10.55.68.79 with SMTP id r76mr14011109qka.187.1515379652534; Sun, 07 Jan 2018 18:47:32 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:53 -0300 Message-Id: <20180108024558.17983-25-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22d Subject: [Qemu-devel] [PATCH 24/29] hw/i386: extract i440fx code from piix.c into i440fx.c 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/pci-host/i440fx.c | 543 +++++++++++++++++++++++++++++++++++++ hw/pci-host/piix.c | 522 +---------------------------------- MAINTAINERS | 1 + hw/pci-host/Makefile.objs | 1 + 6 files changed, 552 insertions(+), 517 deletions(-) create mode 100644 hw/pci-host/i440fx.c diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index 95ac4b464a..c7e4af01a5 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -38,6 +38,7 @@ CONFIG_I8259=y CONFIG_PFLASH_CFI01=y CONFIG_TPM_TIS=$(CONFIG_TPM) CONFIG_MC146818RTC=y +CONFIG_PCI_I440FX=y CONFIG_PCI_PIIX=y CONFIG_WDT_IB700=y CONFIG_ISA_DEBUG=y diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak index 0221236825..926997fe60 100644 --- a/default-configs/x86_64-softmmu.mak +++ b/default-configs/x86_64-softmmu.mak @@ -38,6 +38,7 @@ CONFIG_I8259=y CONFIG_PFLASH_CFI01=y CONFIG_TPM_TIS=$(CONFIG_TPM) CONFIG_MC146818RTC=y +CONFIG_PCI_I440FX=y CONFIG_PCI_PIIX=y CONFIG_WDT_IB700=y CONFIG_ISA_DEBUG=y diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c new file mode 100644 index 0000000000..76968f8fbf --- /dev/null +++ b/hw/pci-host/i440fx.c @@ -0,0 +1,543 @@ +/* + * QEMU i440FX North Bridge Emulation + * + * Copyright (c) 2006 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/visitor.h" +#include "hw/hw.h" +#include "hw/i386/pc.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_host.h" +#include "hw/pci-host/pam.h" +#include "hw/pci-host/i440fx.h" +#include "hw/southbridge/i82371_piix.h" + +/* + * I440FX chipset data sheet. + * http://download.intel.com/design/chipsets/datashts/29054901.pdf + */ + +#define I440FX_PCI_HOST_BRIDGE(obj) \ + OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE) + +typedef struct I440FXState { + PCIHostState parent_obj; + Range pci_hole; + uint64_t pci_hole64_size; + bool pci_hole64_fix; + uint32_t short_root_bus; +} I440FXState; + +#define I440FX_PCI_DEVICE(obj) \ + OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) + +struct PCII440FXState { + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + + MemoryRegion *system_memory; + MemoryRegion *pci_address_space; + MemoryRegion *ram_memory; + PAMMemoryRegion pam_regions[13]; + MemoryRegion smram_region; + MemoryRegion smram, low_smram; +}; + + +#define I440FX_PAM 0x59 +#define I440FX_PAM_SIZE 7 +#define I440FX_SMRAM 0x72 + +/* Keep it 2G to comply with older win32 guests */ +#define I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT (1ULL << 31) + +/* Older coreboot versions (4.0 and older) read a config register that doesn't + * exist in real hardware, to get the RAM size from QEMU. + */ +#define I440FX_COREBOOT_RAM_SIZE 0x57 + +static void i440fx_update_memory_mappings(PCII440FXState *d) +{ + int i; + PCIDevice *pd = PCI_DEVICE(d); + + memory_region_transaction_begin(); + for (i = 0; i < 13; i++) { + pam_update(&d->pam_regions[i], i, + pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]); + } + memory_region_set_enabled(&d->smram_region, + !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); + memory_region_set_enabled(&d->smram, + pd->config[I440FX_SMRAM] & SMRAM_G_SMRAME); + memory_region_transaction_commit(); +} + + +static void i440fx_write_config(PCIDevice *dev, + uint32_t address, uint32_t val, int len) +{ + PCII440FXState *d = I440FX_PCI_DEVICE(dev); + + /* XXX: implement SMRAM.D_LOCK */ + pci_default_write_config(dev, address, val, len); + if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) || + range_covers_byte(address, len, I440FX_SMRAM)) { + i440fx_update_memory_mappings(d); + } +} + +static int i440fx_load_old(QEMUFile *f, void *opaque, int version_id) +{ + PCII440FXState *d = opaque; + PCIDevice *pd = PCI_DEVICE(d); + int ret, i; + uint8_t smm_enabled; + + ret = pci_device_load(pd, f); + if (ret < 0) { + return ret; + } + i440fx_update_memory_mappings(d); + qemu_get_8s(f, &smm_enabled); + + if (version_id == 2) { + for (i = 0; i < PIIX_NUM_PIRQS; i++) { + qemu_get_be32(f); /* dummy load for compatibility */ + } + } + + return 0; +} + +static int i440fx_post_load(void *opaque, int version_id) +{ + PCII440FXState *d = opaque; + + i440fx_update_memory_mappings(d); + return 0; +} + +static const VMStateDescription vmstate_i440fx = { + .name = "I440FX", + .version_id = 3, + .minimum_version_id = 3, + .minimum_version_id_old = 1, + .load_state_old = i440fx_load_old, + .post_load = i440fx_post_load, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj, PCII440FXState), + /* Used to be smm_enabled, which was basically always zero because + * SeaBIOS hardly uses SMM. SMRAM is now handled by CPU code. + */ + VMSTATE_UNUSED(1), + VMSTATE_END_OF_LIST() + } +}; + +static void i440fx_pcihost_get_pci_hole_start(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); + uint64_t val64; + uint32_t value; + + val64 = range_is_empty(&s->pci_hole) ? 0 : range_lob(&s->pci_hole); + value = val64; + assert(value == val64); + visit_type_uint32(v, name, &value, errp); +} + +static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); + uint64_t val64; + uint32_t value; + + val64 = range_is_empty(&s->pci_hole) ? 0 : range_upb(&s->pci_hole) + 1; + value = val64; + assert(value == val64); + visit_type_uint32(v, name, &value, errp); +} + +/* + * The 64bit PCI hole start is set by the Guest firmware + * as the address of the first 64bit PCI MEM resource. + * If no PCI device has resources on the 64bit area, + * the 64bit PCI hole will start after "over 4G RAM" and the + * reserved space for memory hotplug if any. + */ +static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, + const char *name, + void *opaque, Error **errp) +{ + PCIHostState *h = PCI_HOST_BRIDGE(obj); + I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); + Range w64; + uint64_t value; + + pci_bus_get_w64_range(h->bus, &w64); + value = range_is_empty(&w64) ? 0 : range_lob(&w64); + if (!value && s->pci_hole64_fix) { + value = pc_pci_hole64_start(); + } + visit_type_uint64(v, name, &value, errp); +} + +/* + * The 64bit PCI hole end is set by the Guest firmware + * as the address of the last 64bit PCI MEM resource. + * Then it is expanded to the PCI_HOST_PROP_PCI_HOLE64_SIZE + * that can be configured by the user. + */ +static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + PCIHostState *h = PCI_HOST_BRIDGE(obj); + I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); + uint64_t hole64_start = pc_pci_hole64_start(); + Range w64; + uint64_t value, hole64_end; + + pci_bus_get_w64_range(h->bus, &w64); + value = range_is_empty(&w64) ? 0 : range_upb(&w64) + 1; + hole64_end = ROUND_UP(hole64_start + s->pci_hole64_size, 1ULL << 30); + if (s->pci_hole64_fix && value < hole64_end) { + value = hole64_end; + } + visit_type_uint64(v, name, &value, errp); +} + +static void i440fx_pcihost_initfn(Object *obj) +{ + PCIHostState *s = PCI_HOST_BRIDGE(obj); + + memory_region_init_io(&s->conf_mem, obj, &pci_host_conf_le_ops, s, + "pci-conf-idx", 4); + memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s, + "pci-conf-data", 4); + + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", + i440fx_pcihost_get_pci_hole_start, + NULL, NULL, NULL, NULL); + + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + i440fx_pcihost_get_pci_hole_end, + NULL, NULL, NULL, NULL); + + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", + i440fx_pcihost_get_pci_hole64_start, + NULL, NULL, NULL, NULL); + + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", + i440fx_pcihost_get_pci_hole64_end, + NULL, NULL, NULL, NULL); +} + +static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) +{ + PCIHostState *s = PCI_HOST_BRIDGE(dev); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + + sysbus_add_io(sbd, 0xcf8, &s->conf_mem); + sysbus_init_ioports(sbd, 0xcf8, 4); + + sysbus_add_io(sbd, 0xcfc, &s->data_mem); + sysbus_init_ioports(sbd, 0xcfc, 4); +} + +static void i440fx_realize(PCIDevice *dev, Error **errp) +{ + dev->config[I440FX_SMRAM] = 0x02; + + if (object_property_get_bool(qdev_get_machine(), "iommu", NULL)) { + warn_report("i440fx doesn't support emulated iommu"); + } +} + +PCIBus *i440fx_init(const char *host_type, const char *pci_type, + PCII440FXState **pi440fx_state, + int *piix3_devfn, + ISABus **isa_bus, qemu_irq *pic, + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io, + ram_addr_t ram_size, + ram_addr_t below_4g_mem_size, + ram_addr_t above_4g_mem_size, + MemoryRegion *pci_address_space, + MemoryRegion *ram_memory) +{ + DeviceState *dev; + PCIBus *b; + PCIDevice *d; + PCIHostState *s; + PCII440FXState *f; + unsigned i; + I440FXState *i440fx; + + dev = qdev_create(NULL, host_type); + s = PCI_HOST_BRIDGE(dev); + b = pci_bus_new(dev, NULL, pci_address_space, + address_space_io, 0, TYPE_PCI_BUS); + s->bus = b; + object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL); + qdev_init_nofail(dev); + + d = pci_create_simple(b, 0, pci_type); + *pi440fx_state = I440FX_PCI_DEVICE(d); + f = *pi440fx_state; + f->system_memory = address_space_mem; + f->pci_address_space = pci_address_space; + f->ram_memory = ram_memory; + + i440fx = I440FX_PCI_HOST_BRIDGE(dev); + range_set_bounds(&i440fx->pci_hole, below_4g_mem_size, + IO_APIC_DEFAULT_ADDRESS - 1); + + /* setup pci memory mapping */ + pc_pci_as_mapping_init(OBJECT(f), f->system_memory, + f->pci_address_space); + + /* if *disabled* show SMRAM to all CPUs */ + memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region", + f->pci_address_space, 0xa0000, 0x20000); + memory_region_add_subregion_overlap(f->system_memory, 0xa0000, + &f->smram_region, 1); + memory_region_set_enabled(&f->smram_region, true); + + /* smram, as seen by SMM CPUs */ + memory_region_init(&f->smram, OBJECT(d), "smram", 1ull << 32); + memory_region_set_enabled(&f->smram, true); + memory_region_init_alias(&f->low_smram, OBJECT(d), "smram-low", + f->ram_memory, 0xa0000, 0x20000); + memory_region_set_enabled(&f->low_smram, true); + memory_region_add_subregion(&f->smram, 0xa0000, &f->low_smram); + object_property_add_const_link(qdev_get_machine(), "smram", + OBJECT(&f->smram), &error_abort); + + init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_space, + &f->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE); + for (i = 0; i < 12; ++i) { + init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_space, + &f->pam_regions[i + 1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, + PAM_EXPAN_SIZE); + } + + piix3_init(b, isa_bus, pic, piix3_devfn); + + ram_size = ram_size / 8 / 1024 / 1024; + if (ram_size > 255) { + ram_size = 255; + } + d->config[I440FX_COREBOOT_RAM_SIZE] = ram_size; + + i440fx_update_memory_mappings(f); + + return b; +} + +PCIBus *find_i440fx(void) +{ + PCIHostState *s = OBJECT_CHECK(PCIHostState, + object_resolve_path("/machine/i440fx", NULL), + TYPE_PCI_HOST_BRIDGE); + return s ? s->bus : NULL; +} + +static void i440fx_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->realize = i440fx_realize; + k->config_write = i440fx_write_config; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_82441; + k->revision = 0x02; + k->class_id = PCI_CLASS_BRIDGE_HOST; + dc->desc = "Host bridge"; + dc->vmsd = &vmstate_i440fx; + /* + * PCI-facing part of the host bridge, not usable without the + * host-facing part, which can't be device_add'ed, yet. + */ + dc->user_creatable = false; + dc->hotpluggable = false; +} + +static const TypeInfo i440fx_info = { + .name = TYPE_I440FX_PCI_DEVICE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PCII440FXState), + .class_init = i440fx_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + +/* IGD Passthrough Host Bridge. */ +typedef struct { + uint8_t offset; + uint8_t len; +} IGDHostInfo; + +/* Here we just expose minimal host bridge offset subset. */ +static const IGDHostInfo igd_host_bridge_infos[] = { + {0x08, 2}, /* revision id */ + {0x2c, 2}, /* sybsystem vendor id */ + {0x2e, 2}, /* sybsystem id */ + {0x50, 2}, /* SNB: processor graphics control register */ + {0x52, 2}, /* processor graphics control register */ + {0xa4, 4}, /* SNB: graphics base of stolen memory */ + {0xa8, 4}, /* SNB: base of GTT stolen memory */ +}; + +static int host_pci_config_read(int pos, int len, uint32_t *val) +{ + char path[PATH_MAX]; + int config_fd; + ssize_t size = sizeof(path); + /* Access real host bridge. */ + int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s", + 0, 0, 0, 0, "config"); + int ret = 0; + + if (rc >= size || rc < 0) { + return -ENODEV; + } + + config_fd = open(path, O_RDWR); + if (config_fd < 0) { + return -ENODEV; + } + + if (lseek(config_fd, pos, SEEK_SET) != pos) { + ret = -errno; + goto out; + } + + do { + rc = read(config_fd, (uint8_t *)val, len); + } while (rc < 0 && (errno == EINTR || errno == EAGAIN)); + if (rc != len) { + ret = -errno; + } + +out: + close(config_fd); + return ret; +} + +static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev) +{ + uint32_t val = 0; + int rc, i, num; + int pos, len; + + num = ARRAY_SIZE(igd_host_bridge_infos); + for (i = 0; i < num; i++) { + pos = igd_host_bridge_infos[i].offset; + len = igd_host_bridge_infos[i].len; + rc = host_pci_config_read(pos, len, &val); + if (rc) { + return -ENODEV; + } + pci_default_write_config(pci_dev, pos, val, len); + } + + return 0; +} + +static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = igd_pt_i440fx_initfn; + dc->desc = "IGD Passthrough Host bridge"; +} + +static const TypeInfo igd_passthrough_i440fx_info = { + .name = TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE, + .parent = TYPE_I440FX_PCI_DEVICE, + .instance_size = sizeof(PCII440FXState), + .class_init = igd_passthrough_i440fx_class_init, +}; + +static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, + PCIBus *rootbus) +{ + I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge); + + /* For backwards compat with old device paths */ + if (s->short_root_bus) { + return "0000"; + } + return "0000:00"; +} + +static Property i440fx_props[] = { + DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState, + pci_hole64_size, I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT), + DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0), + DEFINE_PROP_BOOL("x-pci-hole64-fix", I440FXState, pci_hole64_fix, true), + DEFINE_PROP_END_OF_LIST(), +}; + +static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass); + + hc->root_bus_path = i440fx_pcihost_root_bus_path; + dc->realize = i440fx_pcihost_realize; + dc->fw_name = "pci"; + dc->props = i440fx_props; + /* Reason: needs to be wired up by pc_init1 */ + dc->user_creatable = false; +} + +static const TypeInfo i440fx_pcihost_info = { + .name = TYPE_I440FX_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(I440FXState), + .instance_init = i440fx_pcihost_initfn, + .class_init = i440fx_pcihost_class_init, +}; + +static void i440fx_register_types(void) +{ + type_register_static(&i440fx_info); + type_register_static(&igd_passthrough_i440fx_info); + type_register_static(&i440fx_pcihost_info); +} + +type_init(i440fx_register_types) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 6f963b5a07..df08d94a59 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -1,5 +1,5 @@ /* - * QEMU i440FX/PIIX3 PCI Bridge Emulation + * QEMU PIIX South Bridge Emulation * * Copyright (c) 2006 Fabrice Bellard * @@ -23,38 +23,11 @@ */ #include "qemu/osdep.h" +#include "qemu/range.h" +#include "sysemu/sysemu.h" #include "hw/hw.h" -#include "hw/i386/pc.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" -#include "hw/pci-host/i440fx.h" #include "hw/southbridge/i82371_piix.h" -#include "hw/isa/isa.h" -#include "hw/sysbus.h" -#include "qapi/error.h" -#include "qemu/range.h" #include "hw/xen/xen.h" -#include "hw/pci-host/pam.h" -#include "sysemu/sysemu.h" -#include "hw/i386/ioapic.h" -#include "qapi/visitor.h" -#include "qemu/error-report.h" - -/* - * I440FX chipset data sheet. - * http://download.intel.com/design/chipsets/datashts/29054901.pdf - */ - -#define I440FX_PCI_HOST_BRIDGE(obj) \ - OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE) - -typedef struct I440FXState { - PCIHostState parent_obj; - Range pci_hole; - uint64_t pci_hole64_size; - bool pci_hole64_fix; - uint32_t short_root_bus; -} I440FXState; #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ #define XEN_PIIX_NUM_PIRQS 128ULL @@ -93,35 +66,6 @@ typedef struct PIIX3State { #define PIIX3_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX3State, (obj), TYPE_PIIX3_PCI_DEVICE) -#define I440FX_PCI_DEVICE(obj) \ - OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) - -struct PCII440FXState { - /*< private >*/ - PCIDevice parent_obj; - /*< public >*/ - - MemoryRegion *system_memory; - MemoryRegion *pci_address_space; - MemoryRegion *ram_memory; - PAMMemoryRegion pam_regions[13]; - MemoryRegion smram_region; - MemoryRegion smram, low_smram; -}; - - -#define I440FX_PAM 0x59 -#define I440FX_PAM_SIZE 7 -#define I440FX_SMRAM 0x72 - -/* Keep it 2G to comply with older win32 guests */ -#define I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT (1ULL << 31) - -/* Older coreboot versions (4.0 and older) read a config register that doesn't - * exist in real hardware, to get the RAM size from QEMU. - */ -#define I440FX_COREBOOT_RAM_SIZE 0x57 - /* return the global irq number corresponding to a given device irq pin. We could also use the bus number to have a more precise mapping. */ @@ -132,297 +76,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) return (pci_intx + slot_addend) & 3; } -static void i440fx_update_memory_mappings(PCII440FXState *d) -{ - int i; - PCIDevice *pd = PCI_DEVICE(d); - - memory_region_transaction_begin(); - for (i = 0; i < 13; i++) { - pam_update(&d->pam_regions[i], i, - pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]); - } - memory_region_set_enabled(&d->smram_region, - !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); - memory_region_set_enabled(&d->smram, - pd->config[I440FX_SMRAM] & SMRAM_G_SMRAME); - memory_region_transaction_commit(); -} - - -static void i440fx_write_config(PCIDevice *dev, - uint32_t address, uint32_t val, int len) -{ - PCII440FXState *d = I440FX_PCI_DEVICE(dev); - - /* XXX: implement SMRAM.D_LOCK */ - pci_default_write_config(dev, address, val, len); - if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) || - range_covers_byte(address, len, I440FX_SMRAM)) { - i440fx_update_memory_mappings(d); - } -} - -static int i440fx_load_old(QEMUFile* f, void *opaque, int version_id) -{ - PCII440FXState *d = opaque; - PCIDevice *pd = PCI_DEVICE(d); - int ret, i; - uint8_t smm_enabled; - - ret = pci_device_load(pd, f); - if (ret < 0) - return ret; - i440fx_update_memory_mappings(d); - qemu_get_8s(f, &smm_enabled); - - if (version_id == 2) { - for (i = 0; i < PIIX_NUM_PIRQS; i++) { - qemu_get_be32(f); /* dummy load for compatibility */ - } - } - - return 0; -} - -static int i440fx_post_load(void *opaque, int version_id) -{ - PCII440FXState *d = opaque; - - i440fx_update_memory_mappings(d); - return 0; -} - -static const VMStateDescription vmstate_i440fx = { - .name = "I440FX", - .version_id = 3, - .minimum_version_id = 3, - .minimum_version_id_old = 1, - .load_state_old = i440fx_load_old, - .post_load = i440fx_post_load, - .fields = (VMStateField[]) { - VMSTATE_PCI_DEVICE(parent_obj, PCII440FXState), - /* Used to be smm_enabled, which was basically always zero because - * SeaBIOS hardly uses SMM. SMRAM is now handled by CPU code. - */ - VMSTATE_UNUSED(1), - VMSTATE_END_OF_LIST() - } -}; - -static void i440fx_pcihost_get_pci_hole_start(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); - uint64_t val64; - uint32_t value; - - val64 = range_is_empty(&s->pci_hole) ? 0 : range_lob(&s->pci_hole); - value = val64; - assert(value == val64); - visit_type_uint32(v, name, &value, errp); -} - -static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); - uint64_t val64; - uint32_t value; - - val64 = range_is_empty(&s->pci_hole) ? 0 : range_upb(&s->pci_hole) + 1; - value = val64; - assert(value == val64); - visit_type_uint32(v, name, &value, errp); -} - -/* - * The 64bit PCI hole start is set by the Guest firmware - * as the address of the first 64bit PCI MEM resource. - * If no PCI device has resources on the 64bit area, - * the 64bit PCI hole will start after "over 4G RAM" and the - * reserved space for memory hotplug if any. - */ -static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, - const char *name, - void *opaque, Error **errp) -{ - PCIHostState *h = PCI_HOST_BRIDGE(obj); - I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); - Range w64; - uint64_t value; - - pci_bus_get_w64_range(h->bus, &w64); - value = range_is_empty(&w64) ? 0 : range_lob(&w64); - if (!value && s->pci_hole64_fix) { - value = pc_pci_hole64_start(); - } - visit_type_uint64(v, name, &value, errp); -} - -/* - * The 64bit PCI hole end is set by the Guest firmware - * as the address of the last 64bit PCI MEM resource. - * Then it is expanded to the PCI_HOST_PROP_PCI_HOLE64_SIZE - * that can be configured by the user. - */ -static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - PCIHostState *h = PCI_HOST_BRIDGE(obj); - I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); - uint64_t hole64_start = pc_pci_hole64_start(); - Range w64; - uint64_t value, hole64_end; - - pci_bus_get_w64_range(h->bus, &w64); - value = range_is_empty(&w64) ? 0 : range_upb(&w64) + 1; - hole64_end = ROUND_UP(hole64_start + s->pci_hole64_size, 1ULL << 30); - if (s->pci_hole64_fix && value < hole64_end) { - value = hole64_end; - } - visit_type_uint64(v, name, &value, errp); -} - -static void i440fx_pcihost_initfn(Object *obj) -{ - PCIHostState *s = PCI_HOST_BRIDGE(obj); - - memory_region_init_io(&s->conf_mem, obj, &pci_host_conf_le_ops, s, - "pci-conf-idx", 4); - memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s, - "pci-conf-data", 4); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", - i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", - i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL, NULL); -} - -static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) -{ - PCIHostState *s = PCI_HOST_BRIDGE(dev); - SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - - sysbus_add_io(sbd, 0xcf8, &s->conf_mem); - sysbus_init_ioports(sbd, 0xcf8, 4); - - sysbus_add_io(sbd, 0xcfc, &s->data_mem); - sysbus_init_ioports(sbd, 0xcfc, 4); -} - -static void i440fx_realize(PCIDevice *dev, Error **errp) -{ - dev->config[I440FX_SMRAM] = 0x02; - - if (object_property_get_bool(qdev_get_machine(), "iommu", NULL)) { - warn_report("i440fx doesn't support emulated iommu"); - } -} - -PCIBus *i440fx_init(const char *host_type, const char *pci_type, - PCII440FXState **pi440fx_state, - int *piix3_devfn, - ISABus **isa_bus, qemu_irq *pic, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, - ram_addr_t ram_size, - ram_addr_t below_4g_mem_size, - ram_addr_t above_4g_mem_size, - MemoryRegion *pci_address_space, - MemoryRegion *ram_memory) -{ - DeviceState *dev; - PCIBus *b; - PCIDevice *d; - PCIHostState *s; - PCII440FXState *f; - unsigned i; - I440FXState *i440fx; - - dev = qdev_create(NULL, host_type); - s = PCI_HOST_BRIDGE(dev); - b = pci_bus_new(dev, NULL, pci_address_space, - address_space_io, 0, TYPE_PCI_BUS); - s->bus = b; - object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL); - qdev_init_nofail(dev); - - d = pci_create_simple(b, 0, pci_type); - *pi440fx_state = I440FX_PCI_DEVICE(d); - f = *pi440fx_state; - f->system_memory = address_space_mem; - f->pci_address_space = pci_address_space; - f->ram_memory = ram_memory; - - i440fx = I440FX_PCI_HOST_BRIDGE(dev); - range_set_bounds(&i440fx->pci_hole, below_4g_mem_size, - IO_APIC_DEFAULT_ADDRESS - 1); - - /* setup pci memory mapping */ - pc_pci_as_mapping_init(OBJECT(f), f->system_memory, - f->pci_address_space); - - /* if *disabled* show SMRAM to all CPUs */ - memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region", - f->pci_address_space, 0xa0000, 0x20000); - memory_region_add_subregion_overlap(f->system_memory, 0xa0000, - &f->smram_region, 1); - memory_region_set_enabled(&f->smram_region, true); - - /* smram, as seen by SMM CPUs */ - memory_region_init(&f->smram, OBJECT(d), "smram", 1ull << 32); - memory_region_set_enabled(&f->smram, true); - memory_region_init_alias(&f->low_smram, OBJECT(d), "smram-low", - f->ram_memory, 0xa0000, 0x20000); - memory_region_set_enabled(&f->low_smram, true); - memory_region_add_subregion(&f->smram, 0xa0000, &f->low_smram); - object_property_add_const_link(qdev_get_machine(), "smram", - OBJECT(&f->smram), &error_abort); - - init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_space, - &f->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE); - for (i = 0; i < 12; ++i) { - init_pam(dev, f->ram_memory, f->system_memory, f->pci_address_space, - &f->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, - PAM_EXPAN_SIZE); - } - - piix3_init(b, isa_bus, pic, piix3_devfn); - - ram_size = ram_size / 8 / 1024 / 1024; - if (ram_size > 255) { - ram_size = 255; - } - d->config[I440FX_COREBOOT_RAM_SIZE] = ram_size; - - i440fx_update_memory_mappings(f); - - return b; -} - -PCIBus *find_i440fx(void) -{ - PCIHostState *s = OBJECT_CHECK(PCIHostState, - object_resolve_path("/machine/i440fx", NULL), - TYPE_PCI_HOST_BRIDGE); - return s ? s->bus : NULL; -} - /* PIIX3 PCI to ISA bridge */ static void piix3_set_irq_pic(PIIX3State *piix3, int pic_irq) { @@ -761,176 +414,11 @@ static const TypeInfo piix3_xen_info = { .class_init = piix3_xen_class_init, }; -static void i440fx_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - - k->realize = i440fx_realize; - k->config_write = i440fx_write_config; - k->vendor_id = PCI_VENDOR_ID_INTEL; - k->device_id = PCI_DEVICE_ID_INTEL_82441; - k->revision = 0x02; - k->class_id = PCI_CLASS_BRIDGE_HOST; - dc->desc = "Host bridge"; - dc->vmsd = &vmstate_i440fx; - /* - * PCI-facing part of the host bridge, not usable without the - * host-facing part, which can't be device_add'ed, yet. - */ - dc->user_creatable = false; - dc->hotpluggable = false; -} - -static const TypeInfo i440fx_info = { - .name = TYPE_I440FX_PCI_DEVICE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PCII440FXState), - .class_init = i440fx_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -/* IGD Passthrough Host Bridge. */ -typedef struct { - uint8_t offset; - uint8_t len; -} IGDHostInfo; - -/* Here we just expose minimal host bridge offset subset. */ -static const IGDHostInfo igd_host_bridge_infos[] = { - {0x08, 2}, /* revision id */ - {0x2c, 2}, /* sybsystem vendor id */ - {0x2e, 2}, /* sybsystem id */ - {0x50, 2}, /* SNB: processor graphics control register */ - {0x52, 2}, /* processor graphics control register */ - {0xa4, 4}, /* SNB: graphics base of stolen memory */ - {0xa8, 4}, /* SNB: base of GTT stolen memory */ -}; - -static int host_pci_config_read(int pos, int len, uint32_t *val) -{ - char path[PATH_MAX]; - int config_fd; - ssize_t size = sizeof(path); - /* Access real host bridge. */ - int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s", - 0, 0, 0, 0, "config"); - int ret = 0; - - if (rc >= size || rc < 0) { - return -ENODEV; - } - - config_fd = open(path, O_RDWR); - if (config_fd < 0) { - return -ENODEV; - } - - if (lseek(config_fd, pos, SEEK_SET) != pos) { - ret = -errno; - goto out; - } - - do { - rc = read(config_fd, (uint8_t *)val, len); - } while (rc < 0 && (errno == EINTR || errno == EAGAIN)); - if (rc != len) { - ret = -errno; - } - -out: - close(config_fd); - return ret; -} - -static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev) -{ - uint32_t val = 0; - int rc, i, num; - int pos, len; - - num = ARRAY_SIZE(igd_host_bridge_infos); - for (i = 0; i < num; i++) { - pos = igd_host_bridge_infos[i].offset; - len = igd_host_bridge_infos[i].len; - rc = host_pci_config_read(pos, len, &val); - if (rc) { - return -ENODEV; - } - pci_default_write_config(pci_dev, pos, val, len); - } - - return 0; -} - -static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - - k->init = igd_pt_i440fx_initfn; - dc->desc = "IGD Passthrough Host bridge"; -} - -static const TypeInfo igd_passthrough_i440fx_info = { - .name = TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE, - .parent = TYPE_I440FX_PCI_DEVICE, - .instance_size = sizeof(PCII440FXState), - .class_init = igd_passthrough_i440fx_class_init, -}; - -static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, - PCIBus *rootbus) -{ - I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge); - - /* For backwards compat with old device paths */ - if (s->short_root_bus) { - return "0000"; - } - return "0000:00"; -} - -static Property i440fx_props[] = { - DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState, - pci_hole64_size, I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT), - DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0), - DEFINE_PROP_BOOL("x-pci-hole64-fix", I440FXState, pci_hole64_fix, true), - DEFINE_PROP_END_OF_LIST(), -}; - -static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass); - - hc->root_bus_path = i440fx_pcihost_root_bus_path; - dc->realize = i440fx_pcihost_realize; - dc->fw_name = "pci"; - dc->props = i440fx_props; - /* Reason: needs to be wired up by pc_init1 */ - dc->user_creatable = false; -} - -static const TypeInfo i440fx_pcihost_info = { - .name = TYPE_I440FX_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(I440FXState), - .instance_init = i440fx_pcihost_initfn, - .class_init = i440fx_pcihost_class_init, -}; - -static void i440fx_register_types(void) +static void piix_register_types(void) { - type_register_static(&i440fx_info); - type_register_static(&igd_passthrough_i440fx_info); type_register_static(&piix3_pci_type_info); type_register_static(&piix3_info); type_register_static(&piix3_xen_info); - type_register_static(&i440fx_pcihost_info); } -type_init(i440fx_register_types) +type_init(piix_register_types) diff --git a/MAINTAINERS b/MAINTAINERS index c3efcd2316..a4dc72a47b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -849,6 +849,7 @@ S: Supported F: include/hw/i386/ F: hw/i386/ F: hw/pci-host/piix.c +F: hw/pci-host/i440fx.c F: hw/pci-host/q35.c F: hw/pci-host/pam.c F: include/hw/pci-host/q35.h diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs index 9c7909cf44..acf61023b5 100644 --- a/hw/pci-host/Makefile.objs +++ b/hw/pci-host/Makefile.objs @@ -14,6 +14,7 @@ common-obj-$(CONFIG_VERSATILE_PCI) += versatile.o common-obj-$(CONFIG_PCI_APB) += apb.o common-obj-$(CONFIG_FULONG) += bonito.o common-obj-$(CONFIG_PCI_PIIX) += piix.o +common-obj-$(CONFIG_PCI_I440FX) += i440fx.o common-obj-$(CONFIG_PCI_Q35) += q35.o common-obj-$(CONFIG_PCI_GENERIC) += gpex.o common-obj-$(CONFIG_PCI_XILINX) += xilinx-pcie.o From patchwork Mon Jan 8 02:45:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856684 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eYhJLiGk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKrJ1L7sz9s71 for ; Mon, 8 Jan 2018 14:04:48 +1100 (AEDT) Received: from localhost ([::1]:59567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNjy-0005Gy-7I for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:04:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTN-0007e3-EL for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTM-0003IV-Jj for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:37 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:38151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTM-0003IB-Fr for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:36 -0500 Received: by mail-qt0-x242.google.com with SMTP id d4so12062712qtj.5 for ; Sun, 07 Jan 2018 18:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wd8cVBthr3H2KQTWHDuMt3Tv5JkxVL/nZ3F5xT0ZU2g=; b=eYhJLiGkAP3xUZQ3FMVJhs6Td1wm3O58rkDcM7C7cLnW1o/uxLm3mBPLN4ebTzWFuI obDgyQqrRKmpO3whI5m6Ros1G14F/zZegJvu0bQ6SWztWrsOCC1SbGpd3gwsR+5Z1Vvr F+1vNhWzu71Gav4ZjsvopyAcuS8n6vN6zFSvWOLBcENGS1LfpEcnURiqlpEwR+57QJAq nNlRFKkbPjLk0TcppIT72z1PdDYXwX7Ik7U0OWiYdREZ9qqKt9aFXuVlxYZMEF5vSUzc h1YJ8EasSWbmHsx3JI87luXefUmCAhNQjFmUvhlyOmWHLhb88oZ6lyzPzhOL3cGSdv8P gVtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wd8cVBthr3H2KQTWHDuMt3Tv5JkxVL/nZ3F5xT0ZU2g=; b=kCSRjWgAKRP7Xq7te5GJzp/tKCmgo7NG/mnwNAZ7PAFS7XTy214oqtEcsmxBEqbi40 NUyaLV2fhB1xBlJoz916yfTtIuCGgjk9ZPNcKCaMswk3kI3YGTDVmRX9rllO8Di6gR/R /LLFyMy3cwA27ndzbzwA2iSxNcim8rBsGI9oJpOOyibCrjk7vcQ8GzjXnJlguqtPc0jy 0EYTzZTuJyAKr6bm/bEWYzp7fuwgtcypwFJaaH4CY+d7+f4QyhxBH6HOgPwi8cgIIwBb /rvbMff0Mov0j8uxoIrFbb9OO0ur9gEH1UHvqIzt2ByMvTp+2KhAebF3B24MHcSpgaon JhTw== X-Gm-Message-State: AKwxytcJYTzuaqq9CX837FBQw2kMirGO3NbTYOeEgbL5Yit6yTQRG42y w/PUA2/xIIyjcu/R7SEq/4Y= X-Google-Smtp-Source: ACJfBou8L7r9LCksajxxb4int9RtYYB+Td2taD6lLzmCOc2biRAPFMQTq65TBZmKxD6LmYjKSLVGDw== X-Received: by 10.200.5.5 with SMTP id u5mr13205757qtg.93.1515379655998; Sun, 07 Jan 2018 18:47:35 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:54 -0300 Message-Id: <20180108024558.17983-26-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 25/29] hw/i386: move piix from hw/pci-host to hw/southbridge 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/{pci-host => southbridge}/piix.c | 0 MAINTAINERS | 2 +- hw/Makefile.objs | 1 + hw/pci-host/Makefile.objs | 1 - hw/southbridge/Makefile.objs | 1 + 5 files changed, 3 insertions(+), 2 deletions(-) rename hw/{pci-host => southbridge}/piix.c (100%) create mode 100644 hw/southbridge/Makefile.objs diff --git a/hw/pci-host/piix.c b/hw/southbridge/piix.c similarity index 100% rename from hw/pci-host/piix.c rename to hw/southbridge/piix.c diff --git a/MAINTAINERS b/MAINTAINERS index a4dc72a47b..e88ed8851b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -848,7 +848,6 @@ M: Michael S. Tsirkin S: Supported F: include/hw/i386/ F: hw/i386/ -F: hw/pci-host/piix.c F: hw/pci-host/i440fx.c F: hw/pci-host/q35.c F: hw/pci-host/pam.c @@ -879,6 +878,7 @@ F: hw/intc/i8259* F: hw/isa/isa-superio.c F: hw/misc/debugexit.c F: hw/misc/pc-testdev.c +F: hw/southbridge/piix.c F: hw/timer/hpet* F: hw/timer/i8254* F: hw/timer/mc146818rtc* diff --git a/hw/Makefile.objs b/hw/Makefile.objs index cf4cb2010b..1594754976 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -21,6 +21,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += net/ devices-dirs-$(CONFIG_SOFTMMU) += nvram/ devices-dirs-$(CONFIG_SOFTMMU) += pci/ devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/ +devices-dirs-$(CONFIG_SOFTMMU) += southbridge/ devices-dirs-$(CONFIG_SOFTMMU) += pcmcia/ devices-dirs-$(CONFIG_SOFTMMU) += scsi/ devices-dirs-$(CONFIG_SOFTMMU) += sd/ diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs index acf61023b5..1ef713df2b 100644 --- a/hw/pci-host/Makefile.objs +++ b/hw/pci-host/Makefile.objs @@ -13,7 +13,6 @@ common-obj-$(CONFIG_VERSATILE_PCI) += versatile.o common-obj-$(CONFIG_PCI_APB) += apb.o common-obj-$(CONFIG_FULONG) += bonito.o -common-obj-$(CONFIG_PCI_PIIX) += piix.o common-obj-$(CONFIG_PCI_I440FX) += i440fx.o common-obj-$(CONFIG_PCI_Q35) += q35.o common-obj-$(CONFIG_PCI_GENERIC) += gpex.o diff --git a/hw/southbridge/Makefile.objs b/hw/southbridge/Makefile.objs new file mode 100644 index 0000000000..88e9273b3c --- /dev/null +++ b/hw/southbridge/Makefile.objs @@ -0,0 +1 @@ +common-obj-$(CONFIG_PCI_PIIX) += piix.o From patchwork Mon Jan 8 02:45:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EMzYxq/N"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKjR5SBkz9ryr for ; Mon, 8 Jan 2018 13:58:51 +1100 (AEDT) Received: from localhost ([::1]:59437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNeD-0000Wn-Rf for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:58:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTT-0007js-07 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTP-0003Jx-Uc for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:41729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTP-0003Ji-Q9 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:39 -0500 Received: by mail-qt0-x244.google.com with SMTP id i40so12057629qti.8 for ; Sun, 07 Jan 2018 18:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UfV0RdvuO2UwepHrWCD4AA8RkhKa30PQGG+K8J4xWCw=; b=EMzYxq/Npik25JT2ubiAskOUak9Ms4ECMVL+f/Lb0htKc3twPs1IbvkkZYcxdgrTzS In9fCC7vaTu+OAi7HQvKXTvU+vXOUy+XUi59IUmEiH3hOPu6MhC/DbmJkNk+oF0fdcTD rUP6+InA6T1F6z2PIYwuqIKBdp1plVGgKOgurglbV29mCoJsDsYvFwvlhWiECgw4Ds6m yIMrkBU5906UK7pBcv3l9srSwYYamD456MLomBDR2o5QIT8SQSLNEiflRtI+njoIhJef rcg9REVD3J0IohaB5PymT3ScKGmBkOutlOGJDzH4JxlL7FcSj9LCMWH9IZALJI5OTPnv w1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UfV0RdvuO2UwepHrWCD4AA8RkhKa30PQGG+K8J4xWCw=; b=RD2bjDPwThL8OmvkULTCxEp4HfKrmivIr5OGTZqA0nMRl5KKSVIojZYPb5Dx/m/1PX GrUZJGzPQnVZ548/AUMHJI/y9gyHIHUgWezlKB/HqM5SZ5iDsxQRa6WKXwktmwdstnsE 0B6yEabamv75LVkRyudUIAE5BXn289NWOSDnKzf8OVC1ObtovdqIW8ImUZ1ZQwS32oZf BfUYeOPe0F0Xhomg2JmEzN9S80fD6gMDsGnl3eayAGjUZyzKGPwKRLseUJIQ4u+WnCYl uVhAmIJuPicW0Pcuzhskl5GNooV1QdM99ODdb3JfHxGCVuL5yIdUg2dY+i5hFXx75bcy O8AA== X-Gm-Message-State: AKwxytcZGIkVljjVOiNBbKL6y7Z62OG4KdTYQzMTErjH1nCiInLhtdCD 4g1u3hY4MVs7nenI1hfSOyg= X-Google-Smtp-Source: ACJfBouz/rWm63PaSZzhBVp3YuT2yWTXvF1voIuqa8NRP+Q//jcbBtMzVF/QubdSOL+M6VHZo0kbgw== X-Received: by 10.200.23.117 with SMTP id u50mr13325496qtk.139.1515379659322; Sun, 07 Jan 2018 18:47:39 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:55 -0300 Message-Id: <20180108024558.17983-27-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 26/29] configs/mips-softmmu: use common CONFIG_PCI_PIIX instead of CONFIG_PIIX4 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- default-configs/mips-softmmu-common.mak | 2 +- hw/isa/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default-configs/mips-softmmu-common.mak b/default-configs/mips-softmmu-common.mak index 7d8f5db983..f29beb1419 100644 --- a/default-configs/mips-softmmu-common.mak +++ b/default-configs/mips-softmmu-common.mak @@ -22,7 +22,7 @@ CONFIG_ACPI_NVDIMM=y CONFIG_ACPI_CPU_HOTPLUG=y CONFIG_APM=y CONFIG_I8257=y -CONFIG_PIIX4=y +CONFIG_PCI_PIIX=y CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs index cac655ba58..fa071082d4 100644 --- a/hw/isa/Makefile.objs +++ b/hw/isa/Makefile.objs @@ -3,7 +3,7 @@ common-obj-$(CONFIG_ISA_BUS) += isa-superio.o common-obj-$(CONFIG_APM) += apm.o common-obj-$(CONFIG_I82378) += i82378.o common-obj-$(CONFIG_PC87312) += pc87312.o -common-obj-$(CONFIG_PIIX4) += piix4.o +common-obj-$(CONFIG_PCI_PIIX) += piix4.o common-obj-$(CONFIG_VT82C686) += vt82c686.o obj-$(CONFIG_LPC_ICH9) += lpc_ich9.o From patchwork Mon Jan 8 02:45:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MwCIUs9z"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKmp4mlBz9s71 for ; Mon, 8 Jan 2018 14:01:46 +1100 (AEDT) Received: from localhost ([::1]:59458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNh2-0002uV-NN for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:01:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTT-0007kl-TE for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTT-0003N9-4T for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:35539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTT-0003Lf-0F for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: by mail-qk0-x242.google.com with SMTP id w184so4360291qka.2 for ; Sun, 07 Jan 2018 18:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ssaMPAWNZUZH4tlMuDLWk1JF9IbM8J/Wy10NLAuPKcI=; b=MwCIUs9zRaJ8Wgc7EV2qnz8Hk0oEFyedZXrnn6y81po3/tOZPYFhHcvtGjQHmzVF5l 5pPr/9OqpTaQhAARSndMdiUeRDp6BtzDWql+8Q/Z7omywIMnTJkK0kvtFusnQKgGhm1J SAI3l282gvCKJ7GbAe4sAsa7w3JSl2bxZZilgNF/j5r5HXnpsavd4OOJ/ew8wNRgcDD5 gUAg0HH/g/eIYRcqp4HkyPW/0C8cmUeHUOm9j1NMxMfJl3FfDmzWPLQn9skYM8C5Bk6u m0NwLHthe9wpBpPPIFnD+vM6DNdTez8Lys9YXGyXNuEglUlQrlWsqNgkfLiyGInwarym 3mDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ssaMPAWNZUZH4tlMuDLWk1JF9IbM8J/Wy10NLAuPKcI=; b=oaP2+4Hwx8UjkAIA2pNKj1PH+BZEIYLTu59+CVAq8iaDXwCu+cH94We4cDziDu+h38 Nl83XHRhZqZ3bLNz9gfBXMYEQLQesZaa7/9TjU7Sb5Z7lGh2VaRpiLNy5PCQsrUTE81w ToGMa9Iudhv75fc82I/xZNGq6Z8oXsobgUtv40+Dk7vb2w9ApAgk68DOuPIOuYY0FgXR YbfpEJxZMCecaq5eMeMcMS2/5XeGUOYRTt+X0fSTabnypYG7L+84W9A6l1Kds6EpLu5q hgE3eUaANilO5SridAWj2HwHf+rU0WdDRE8lYvYC9uGah4kbDJj0eux139/Dd3VBarXM y85w== X-Gm-Message-State: AKGB3mLA6RfmJ3KoUAu/k5frzoR0uy0rmSCfePghfun+vgsSg7e/Q29V sGsw1z7CmOlGHguNpSH94BI= X-Google-Smtp-Source: ACJfBos8ycOhHUpMy+rebSoZ2PPYm0vSalT/poeElePpCx4X9fvGrn0GFkF+hVuofHlOUWKMJq07SQ== X-Received: by 10.55.195.69 with SMTP id a66mr13423851qkj.83.1515379662476; Sun, 07 Jan 2018 18:47:42 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:56 -0300 Message-Id: <20180108024558.17983-28-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 27/29] piix3: convert reset function to QOM 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/southbridge/piix.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/southbridge/piix.c b/hw/southbridge/piix.c index df08d94a59..2d429d6b29 100644 --- a/hw/southbridge/piix.c +++ b/hw/southbridge/piix.c @@ -203,10 +203,10 @@ static void piix3_write_config_xen(PCIDevice *dev, piix3_write_config(dev, address, val, len); } -static void piix3_reset(void *opaque) +static void piix3_reset(DeviceState *dev) { - PIIX3State *d = opaque; - uint8_t *pci_conf = d->dev.config; + PIIX3State *s = PIIX3_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; pci_conf[0x04] = 0x07; /* master, memory and I/O */ pci_conf[0x05] = 0x00; @@ -240,8 +240,8 @@ static void piix3_reset(void *opaque) pci_conf[0xac] = 0x00; pci_conf[0xae] = 0x00; - d->pic_levels = 0; - d->rcr = 0; + s->pic_levels = 0; + s->rcr = 0; } static int piix3_post_load(void *opaque, int version_id) @@ -352,8 +352,6 @@ static void piix3_realize(PCIDevice *dev, Error **errp) "piix3-reset-control", 1); memory_region_add_subregion_overlap(pci_address_space_io(dev), RCR_IOPORT, &d->rcr_mem, 1); - - qemu_register_reset(piix3_reset, d); } static void pci_piix3_class_init(ObjectClass *klass, void *data) @@ -364,6 +362,7 @@ static void pci_piix3_class_init(ObjectClass *klass, void *data) dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix3; dc->hotpluggable = false; + dc->reset = piix3_reset; k->realize = piix3_realize; k->vendor_id = PCI_VENDOR_ID_INTEL; /* 82371SB PIIX3 PCI-to-ISA bridge (Step A1) */ From patchwork Mon Jan 8 02:45:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LFBYVvJL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKk75MMBz9s7n for ; Mon, 8 Jan 2018 13:59:27 +1100 (AEDT) Received: from localhost ([::1]:59438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNek-0000yZ-QH for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 21:59:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTZ-0007q0-2i for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTX-0003Pc-1h for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:49 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:44110) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTW-0003PL-SA for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:46 -0500 Received: by mail-qk0-x241.google.com with SMTP id v188so12537486qkh.11 for ; Sun, 07 Jan 2018 18:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RuRleaNPTZ4g3RGtHoM/VVf6IfBqlBZIoudl06L+1k4=; b=LFBYVvJLXZckULc03pLNZDCkkFOd7s/sLkp+mULo+QGSdwrFHlqDA7tx2SiDGziN9b 6HQiFVNy8F6MuZMArzTjIYzKyDkXUVe77ONU40F+d5f5Uysa5f43sgLWuj43AbwqSt2K 6iLbLbYUDXYDivGEtI+Hy01iCLFs7Cp90soVTLA+jT+KPKQ4ZjmxBKnKbfZ0STIWbCCD HcPhS9AKXv5AkCcss3MAZVEaISbgMNTZp3yee+o6dJzzWav6zStqeF4RAahgD+Y0J1Vg sJBPOL7hyof7I3aSpOZhR/7nsqmZ1fhMURrhVgHmTyw6kpwn5PXy9PaqezZitQ0a1GQE WJmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RuRleaNPTZ4g3RGtHoM/VVf6IfBqlBZIoudl06L+1k4=; b=ImN6HpTVBYJhyr9VejORqmAJSEICcN0Vy8dQqX9TQhlu4aV5wZRRynSZNyL9AExQ2V 0DDDB8FBAV4IxD/eW1vp7fjZQZ7UEJw0Vdv7HvSQ6RUPfi8+6lSjvvWfXfjSGAQhDLA4 1p20ZtAqEjGA8Q8c8scyJyTAFSOImfkVDpkZXxzAhSrwqJTCmfTbmTbm1x0iBuTKa+5R zazDI+/5m8TGI7LitXxgcYP2yKWzcLvPRkx9gTTJMH3RKfttbvq6wF3UrzJLayr6+ufL IhXleVBuTj+jHURlUFRTkvNn8s4X1TTO4u2dWlV5pYrdyJGpJtp8uIuD4b/ZfCuM6JE0 09zg== X-Gm-Message-State: AKGB3mKt+1HGsfhjscA8BdyILEzMYwn0JPuNJ2tA1CDBzyswQmLW+n2v Yk2Z45p0MP5jnB8P7jC6jQg= X-Google-Smtp-Source: ACJfBovChyb07P7jv41egKmJV0UJ2xRWjgkPD1C16DUZHe6oLnNMhy38CgS3cm4lXZhFXVWcPIgPZA== X-Received: by 10.55.150.198 with SMTP id y189mr14969021qkd.300.1515379666202; Sun, 07 Jan 2018 18:47:46 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussinea?= =?utf-8?q?u?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:57 -0300 Message-Id: <20180108024558.17983-29-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 28/29] piix: merge common code from isa/piix4.c with southbridge piix3 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: Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 218 -------------------------------------------- hw/southbridge/piix.c | 246 +++++++++++++++++++++++++++++++++++++++++--------- hw/isa/Makefile.objs | 1 - 3 files changed, 203 insertions(+), 262 deletions(-) delete mode 100644 hw/isa/piix4.c diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c deleted file mode 100644 index c78516e595..0000000000 --- a/hw/isa/piix4.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - * QEMU PIIX4 PCI Bridge Emulation - * - * Copyright (c) 2006 Fabrice Bellard - * Copyright (c) 2018 Hervé Poussineau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "hw/hw.h" -#include "hw/i386/pc.h" -#include "hw/pci/pci.h" -#include "hw/isa/isa.h" -#include "hw/southbridge/i82371_piix.h" -#include "hw/dma/i8257.h" -#include "hw/sysbus.h" -#include "hw/audio/pcspk.h" -#include "hw/timer/i8254.h" - -PCIDevice *piix4_dev; - -typedef struct PIIX4State { - PCIDevice dev; - qemu_irq cpu_intr; - qemu_irq *isa; - - /* Reset Control Register */ - MemoryRegion rcr_mem; - uint8_t rcr; -} PIIX4State; - -#define TYPE_PIIX4_PCI_DEVICE "PIIX4" -#define PIIX4_PCI_DEVICE(obj) \ - OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) - -static void piix4_reset(DeviceState *dev) -{ - PIIX4State *s = PIIX4_PCI_DEVICE(dev); - uint8_t *pci_conf = s->dev.config; - - pci_conf[0x04] = 0x07; // master, memory and I/O - pci_conf[0x05] = 0x00; - pci_conf[0x06] = 0x00; - pci_conf[0x07] = 0x02; // PCI_status_devsel_medium - pci_conf[0x4c] = 0x4d; - pci_conf[0x4e] = 0x03; - pci_conf[0x4f] = 0x00; - pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10 - pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10 - pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11 - pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11 - pci_conf[0x69] = 0x02; - pci_conf[0x70] = 0x80; - pci_conf[0x76] = 0x0c; - pci_conf[0x77] = 0x0c; - pci_conf[0x78] = 0x02; - pci_conf[0x79] = 0x00; - pci_conf[0x80] = 0x00; - pci_conf[0x82] = 0x00; - pci_conf[0xa0] = 0x08; - pci_conf[0xa2] = 0x00; - pci_conf[0xa3] = 0x00; - pci_conf[0xa4] = 0x00; - pci_conf[0xa5] = 0x00; - pci_conf[0xa6] = 0x00; - pci_conf[0xa7] = 0x00; - pci_conf[0xa8] = 0x0f; - pci_conf[0xaa] = 0x00; - pci_conf[0xab] = 0x00; - pci_conf[0xac] = 0x00; - pci_conf[0xae] = 0x00; -} - -static const VMStateDescription vmstate_piix4 = { - .name = "PIIX4", - .version_id = 2, - .minimum_version_id = 2, - .fields = (VMStateField[]) { - VMSTATE_PCI_DEVICE(dev, PIIX4State), - VMSTATE_END_OF_LIST() - } -}; - -static void piix4_request_i8259_irq(void *opaque, int irq, int level) -{ - PIIX4State *s = opaque; - qemu_set_irq(s->cpu_intr, level); -} - -static void piix4_set_i8259_irq(void *opaque, int irq, int level) -{ - PIIX4State *s = opaque; - qemu_set_irq(s->isa[irq], level); -} - -static void piix4_rcr_write(void *opaque, hwaddr addr, uint64_t val, - unsigned int len) -{ - PIIX4State *s = opaque; - - if (val & 4) { - qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); - return; - } - s->rcr = val & 2; /* keep System Reset type only */ -} - -static uint64_t piix4_rcr_read(void *opaque, hwaddr addr, unsigned int len) -{ - PIIX4State *s = opaque; - return s->rcr; -} - -static const MemoryRegionOps piix4_rcr_ops = { - .read = piix4_rcr_read, - .write = piix4_rcr_write, - .endianness = DEVICE_LITTLE_ENDIAN, - .impl = { - .min_access_size = 1, - .max_access_size = 1, - }, -}; - -static void piix4_realize(PCIDevice *pci_dev, Error **errp) -{ - DeviceState *dev = DEVICE(pci_dev); - PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); - ISABus *isa_bus; - ISADevice *pit; - qemu_irq *i8259_out_irq; - - isa_bus = isa_bus_new(dev, pci_address_space(pci_dev), - pci_address_space_io(pci_dev), errp); - if (!isa_bus) { - return; - } - - qdev_init_gpio_in_named(dev, piix4_set_i8259_irq, "isa", ISA_NUM_IRQS); - qdev_init_gpio_out_named(dev, &s->cpu_intr, "intr", 1); - - memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, - "reset-control", 1); - memory_region_add_subregion_overlap(pci_address_space_io(pci_dev), 0xcf9, - &s->rcr_mem, 1); - - /* initialize i8259 pic */ - i8259_out_irq = qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); - s->isa = i8259_init(isa_bus, *i8259_out_irq); - - /* initialize ISA irqs */ - isa_bus_irqs(isa_bus, s->isa); - - /* initialize pit */ - pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - - /* speaker */ - pcspk_init(isa_bus, pit); - - /* DMA */ - i8257_dma_init(isa_bus, 0); - - piix4_dev = pci_dev; -} - -static void piix4_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - - k->realize = piix4_realize; - k->vendor_id = PCI_VENDOR_ID_INTEL; - k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; - k->class_id = PCI_CLASS_BRIDGE_ISA; - dc->reset = piix4_reset; - dc->desc = "ISA bridge"; - dc->vmsd = &vmstate_piix4; - /* - * Reason: part of PIIX4 southbridge, needs to be wired up, - * e.g. by mips_malta_init() - */ - dc->user_creatable = false; - dc->hotpluggable = false; -} - -static const TypeInfo piix4_info = { - .name = TYPE_PIIX4_PCI_DEVICE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PIIX4State), - .class_init = piix4_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -static void piix4_register_types(void) -{ - type_register_static(&piix4_info); -} - -type_init(piix4_register_types) diff --git a/hw/southbridge/piix.c b/hw/southbridge/piix.c index 2d429d6b29..53ee177866 100644 --- a/hw/southbridge/piix.c +++ b/hw/southbridge/piix.c @@ -24,17 +24,26 @@ #include "qemu/osdep.h" #include "qemu/range.h" +#include "qapi/error.h" #include "sysemu/sysemu.h" #include "hw/hw.h" +#include "hw/i386/pc.h" #include "hw/southbridge/i82371_piix.h" +#include "hw/dma/i8257.h" +#include "hw/audio/pcspk.h" +#include "hw/timer/i8254.h" #include "hw/xen/xen.h" #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ #define XEN_PIIX_NUM_PIRQS 128ULL #define PIIX_PIRQC 0x60 -typedef struct PIIX3State { +typedef struct PIIXState { + /*< private >*/ PCIDevice dev; + /*< public >*/ + + ISABus *isa_bus; /* * bitmap to track pic levels. @@ -50,6 +59,7 @@ typedef struct PIIX3State { #endif uint64_t pic_levels; + qemu_irq cpu_intr; qemu_irq *pic; /* This member isn't used. Just for save/load compatibility */ @@ -57,14 +67,43 @@ typedef struct PIIX3State { /* Reset Control Register contents */ uint8_t rcr; - /* IO memory region for Reset Control Register (RCR_IOPORT) */ MemoryRegion rcr_mem; -} PIIX3State; +} PIIXState; -#define TYPE_PIIX3_PCI_DEVICE "pci-piix3" -#define PIIX3_PCI_DEVICE(obj) \ - OBJECT_CHECK(PIIX3State, (obj), TYPE_PIIX3_PCI_DEVICE) +static void piix_rcr_write(void *opaque, hwaddr addr, uint64_t val, + unsigned int len) +{ + PIIXState *s = opaque; + + if (val & 4) { + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + s->rcr = val & 2; /* keep System Reset type only */ +} + +static uint64_t piix_rcr_read(void *opaque, hwaddr addr, unsigned int len) +{ + PIIXState *s = opaque; + return s->rcr; +} + +static const MemoryRegionOps rcr_ops = { + .read = piix_rcr_read, + .write = piix_rcr_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .impl = { + .min_access_size = 1, + .max_access_size = 1, + }, +}; + +static void piix_rcr_init(PIIXState *s, MemoryRegion *io, const char *regname) +{ + memory_region_init_io(&s->rcr_mem, OBJECT(s), &rcr_ops, s, regname, 1); + memory_region_add_subregion_overlap(io, RCR_IOPORT, &s->rcr_mem, 1); +} /* return the global irq number corresponding to a given device irq pin. We could also use the bus number to have a more precise @@ -76,6 +115,28 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx) return (pci_intx + slot_addend) & 3; } +static void piix_realize(PCIDevice *pci_dev, PIIXState *s, Error **errp) +{ + MemoryRegion *pci_io = pci_address_space_io(pci_dev); + + s->isa_bus = isa_bus_new(DEVICE(s), pci_address_space(pci_dev), + pci_io, errp); + if (!s->isa_bus) { + if (!errp) { + error_setg(errp, "can not create ISA bus"); + } + return; + } + + piix_rcr_init(s, pci_io, "reset-control"); +} + +typedef struct PIIXState PIIX3State; + +#define TYPE_PIIX3_PCI_DEVICE "pci-piix3" +#define PIIX3_PCI_DEVICE(obj) \ + OBJECT_CHECK(PIIX3State, (obj), TYPE_PIIX3_PCI_DEVICE) + /* PIIX3 PCI to ISA bridge */ static void piix3_set_irq_pic(PIIX3State *piix3, int pic_irq) { @@ -314,44 +375,9 @@ static const VMStateDescription vmstate_piix3 = { } }; - -static void rcr_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) -{ - PIIX3State *d = opaque; - - if (val & 4) { - qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); - return; - } - d->rcr = val & 2; /* keep System Reset type only */ -} - -static uint64_t rcr_read(void *opaque, hwaddr addr, unsigned len) -{ - PIIX3State *d = opaque; - - return d->rcr; -} - -static const MemoryRegionOps rcr_ops = { - .read = rcr_read, - .write = rcr_write, - .endianness = DEVICE_LITTLE_ENDIAN -}; - -static void piix3_realize(PCIDevice *dev, Error **errp) +static void piix3_realize(PCIDevice *pci_dev, Error **errp) { - PIIX3State *d = PIIX3_PCI_DEVICE(dev); - - if (!isa_bus_new(DEVICE(d), get_system_memory(), - pci_address_space_io(dev), errp)) { - return; - } - - memory_region_init_io(&d->rcr_mem, OBJECT(dev), &rcr_ops, d, - "piix3-reset-control", 1); - memory_region_add_subregion_overlap(pci_address_space_io(dev), RCR_IOPORT, - &d->rcr_mem, 1); + piix_realize(pci_dev, PIIX3_PCI_DEVICE(pci_dev), errp); } static void pci_piix3_class_init(ObjectClass *klass, void *data) @@ -413,11 +439,145 @@ static const TypeInfo piix3_xen_info = { .class_init = piix3_xen_class_init, }; +typedef struct PIIXState PIIX4State; + +#define TYPE_PIIX4_PCI_DEVICE "PIIX4" +#define PIIX4_PCI_DEVICE(obj) \ + OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) + +static const VMStateDescription vmstate_piix4 = { + .name = "PIIX4", + .version_id = 2, + .minimum_version_id = 2, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(dev, PIIX4State), + VMSTATE_END_OF_LIST() + } +}; + +static void piix4_request_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->cpu_intr, level); +} + +static void piix4_set_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->pic[irq], level); +} + +static void piix4_reset(DeviceState *dev) +{ + PIIX4State *s = PIIX4_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; + + pci_conf[0x04] = 0x07; /* master, memory and I/O */ + pci_conf[0x05] = 0x00; + pci_conf[0x06] = 0x00; + pci_conf[0x07] = 0x02; /* PCI_status_devsel_medium */ + pci_conf[0x4c] = 0x4d; + pci_conf[0x4e] = 0x03; + pci_conf[0x4f] = 0x00; + pci_conf[0x60] = 0x0a; /* PCI A -> IRQ 10 */ + pci_conf[0x61] = 0x0a; /* PCI B -> IRQ 10 */ + pci_conf[0x62] = 0x0b; /* PCI C -> IRQ 11 */ + pci_conf[0x63] = 0x0b; /* PCI D -> IRQ 11 */ + pci_conf[0x69] = 0x02; + pci_conf[0x70] = 0x80; + pci_conf[0x76] = 0x0c; + pci_conf[0x77] = 0x0c; + pci_conf[0x78] = 0x02; + pci_conf[0x79] = 0x00; + pci_conf[0x80] = 0x00; + pci_conf[0x82] = 0x00; + pci_conf[0xa0] = 0x08; + pci_conf[0xa2] = 0x00; + pci_conf[0xa3] = 0x00; + pci_conf[0xa4] = 0x00; + pci_conf[0xa5] = 0x00; + pci_conf[0xa6] = 0x00; + pci_conf[0xa7] = 0x00; + pci_conf[0xa8] = 0x0f; + pci_conf[0xaa] = 0x00; + pci_conf[0xab] = 0x00; + pci_conf[0xac] = 0x00; + pci_conf[0xae] = 0x00; +} + +PCIDevice *piix4_dev; + +static void piix4_realize(PCIDevice *pci_dev, Error **errp) +{ + DeviceState *dev = DEVICE(pci_dev); + PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); + ISADevice *pit; + qemu_irq *i8259_out_irq; + + piix_realize(pci_dev, s, errp); + if (errp) { + return; + } + + qdev_init_gpio_in_named(dev, piix4_set_i8259_irq, "isa", ISA_NUM_IRQS); + qdev_init_gpio_out_named(dev, &s->cpu_intr, "intr", 1); + + /* initialize i8259 pic */ + i8259_out_irq = qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); + s->pic = i8259_init(s->isa_bus, *i8259_out_irq); + + /* initialize ISA irqs */ + isa_bus_irqs(s->isa_bus, s->pic); + + /* initialize pit */ + pit = i8254_pit_init(s->isa_bus, 0x40, 0, NULL); + + /* speaker */ + pcspk_init(s->isa_bus, pit); + + /* DMA */ + i8257_dma_init(s->isa_bus, 0); + + piix4_dev = pci_dev; +} + +static void piix4_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->realize = piix4_realize; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; + k->class_id = PCI_CLASS_BRIDGE_ISA; + dc->reset = piix4_reset; + dc->desc = "ISA bridge"; + dc->vmsd = &vmstate_piix4; + /* + * Reason: part of PIIX4 southbridge, needs to be wired up, + * e.g. by mips_malta_init() + */ + dc->user_creatable = false; + dc->hotpluggable = false; +} + +static const TypeInfo piix4_info = { + .name = TYPE_PIIX4_PCI_DEVICE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PIIX4State), + .class_init = piix4_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + static void piix_register_types(void) { type_register_static(&piix3_pci_type_info); type_register_static(&piix3_info); type_register_static(&piix3_xen_info); + type_register_static(&piix4_info); } type_init(piix_register_types) diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs index fa071082d4..40c34ba184 100644 --- a/hw/isa/Makefile.objs +++ b/hw/isa/Makefile.objs @@ -3,7 +3,6 @@ common-obj-$(CONFIG_ISA_BUS) += isa-superio.o common-obj-$(CONFIG_APM) += apm.o common-obj-$(CONFIG_I82378) += i82378.o common-obj-$(CONFIG_PC87312) += pc87312.o -common-obj-$(CONFIG_PCI_PIIX) += piix4.o common-obj-$(CONFIG_VT82C686) += vt82c686.o obj-$(CONFIG_LPC_ICH9) += lpc_ich9.o From patchwork Mon Jan 8 02:45:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aJyOYTUQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFKrS4T82z9s71 for ; Mon, 8 Jan 2018 14:04:56 +1100 (AEDT) Received: from localhost ([::1]:59571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNk6-0005QS-Gm for incoming@patchwork.ozlabs.org; Sun, 07 Jan 2018 22:04:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTc-0007rn-Cs for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTZ-0003Qx-BH for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:52 -0500 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:41417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTZ-0003Ql-6P for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:49 -0500 Received: by mail-qk0-x22a.google.com with SMTP id a8so12538367qkb.8 for ; Sun, 07 Jan 2018 18:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VGLFtyVueHLBaU+KVn//MM864H1kdPWzINwkth7MDLY=; b=aJyOYTUQ1ecoIFIZoNuCIM2UPWBHrzE5gVL5c1oqPk3mLrN3NgVehSIcymDpzFOP2M Td3hNcWtkS+7ABMrGpBVtu1GQjQh3xmi9aH2brdgvWNucTBg/BcOwl4ohmMRt0vu3jfm DzcCYqwXRdW3PrGpxitmYc55W8c54xKXUgzuOpQzRem/VYmwi1Z20bm+PLR465FYt41t oYnsi07ifmkoMWKH3VapNje+G9cmCcleGPsd6BvJN6RUISdSxrg7qZ4XnTHWdJ0qFEd6 tgWu5K3J8fR7jBF5oEp38LOqd6sfaFILTcBeErBhrJNGMAK2w64zN39RK0r8faoGmdX3 arUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VGLFtyVueHLBaU+KVn//MM864H1kdPWzINwkth7MDLY=; b=thc3ZzqtYpV5NXddnOCSD3u+RihVyf3GaPg3bBsrpTQbQxZRTrfp/zT1johyEedvSq CwxWJ+yH5yhN9IamYvXY29F7FrOM8Akbq8unS1nexxCIqEU4t10zm6pGaYNYamhyo8TI vt2q90kfRtQm4QUzi5+cv8zbM794CvJ0RnVeNgxz6yRxBRW67ICB/ZKFaFN/ulm1Tv0j GuxXQUqqMa2uiURMiFiCZVFx4Ad4Y7nG9B9OZfzHdkzPXGQuUP6mxgyQDMpUDu9vlp84 UwBvJsxZYFBmOd/paEie0F5xjF8Xj5dJIaQPPa5N76Pxf6zDkLGfGqM+vkSCO0c1lvrC xMKg== X-Gm-Message-State: AKwxytcRjjzBuM9G9CC6M/OEgwdZT/iHWHe+aI+rkCs1+14iiEbrthws cqfH46Etd6Pu01eDk0mKfik= X-Google-Smtp-Source: ACJfBotIvGRNeEXYWYyzq/8GwXEnLqhGgHZw1ljz6GXB1or+Ol4+vtyYzd5VsAW0VfLDkQreTmrkiw== X-Received: by 10.55.96.199 with SMTP id u190mr14445064qkb.28.1515379668652; Sun, 07 Jan 2018 18:47:48 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Herv=C3=A9_Poussineau?= Date: Sun, 7 Jan 2018 23:45:58 -0300 Message-Id: <20180108024558.17983-30-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22a Subject: [Qemu-devel] [NOTFORMERGE PATCH 29/29] piix4: add isa_superio_init 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: Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For Hervé to test his VirtualPC2007. hw/southbridge/piix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/southbridge/piix.c b/hw/southbridge/piix.c index 53ee177866..b800d538da 100644 --- a/hw/southbridge/piix.c +++ b/hw/southbridge/piix.c @@ -32,6 +32,7 @@ #include "hw/dma/i8257.h" #include "hw/audio/pcspk.h" #include "hw/timer/i8254.h" +#include "hw/isa/superio.h" #include "hw/xen/xen.h" #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ @@ -538,6 +539,8 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* DMA */ i8257_dma_init(s->isa_bus, 0); + isa_superio_init(s->isa_bus, 2, 1, 1); + piix4_dev = pci_dev; }