From patchwork Thu Mar 8 22:39: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: 883398 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; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d/hJEjBD"; 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 3zy5VQ03yRz9sfg for ; Fri, 9 Mar 2018 09:56:44 +1100 (AEDT) Received: from localhost ([::1]:42313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Sn-0003TL-J8 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:56:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D8-0007CV-Iz for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D7-0004Hz-Ag for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:30 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:38300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D7-0004GC-05 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:29 -0500 Received: by mail-wm0-x241.google.com with SMTP id z9so681180wmb.3 for ; Thu, 08 Mar 2018 14:40: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=LaH9lS0Rh473ceQo0RVQSXSQ5r0vdjDcRsNCm7bJndM=; b=d/hJEjBDaTAqDsC1qtna+O+vSA9jC/k73/VRaUsXwfRe5YLmjqvWR07Zr6jRL9hG5p db6fQXv9iydRcDzWFVerBwRvobvlMcGYjFBMX1MoUI1fnmUzKVPDnCH+ATq6ZarhpWOh M57wR3CdbJYWNzxS2DrAwH0qQzsAd4waxKwvLmi8+Ibzm+6kFY6Hzg8tmySrCyn90So6 vxlz4JtY5vy15RBqfSJXzC/0kdEvgeiCrsC33avhD7NZAHYp7Fr7eWUPWK28RHM5Jdrm f1EuKzEagCJApyF+0vL65mnDYob01rPwo0eyIW4LSZOITDc11n4zbqzTRMQdau5Z/QtP 723w== 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=LaH9lS0Rh473ceQo0RVQSXSQ5r0vdjDcRsNCm7bJndM=; b=Wv+/XtjP8j+VyXFA0z9Lh3H98zMlkK/XvffIDV+fMAgkPqSnqSER/xS+rCCJ/YqHlV PSlstG+WIJ+hNtCPYaTLZbOQffBN9v1oDFuMLxwV7v5psTxbMD6NLVzWnAKYFRcvPDHM f+3cfv/QcV9gSH1cAZMrI0kx5r4PEmT6IEaJc6utpTRbaQdrnYzB4CzuKTNg/GIMNzx6 JRZ89Q5SNQQ/jxNOaOh4oHh6XnVRja+zTI9DymrQzeSCvO4tmJ8it5B7Xt00E7sQybCy Q2j1jG6BBZ+Gdn0HG81NTOYNwDyzypnsJes4OyfuCom8A5oZDwuZOKW0Wv6lfhDgB5yq fPDQ== X-Gm-Message-State: AElRT7EJ2kP5ZQ3sZ0bis8RzrbyS8jOp0G5/utwaD2yVfPyUIToixRJB iy+dY/yN63HY7amb5XVdyo0= X-Google-Smtp-Source: AG47ELuTYHikJYKQI+AGL1Z+5S2r8c7kuzgTJb9sl1Nm4vzKImakTnTk8VpsepRWTlfGqy1lby+jBg== X-Received: by 10.28.137.21 with SMTP id l21mr281905wmd.31.1520548827975; Thu, 08 Mar 2018 14:40:27 -0800 (PST) Received: from x1.local (ABayonne-654-1-76-150.w86-222.abo.wanadoo.fr. [86.222.219.150]) by smtp.gmail.com with ESMTPSA id x190sm19315070wme.27.2018.03.08.14.40.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?q?Herv=C3=A9_Poussineau?= , Marcel Apfelbaum , Aurelien Jarno , Alexey Kardashevskiy , Yongbok Kim , Thomas Huth Date: Thu, 8 Mar 2018 23:39:40 +0100 Message-Id: <20180308223946.26784-20-f4bug@amsat.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180308223946.26784-1-f4bug@amsat.org> References: <20180308223946.26784-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: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 19/25] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO 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: Eduardo Habkost , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Guan Xuetao , 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/isa/vt82c686.h | 2 ++ hw/isa/vt82c686.c | 20 ++++++++++++++++++++ hw/mips/mips_fulong2e.c | 15 +++------------ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index db97c8ed7a..c3c2b6e786 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -1,6 +1,8 @@ #ifndef HW_VT82C686_H #define HW_VT82C686_H +#define TYPE_VT82C686B_SUPERIO "vt82c686b-superio" + /* vt82c686.c */ ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn); void vt82c686b_ac97_init(PCIBus *bus, int devfn); diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 7eaf3c7e8f..cff1946232 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -17,6 +17,7 @@ #include "hw/i2c/smbus.h" #include "hw/pci/pci.h" #include "hw/isa/isa.h" +#include "hw/isa/superio.h" #include "hw/sysbus.h" #include "hw/mips/mips.h" #include "hw/isa/apm.h" @@ -519,11 +520,30 @@ static const TypeInfo via_info = { }, }; +static void vt82c686b_superio_class_init(ObjectClass *klass, void *data) +{ + ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); + + sc->serial.count = 2; + sc->parallel.count = 1; + sc->ide.count = 0; + sc->floppy.count = 1; +} + +static const TypeInfo via_superio_info = { + .name = TYPE_VT82C686B_SUPERIO, + .parent = TYPE_ISA_SUPERIO, + .instance_size = sizeof(ISASuperIODevice), + .class_size = sizeof(ISASuperIOClass), + .class_init = vt82c686b_superio_class_init, +}; + static void vt82c686b_register_types(void) { type_register_static(&via_ac97_info); type_register_static(&via_mc97_info); type_register_static(&via_pm_info); + type_register_static(&via_superio_info); type_register_static(&via_info); } diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 9ebc225d3b..d608f17e1e 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -23,9 +23,7 @@ #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" @@ -34,7 +32,6 @@ #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/pci/pci.h" -#include "sysemu/sysemu.h" #include "audio/audio.h" #include "qemu/log.h" #include "hw/loader.h" @@ -44,8 +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" #include "qemu/error-report.h" @@ -250,6 +245,8 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc, /* init other devices */ i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); + /* Super I/O */ + isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO); ide_drive_get(hd, ARRAY_SIZE(hd)); vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1)); @@ -262,12 +259,6 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc, /* Audio support */ vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5)); vt82c686b_mc97_init(pci_bus, PCI_DEVFN(slot, 6)); - - /* Super I/O */ - isa_create_simple(isa_bus, TYPE_I8042); - - serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); - parallel_hds_isa_init(isa_bus, 1); } /* Network support */