From patchwork Thu Mar 8 22:39:22 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: 883369 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="quvSvTBA"; 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 3zy5861w5Jz9sl2 for ; Fri, 9 Mar 2018 09:40:54 +1100 (AEDT) Received: from localhost ([::1]:42215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DT-0006in-H0 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:40:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cd-0006iU-0a for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cb-0003ox-NN for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:39:59 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:44420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cb-0003oe-Dl for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:39:57 -0500 Received: by mail-wr0-x242.google.com with SMTP id v65so7240663wrc.11 for ; Thu, 08 Mar 2018 14:39:57 -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=Debooa8+ZuSErOyurW+hpQkXGXTukEOcoIVTtJTjnZY=; b=quvSvTBAfr9CzDREI/+xjej/1RIvjbEWOGtKhSiagAz7hhk6aU+sfL77MPb/3rW5f5 ZURAiVBVfyDlJ3oIDDW29sVHk8YaxTYblkBt5NNWYlaC6OmR/slm6NzwF1cXnsYDAzLa XhKn64s+715ym+6v9uZlz2SSg3gGSQhC9vv+WPzkhD3Ii9ZtvnP2smXvobs0npbs9Zwe jLtCmeJFHFM2kI7gJL0Lu7fSiW3DVZ6NH/YYHdOttoMW8KANUxw7hIq7bNPXLkjUSPg+ KHt4nR97IpWbplFlbb44fYOEWYY7HSb8T+tkTMZBxen2zT9BUJhPGITymW/YYK5XrhNI 2AcA== 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=Debooa8+ZuSErOyurW+hpQkXGXTukEOcoIVTtJTjnZY=; b=lnSXL+Yp0cLtNBld1UVT9eioFPuS+y/KuxWptdhKs87kxTVKQVDyTMzsHOILJXMo8m tlVCpgXSsC8uGxriS/j+tDX9Wswg0QdbuK8LFnAyCgUVpBkf4aNaWkc1uRCT+X91Q97p SudbuTN+iDVUMUHkDEijkanzkC+S6qx7EVTpsaDbRoVJUz37mNMb1XDuwrDPGd4GfUMD fJnoELpMOEyjsfCbgVeosg1W6indfI7EqD5ElKu81BKj0DuGvrXU/owDnrDvP6pJd4TQ OpqK+TvRl7YuPNshJXF4F5yPoU4n9e9GAPCNG3RmMlLM9IOZncYghonKqwPjDgKpKxHS MaUw== X-Gm-Message-State: APf1xPDdVOS9Ag6gldc/ACfEK5/kTA3EfbRbvKFnIQK5O8ZkSYRfhNt/ TTQZPr6j+JnheH89DUsFpvM= X-Google-Smtp-Source: AG47ELtS6VXhZpN1AYm+2eJnYeLKczplTGHm34daIkAIErAHbE2ltFpKO0Abjh2G8bpjElRkLyYW8w== X-Received: by 10.223.135.232 with SMTP id c37mr22668448wrc.168.1520548796228; Thu, 08 Mar 2018 14:39:56 -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.39.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:39:55 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:22 +0100 Message-Id: <20180308223946.26784-2-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:c0c::242 Subject: [Qemu-devel] [PATCH 01/25] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Guan Xuetao , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Again... (after 07dc788054d7 and 9157eee1b1c0). We now extract the ISA bus specific helpers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- include/hw/char/parallel.h | 14 ++++++++++++++ include/hw/i386/pc.h | 8 -------- hw/char/parallel-isa.c | 36 ++++++++++++++++++++++++++++++++++++ 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, 59 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 bb49165fe0..f1feb18c3c 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..639e179585 --- /dev/null +++ b/hw/char/parallel-isa.c @@ -0,0 +1,36 @@ +/* + * QEMU Parallel PORT (ISA bus helpers) + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ +#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 35fcb6efdf..81364932d3 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -26,6 +26,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 0f2e426d02..63fa77effc 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -24,7 +24,6 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" static ISABus *isabus; @@ -288,28 +287,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 f68c625666..dc77b55755 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 b09871a814..b24305b7b4 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 6f0deb99e7..c74882c7e9 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 da28ab9413..ceb1ba7eaf 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -34,6 +34,7 @@ #include "hw/pci-host/sabre.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 b7c4130388..c0f1620f3a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -913,7 +913,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 @@ -928,6 +928,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 Thu Mar 8 22:39:23 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: 883376 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="U8RuXVCr"; 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 3zy5Cp6tPcz9sl2 for ; Fri, 9 Mar 2018 09:44:06 +1100 (AEDT) Received: from localhost ([::1]:42234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Ga-0000xF-Jo for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:44:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cf-0006il-2l for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cd-0003pv-IO for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:01 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:33351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cd-0003pV-9F; Thu, 08 Mar 2018 17:39:59 -0500 Received: by mail-wr0-x241.google.com with SMTP id v18so7255378wrv.0; Thu, 08 Mar 2018 14:39:59 -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=igonqsMIG1e/EsuCxjqqADFdT9Qhe5OQSrjOEFjaiPk=; b=U8RuXVCrZFKTQNRIlS+4cLTDxMUMhacvDhffm64Ehmbwuu0D64vBYXnP2S7zWSSiHA epW7IHdKoWVMu5Rn3qn9SPW7z4GndmBK0hELmaAO6s6fVWZyF/HJvVRS3h+AQfxb3CnX /lU/QdxvTnOXoa0hII4tFKVGoawtlxZDsr6Lr7TjS3dW1KXay/sCC4YJYH2hj5rAlfn7 5bACh23bAcPFDCC4nQvu2E6xzCFCEJ56RvP/TbK5ImHy7KaMqg5C+WjoH3mEWJ+pEw26 hmoJgloTWZmdhtouIvTZRrVolCK1hy+ndEa1ezlNJ0xOvVyWKHIty8hFmogLqz8MCv0Q igaA== 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=igonqsMIG1e/EsuCxjqqADFdT9Qhe5OQSrjOEFjaiPk=; b=fAdEJ3Ky3Em8fGGYFpua8HBWvCG2XWdd3voeVzLk1l+aitEWQLDecxR7qWtjXxW93z pByWkcUYAOmlN8ZfaWLNO3mRs4jRrMSaxNoW7O2NleI3VKzm80zaba63QxU32qTf7Qwe rDEiPD8jgaMXCVf1jhh/PdEHhhySQ777y/OiSPwnnuqFEaq2VaM1o6FdD5QqG1zkMgOg LeP4ipaPo5edbMIgjtJJg9ReP5oYUzC0Hfr0YGN+CKWXQA4oMXRpiWDE2ynukuKZQPuS jZIdqUdUFiQJ3ClVGh4lldkFTM3yDsGAl3CZ/QrhxgjrFbhdUJZkPd/LaCHI+GRLsvS5 GrSA== X-Gm-Message-State: APf1xPBaRTsbK4NnzKbaf2gUCj1G8DW7hUY6EMr4NP7PDoZlV9fT9m/B EaKCKLhBlstPl6xjtoN2Wee8m9JO X-Google-Smtp-Source: AG47ELuKgiUuBT/A4WDGxpFsv35KlPACeqlhurcTUvkxQR8PWX8nPLBhV6I+lrKbcPSJauuiMk2n8g== X-Received: by 10.223.224.199 with SMTP id e7mr22364288wri.263.1520548798135; Thu, 08 Mar 2018 14:39:58 -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.39.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:39:57 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:23 +0100 Message-Id: <20180308223946.26784-3-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:c0c::241 Subject: [Qemu-devel] [PATCH 02/25] 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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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 - use a bool type for the high_page_enable argument Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- 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..2cab50bb6c 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, bool 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..83c87d92e0 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)), true); memset(s->commands, 0, sizeof(s->commands)); } diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index bd23e893bf..52675e97c9 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, bool high_page_enable) { ISADevice *isa1, *isa2; DeviceState *d; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 81364932d3..ec75b09a8f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -41,6 +41,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" @@ -1609,7 +1610,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 dc77b55755..0545fcd899 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" @@ -360,7 +361,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 b24305b7b4..827ffdcd4a 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" @@ -220,7 +221,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 c74882c7e9..9cb86c432e 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" @@ -1209,7 +1210,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 0f5804b3b4..fa1bfd6c92 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 ceb1ba7eaf..0ca0243821 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -90,10 +90,6 @@ typedef struct EbusState { #define TYPE_EBUS "ebus" #define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS) -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 c0f1620f3a..335c6c9f65 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -929,8 +929,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 Thu Mar 8 22:39:24 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: 883373 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="XhbSjwTn"; 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 3zy58G2P2Mz9sYY for ; Fri, 9 Mar 2018 09:41:02 +1100 (AEDT) Received: from localhost ([::1]:42219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Dc-0006lt-2q for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:41:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Ch-0006kV-NG for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cg-0003rg-0H for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:03 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cf-0003qe-Ml; Thu, 08 Mar 2018 17:40:01 -0500 Received: by mail-wm0-x241.google.com with SMTP id 188so697175wme.1; Thu, 08 Mar 2018 14:40:01 -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=h4YvCuQiV2Khlv9ZiYnlzzdA5QwETjtD3jGEAVcpoPY=; b=XhbSjwTnKgAA0hK5iH5l3WLk9+CX98ffmINgXG5IIfXJiFdPtLrKX4AjtsZhfUVdte w6lMtjPNcIKBeoYpV55MNBjmwiAVuvBn6Q7wmqQuifUAryt/7sQUNYEkNHiiRtS237uC qPQU5eqPrnuD5kSk5j3usvG1HCDSLaNo0dpgqehePEzroC8x0U4Pja0gQicdqgiz///Q F5jvPfoapHp0ChLjSTWGTV5PO5k/8QDKtQMR49WN8/IWDoENfNuOQUNEMGd1tzLAjLWJ ja+vRfJ8Ezg8FYbCpKMHJSf10O+Jc5LLNxUjB8hwtooU7SgPFKQdVXXohv3Q+eJ3IKHM l/Tg== 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=h4YvCuQiV2Khlv9ZiYnlzzdA5QwETjtD3jGEAVcpoPY=; b=ldsbb4JCqvaz4DIhUJJh24gxhkOKobEQ+KzorAEhr5zayqzhl+eD7Sx2dOYtaV8G3Q jtGZ5oj1AWUmC2tqCZwPwWkhAPifQZwOL6m7s8Fqs89krciWJCcJRiSjRCyJhqsq3ruR YC2/ElVifgDETlL6CUfmagM3ptgPJ4+jN+nSWScUm7drIRMRNrKLpxmtDEqKuZCA0uTu +FO2BlY4b90RcSvi+t7HijC46tPwOlB1PWIxPfvOW3Fqyrm5xmQYG5bOmptb7k7REPdH TgZnXtBM/rcnkkSh3afawjPxU0NI2Ja2bOKXABvJR65KRCVe/du+clpS3DfSsdoMqeHj gXqQ== X-Gm-Message-State: AElRT7HWyvSYjWx+SFgC78E7bYpzesVt7hfOnUH+UJ81ormj/T9ABer3 fIsTFM9eOnKwn6EDp5kFQtI= X-Google-Smtp-Source: AG47ELskTmT1ZvaL1t+hTLWDuXajrcoi8Ql7RXzrAp1rm7urkdZ8H5eUqTyIUoK4VwHznXV4dNBzJg== X-Received: by 10.28.245.9 with SMTP id t9mr43965wmh.33.1520548800416; Thu, 08 Mar 2018 14:40:00 -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.39.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:39:59 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth , Laurent Vivier Date: Thu, 8 Mar 2018 23:39:24 +0100 Message-Id: <20180308223946.26784-4-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 03/25] 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 , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:PReP" , David Gibson , Guan Xuetao , 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 (hw/ppc) Reviewed-by: Mark Cave-Ayland --- include/hw/i386/pc.h | 9 --------- include/hw/input/i8042.h | 24 ++++++++++++++++++++++++ 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 | 1 + hw/unicore32/puv3.c | 1 + MAINTAINERS | 1 + 15 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 include/hw/input/i8042.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index f1feb18c3c..1638618dfc 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..f6ff146364 --- /dev/null +++ b/include/hw/input/i8042.h @@ -0,0 +1,24 @@ +/* + * QEMU PS/2 Controller + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ +#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 ec75b09a8f..cdcdfafe8e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -43,6 +43,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 0545fcd899..9339e02120 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" @@ -364,7 +365,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 827ffdcd4a..5abbe30c21 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 9cb86c432e..cd7bd0eef6 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" @@ -1213,7 +1214,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 830ee7732c..aeadc4a340 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" @@ -286,7 +287,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 096d4d4cfb..ae724b0613 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 0ca0243821..2044a52ded 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -36,6 +36,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" 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 335c6c9f65..6622efc1da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -931,6 +931,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 Thu Mar 8 22:39:25 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: 883377 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="sHZsls8k"; 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 3zy5Cw0J3Dz9scR for ; Fri, 9 Mar 2018 09:44:12 +1100 (AEDT) Received: from localhost ([::1]:42236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Gf-00011q-Qw for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:44:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Ci-0006kZ-Gs for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Ch-0003sG-Ge for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:04 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:54865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Ch-0003rr-9l for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:03 -0500 Received: by mail-wm0-x244.google.com with SMTP id z81so689600wmb.4 for ; Thu, 08 Mar 2018 14:40: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=xi1ltgf91oodYqhUK6T7j0GOm3S2ge+llwH8xqhhrH4=; b=sHZsls8kAnGoSo7VVdM3UzPMg0XlbRM3ShulpQdjq8BNNRNhvR7hmgMh84fufDjUrl xctHHb+TOh9JOjoe3DoFGciaqkvGJ9ur3oqY8xp/IuWNWhlYkfHspo/risUJjjLkMEQI HRfvpk821OGuWv8OGAjYgYoKnV5q+yhm1WGnAx5BL+OfXXQYY3PYbNqrLtnn2rIlkjhm SENoVG7hpyOaJXveNq17Myn7iALrMuhh+lzvfgqo0eLAKT7KZ/LXnw3aOu10Bo8OZB3u l6eAI3jxJ2SEA6E1tZ9B3HcC7K9pHDVg/9VAFJJ06yVYeLEvOSukTgYrsm36v819ouRJ JcpQ== 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=xi1ltgf91oodYqhUK6T7j0GOm3S2ge+llwH8xqhhrH4=; b=jf/v0RBWmZOcreUhoDgi9NxMxpTu5y7WJfBcM7lyIJLWQ4iPiMhQf2M/F40eD/PTSm Yt18YhFXFUv30Ewng44mIpcIqnMpNVv3/AsPh6uaisq922/qDt/5SuXYJY3HCdAjuUax lQfYK6hZ4vvHCvoAMzvY/yaNHfgFffj9/GwyC22fg4QK1bJBsP3fbPr2wZCJREt7mJca F8XOeEAjTO+EXkCn5AtHu1K0JlVjQt4bYln5PrVHQNp1gWIC6HuVv5C8twmRLNAlqLq+ qLP7IJLFic+235fzN0uKZhiX0soojZXc611+kQLIubzJz2YhwyX43LbREQEsWS0HbS+N 1N2A== X-Gm-Message-State: AElRT7F81q0/6Nda0DdxNgZJ2RjtstFXHfVXaxlZiq+jdH+vSdlN2sgn KZm7oGvjlDabTJrsL7lzCsY= X-Google-Smtp-Source: AG47ELsja4s4FUx46iSn54BMN9w4LMJLJHnFdM0LmWZjdSsEPizLaPEgyFdHHrQleXuRRv9E9j9nMQ== X-Received: by 10.28.217.205 with SMTP id q196mr245987wmg.149.1520548802192; Thu, 08 Mar 2018 14:40:02 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:01 -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 , Thomas Huth Date: Thu, 8 Mar 2018 23:39:25 +0100 Message-Id: <20180308223946.26784-5-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::244 Subject: [Qemu-devel] [PATCH 04/25] MAINTAINERS: Fix the PC87312 include path 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 , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Missed while moving it in 0d09e41a51aa. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 6622efc1da..212eaa836a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -765,9 +765,10 @@ F: hw/ppc/prep_systemio.c F: hw/ppc/rs6000_mc.c F: hw/pci-host/prep.[hc] F: hw/isa/i82378.c -F: hw/isa/pc87312.[hc] +F: hw/isa/pc87312.c F: hw/dma/i82374.c F: hw/timer/m48t59-isa.c +F: include/hw/isa/pc87312.h F: include/hw/timer/m48t59.h F: pc-bios/ppc_rom.bin From patchwork Thu Mar 8 22:39:26 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: 883379 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="vRuOAtN4"; 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 3zy5HJ15qhz9sW5 for ; Fri, 9 Mar 2018 09:47:08 +1100 (AEDT) Received: from localhost ([::1]:42252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4JW-0003XZ-0p for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:47:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cl-0006n5-NN for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cj-0003tS-5a for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:07 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:37298) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Ci-0003sp-Vj; Thu, 08 Mar 2018 17:40:05 -0500 Received: by mail-wm0-x243.google.com with SMTP id 139so692915wmn.2; Thu, 08 Mar 2018 14:40:04 -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=4BLEX7GxTlqe9xkK+MmiprKkKb9/DsQsr/hJHAH2S3U=; b=vRuOAtN4uQJzXplFhH0m1Sr6YWfnmSlPjEEyyK30D+hy+P2bFvBneuf7F0BfzDRJOL XBkt09snwenGVp7QCGFbEw8zcsquAmjMudJgQz82n5s/zoXHfjhTtK4OhCMu5QvyfaHo 6YiItlB119z+mZ3uk/KT7fWFdhKdbtmjqsT1WJZQjNUzY6bH8q674hpkbS3oNiWYTO+E 9o5e6dzZmAFtKZBOYesPvU/VVofRtTq3JkCYHvnaAbkiZSI66I1nJB935PwqX4ahioIO qt04W626NqNqdvM2BH64GaE1IRh/nSBxqU7ODpfqLfhltkX5PPd5yfMVsdotLeeLaF6d 5rXA== 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=4BLEX7GxTlqe9xkK+MmiprKkKb9/DsQsr/hJHAH2S3U=; b=hvaSwxZI7cnd3BcapvPRny2/5UmPrw8GFVm5IPRAALIYVqV2ZBRnECHQ6piQsXxyeU BtJkPKDELZ+8v2owQy5yfzo6k2RUXEh/XV8pDXm2I0JMGYycsjl7IECOqX3eqYtI7yLQ EDIHHVL2r13Bwmc4XbBFRE6o3mLC3qgLPSiZdHDQ5wATdUJZlSgBxSH5oXlTAa0z6M7m l6OORA7tTrNMLi8u71BzmW84YB0j06WMWZ8kLPcf/54ZwlQrqbT6RFna5fIPcY4B8MWp a8m1ojyZSudU096qeyA4gHybOWiPKFjKBqAAMcYu+E9lOkONfE8T3n0+H7n/WX/FGGrZ vCRg== X-Gm-Message-State: AElRT7EIlzSpFEIjC2kdHhY+wkQYZBSsk4uL40vjVJS77GHDXI/vjaTd Wc1ETj3TfiscttqvRaJtr9Q= X-Google-Smtp-Source: AG47ELsDIlKQXqawKTFGc9Zwu8ULOnUITeEvqxNENipHujSh7+LbG/yUu0iGZwRktcX+JuWF1+I9Uw== X-Received: by 10.28.32.77 with SMTP id g74mr268758wmg.87.1520548803904; Thu, 08 Mar 2018 14:40:03 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:03 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth , Laurent Vivier Date: Thu, 8 Mar 2018 23:39:26 +0100 Message-Id: <20180308223946.26784-6-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::243 Subject: [Qemu-devel] [PATCH 05/25] hw/isa/pc87312: Rename the device type as TYPE_PC87312_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: Alexander Graf , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:PReP" , David Gibson , Guan Xuetao , 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 (hw/ppc) Reviewed-by: Mark Cave-Ayland --- include/hw/isa/pc87312.h | 4 ++-- hw/isa/pc87312.c | 2 +- hw/ppc/prep.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index bf74470d40..710eb1c807 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -28,8 +28,8 @@ #include "hw/isa/isa.h" -#define TYPE_PC87312 "pc87312" -#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312) +#define TYPE_PC87312_SUPERIO "pc87312" +#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO) typedef struct PC87312State { ISADevice dev; diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 48b29e3c3c..e9edbc6c50 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -391,7 +391,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data) } static const TypeInfo pc87312_type_info = { - .name = TYPE_PC87312, + .name = TYPE_PC87312_SUPERIO, .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(PC87312State), .instance_init = pc87312_initfn, diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index ae724b0613..610ec7ec32 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -613,7 +613,7 @@ static void ppc_prep_init(MachineState *machine) isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci), "isa.0")); /* Super I/O (parallel + serial ports) */ - isa = isa_create(isa_bus, TYPE_PC87312); + isa = isa_create(isa_bus, TYPE_PC87312_SUPERIO); dev = DEVICE(isa); qdev_prop_set_uint8(dev, "config", 13); /* fdc, ser0, ser1, par0 */ qdev_init_nofail(dev); From patchwork Thu Mar 8 22:39:27 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: 883375 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="TJIpe6OJ"; 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 3zy5Cm5XLPz9scR for ; Fri, 9 Mar 2018 09:44:04 +1100 (AEDT) Received: from localhost ([::1]:42233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4GY-0000vM-IQ for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:44:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cl-0006nK-SV for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cl-0003uE-0o for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:07 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:40655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Ck-0003tx-Qm; Thu, 08 Mar 2018 17:40:06 -0500 Received: by mail-wr0-x241.google.com with SMTP id o76so7247840wrb.7; Thu, 08 Mar 2018 14:40:06 -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=DpHz+yOPRcolXxaCJjY99eF/NmlCOKIkmxQN+o7Gzr0=; b=TJIpe6OJcqKafxQWBJzC3VUY+01VE+lbGCUUj9HlcjsLztUmxk22lryWSVEJr/7pb6 Jpygi11knBHQmkVn1aSSOXAObV3KTsQPGJp12KlM2Hj6pikWqnn883xoIft/+pJFNRkF AmjGk5yUsuR4JQ+CLO+l/SXP4FHoKWsoaw9TppbnPETUbYnVf/kbGt8v6ShquiyN2yyy 3TKOnHyip7VARqA0qwwYFsYipQK1Fg96IwjGoUGZ1mlDSjZXp6UIeUKkKmmzQRXlAye0 wtuAe8JEUFTffbjmpqKuRdUcxhBDe6VHgvEvCiihsCHS6Ujp5iMtZSdCZ+CsV7pk+HhD QH1Q== 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=DpHz+yOPRcolXxaCJjY99eF/NmlCOKIkmxQN+o7Gzr0=; b=aDggPxaZWEUyFaUnmHwWXD5TzgQUUmIzm5fMV7c9FYVqQSM/NlKMljB6mo9CdcjM+G JLMWf1nKj/82yYLEw0nyV9tnKb99jS8rZdwXxif4awKssvzWEmwe9vksUd0jTwJ8M3je GLao9iWLTqD4MUqZoMfXrsKuInYcnd0P0EpGwP8/I7RMBX6qvNAvqtkophs+nnQz5N+6 trxteIxVLJob2CJNPe8V18uWqzhpwAQa+tsnTx5KqdUj//kMtI+jrNB3gSvnG79/NcWt pgRBO3azCUlyQV5JCVZ0ARDtHtevqo4qvEZU7xBSiPWhDJ5M7qNSlq7pWovsRGdwKnUY UlvA== X-Gm-Message-State: APf1xPBnV2lywxC2B5HqZ6+M+mLVdC8o5LBY+VCoWrGxvA8EmNv0t/Rl omGCbvYj58qeKmv+yDPF+ww= X-Google-Smtp-Source: AG47ELuDj5nMzuMBg1IOB+8tI3Jv7/xMZ4CcTJZCk3wi7MJceKnlB54x1fyo3Nkksq1Rl7JkpiwyYw== X-Received: by 10.223.151.106 with SMTP id r97mr25341851wrb.203.1520548805832; Thu, 08 Mar 2018 14:40:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:05 -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 , Thomas Huth Date: Thu, 8 Mar 2018 23:39:27 +0100 Message-Id: <20180308223946.26784-7-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:c0c::241 Subject: [Qemu-devel] [PATCH 06/25] hw/isa/pc87312: Use uint16_t for the ISA I/O base address 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, "open list:PReP" , Guan Xuetao , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This matches the isa_register_ioport() prototype. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/pc87312.h | 2 +- hw/isa/pc87312.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index 710eb1c807..b65b219a8a 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -34,7 +34,7 @@ typedef struct PC87312State { ISADevice dev; - uint32_t iobase; + uint16_t iobase; uint8_t config; /* initial configuration */ struct { diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index e9edbc6c50..105c23e680 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -69,9 +69,9 @@ static inline bool is_parallel_enabled(PC87312State *s) return s->regs[REG_FER] & FER_PARALLEL_EN; } -static const uint32_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 }; +static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 }; -static inline uint32_t get_parallel_iobase(PC87312State *s) +static inline uint16_t get_parallel_iobase(PC87312State *s) { return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR]; } @@ -92,12 +92,12 @@ static inline uint32_t get_parallel_irq(PC87312State *s) /* UARTs */ -static const uint32_t uart_base[2][4] = { +static const uint16_t uart_base[2][4] = { { 0x3e8, 0x338, 0x2e8, 0x220 }, { 0x2e8, 0x238, 0x2e0, 0x228 } }; -static inline uint32_t get_uart_iobase(PC87312State *s, int i) +static inline uint16_t get_uart_iobase(PC87312State *s, int i) { int idx; idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3; @@ -130,7 +130,7 @@ static inline bool is_fdc_enabled(PC87312State *s) return s->regs[REG_FER] & FER_FDC_EN; } -static inline uint32_t get_fdc_iobase(PC87312State *s) +static inline uint16_t get_fdc_iobase(PC87312State *s) { return (s->regs[REG_FER] & FER_FDC_ADDR) ? 0x370 : 0x3f0; } @@ -143,7 +143,7 @@ static inline bool is_ide_enabled(PC87312State *s) return s->regs[REG_FER] & FER_IDE_EN; } -static inline uint32_t get_ide_iobase(PC87312State *s) +static inline uint16_t get_ide_iobase(PC87312State *s) { return (s->regs[REG_FER] & FER_IDE_ADDR) ? 0x170 : 0x1f0; } @@ -373,7 +373,7 @@ static const VMStateDescription vmstate_pc87312 = { }; static Property pc87312_properties[] = { - DEFINE_PROP_UINT32("iobase", PC87312State, iobase, 0x398), + DEFINE_PROP_UINT16("iobase", PC87312State, iobase, 0x398), DEFINE_PROP_UINT8("config", PC87312State, config, 1), DEFINE_PROP_END_OF_LIST() }; From patchwork Thu Mar 8 22:39:28 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: 883380 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="PS48SeYh"; 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 3zy5HM0zj8z9sZw for ; Fri, 9 Mar 2018 09:47:11 +1100 (AEDT) Received: from localhost ([::1]:42254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4JY-0003ae-SH for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:47:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cn-0006ow-EC for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cm-0003vd-J3 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:09 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:39266) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cm-0003v0-CD; Thu, 08 Mar 2018 17:40:08 -0500 Received: by mail-wm0-x243.google.com with SMTP id i3so672385wmi.4; Thu, 08 Mar 2018 14:40:08 -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=W3d2bI+1KY2S/D2mZY27YY9JOlWJC+XrekaqDSGntIg=; b=PS48SeYhIgS0kILxHqW/i98JcRKBMeEVFwpH6Y6RLlSJk3qAmiWO6PdjJQ4kbM9l+i rwhqSKX+X+eM+GG/wE76YfiUmqeOhvgICao/zOmu4ODIZxsbkZp76kNl2HnZkTTQKa7G eTsyRcUdMlp91jtNGIN25ctzAAZ3TbqnbfP+NaQNrG+J015KrLEQvXptj8IADUqCbYyh 3Sq+zorV1nRxc2gBoik9jB+ywAB6RDqMW7TRoasEAJEJU6KYZ2RZwcFIoxTkie7FXzNh 8UxOFuaZUvmBGOZOFElhyYkowHPKFon0tcb6wZzkX1n4heIw/XYWt5ft3INYlsqhp1g0 Hzcw== 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=W3d2bI+1KY2S/D2mZY27YY9JOlWJC+XrekaqDSGntIg=; b=C8ZPQuJ9ySLaeUHvRwY4EzyMDV57pZNx74DcX6WAhHZ7F4W9Hnv9kJky+SgJZ6WH8h 6BmKmaDGsNJlPFmWm+3VfCQR8D+svTA+EcKsAE/ZY89O7RPa6b6RUtw/rPhvS+1/xlJt JGN5R2CDC5/g+JdnkNanDVRBq503CxSnyYhClhTc038T+9UdA7ua/g5fKBwSkn1+M6pL P0og5NpJobN7BVciUW5vDSEDVELijq/+FyRTovM8sfn2WZP7Ef0Q5W2U/cI1sT/9DrLQ IEDYdr3zWtLk4m6R9mTIBUIRnhQNOGVOFfwgj3FopHH/+UEroLhl/6pvorgO9SS4YHlx T/UQ== X-Gm-Message-State: AElRT7EB/vCk4ogOppnPOLPCyKBN75KuQHAYg9xDTBIQ+jzxSkgl3Z18 UKP6ycWxYxUJGGL+cFdg5R4= X-Google-Smtp-Source: AG47ELu/eSBHHmKN/AQOcZiFr1JJYhMJC1VD+yiq/f42nnv+B0pj2/xKpy5dY8V7HAbUGfYtW5oFXA== X-Received: by 10.28.170.5 with SMTP id t5mr301783wme.116.1520548807409; Thu, 08 Mar 2018 14:40:07 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:06 -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 , Thomas Huth Date: Thu, 8 Mar 2018 23:39:28 +0100 Message-Id: <20180308223946.26784-8-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::243 Subject: [Qemu-devel] [PATCH 07/25] hw/isa/pc87312: Use 'unsigned int' for the irq value 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, "open list:PReP" , Guan Xuetao , 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é Reviewed-by: Mark Cave-Ayland --- hw/isa/pc87312.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 105c23e680..fda91fed21 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -76,9 +76,9 @@ static inline uint16_t get_parallel_iobase(PC87312State *s) return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR]; } -static const uint32_t parallel_irq[] = { 5, 7, 5, 0 }; +static const unsigned int parallel_irq[] = { 5, 7, 5, 0 }; -static inline uint32_t get_parallel_irq(PC87312State *s) +static inline unsigned int get_parallel_irq(PC87312State *s) { int idx; idx = (s->regs[REG_FAR] & FAR_PARALLEL_ADDR); @@ -110,7 +110,7 @@ static inline uint16_t get_uart_iobase(PC87312State *s, int i) } } -static inline uint32_t get_uart_irq(PC87312State *s, int i) +static inline unsigned int get_uart_irq(PC87312State *s, int i) { int idx; idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3; From patchwork Thu Mar 8 22:39:29 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: 883374 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="Dks21kCF"; 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 3zy5973YF6z9sl2 for ; Fri, 9 Mar 2018 09:41:47 +1100 (AEDT) Received: from localhost ([::1]:42225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4EL-0007a6-9J for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:41:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cp-0006rO-Fl for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Co-0003wm-Bx for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:11 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:44421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Co-0003wI-2U for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:10 -0500 Received: by mail-wr0-x242.google.com with SMTP id v65so7241072wrc.11 for ; Thu, 08 Mar 2018 14:40: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=TARYWOhrsRPUPzT4UB0gFWKbOBroR1G5N3bKrx6nU+4=; b=Dks21kCF0m6PSEDua7aFULiu2qW3alAxQRQx0U2EYEN3Ttn46N+beU7BHfl6HhN3EW EeatgA1LhJiX+A5cbdx+00WNq7is2BzeN+yrh+vjlJfUMlX7l72HtwH31U5WmvmRqRoG v/sg0Cw6kLyer6HtTa991VY0RoD4qzRt8o5F4ahuFIJI8FzLOx8l7KwYfbJDufZkgEhC Kh0bVu9gEqWWQR51aB2ZDI3IX2dLQyWryvVO1Q1xIbzB4IKVHd1P0GOMzGA944YwZJ5F DCiEr8D/B5tuo790Q06VGVPryXr9aL1hpRZHpg3PBln/+HxXdfr0Vzbb0j3WU+HTdc9y b4VQ== 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=TARYWOhrsRPUPzT4UB0gFWKbOBroR1G5N3bKrx6nU+4=; b=sISqUFlRA432bOh9BwiDDfc/N9yZG6Ko8Fdpei3oGcAqsQ1EK3b1Fp6YGKOwX240uj SjGY5DJwM8M3zWCeb0xh4/KTI0+/yC/3AERakXSn7R7MN81Ywi8ryMguyYUyKnKypvY8 8aYrj9xdlKKSkAJVk4btdtjvw9rQplpWkOCt+XMvMRoom61CZF2CTTFCzE/3GaD07J02 9ALfU4hK5G2nPMz6FRcpetblZ45CWa+kZ2kBoqrKlP1JOtBt6QOkFkYBsnUHIaYN/QqF yWi6g/VW6ckPq5l3CmwjLAIcUPqiDMkNoPeZXsqBZL4EJrTw4hlhSmS7ZFz13knsV2hR eafA== X-Gm-Message-State: APf1xPAgu9z+bEIsb2tldhNze2Z/vh0IzIJGx+91rPEQ3McRYvI2CY/v Fj5hhfV/pQfQW7V411NcgYA= X-Google-Smtp-Source: AG47ELt+YJ+2ec3vuPzkkpbJZVfcJnSawEeq438AqwdLW+5COYG0p4Xx7r5LjslWc8yr1hnUESYsqQ== X-Received: by 10.223.187.72 with SMTP id x8mr22902918wrg.217.1520548809069; Thu, 08 Mar 2018 14:40:09 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:08 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:29 +0100 Message-Id: <20180308223946.26784-9-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:c0c::242 Subject: [Qemu-devel] [PATCH 08/25] hw/isa/superio: Add a Super I/O template based on the PC87312 device 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 , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Guan Xuetao , 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/isa/superio.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ hw/isa/isa-superio.c | 28 ++++++++++++++++++++++++++++ MAINTAINERS | 2 ++ hw/isa/Makefile.objs | 1 + 4 files changed, 75 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..cff6ad6c08 --- /dev/null +++ b/include/hw/isa/superio.h @@ -0,0 +1,44 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This code is licensed under the GNU GPLv2 and later. + * See the COPYING file in the top-level directory. + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef HW_ISA_SUPERIO_H +#define HW_ISA_SUPERIO_H + +#include "qemu-common.h" +#include "sysemu/sysemu.h" +#include "hw/isa/isa.h" + +#define TYPE_ISA_SUPERIO "isa-superio" +#define ISA_SUPERIO(obj) \ + OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO) +#define ISA_SUPERIO_GET_CLASS(obj) \ + OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO) +#define ISA_SUPERIO_CLASS(klass) \ + OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO) + +typedef struct ISASuperIODevice { + ISADevice parent_obj; +} ISASuperIODevice; + +typedef struct ISASuperIOFuncs { + size_t count; + bool (*is_enabled)(ISASuperIODevice *sio, uint8_t index); + uint16_t (*get_iobase)(ISASuperIODevice *sio, uint8_t index); + unsigned int (*get_irq)(ISASuperIODevice *sio, uint8_t index); + unsigned int (*get_dma)(ISASuperIODevice *sio, uint8_t index); +} ISASuperIOFuncs; + +typedef struct ISASuperIOClass { + /*< private >*/ + ISADeviceClass parent_class; + /*< public >*/ + DeviceRealize parent_realize; +} ISASuperIOClass; + +#endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c new file mode 100644 index 0000000000..14ec16f831 --- /dev/null +++ b/hw/isa/isa-superio.c @@ -0,0 +1,28 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2010-2012 Herve Poussineau + * Copyright (c) 2011-2012 Andreas Färber + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This code is licensed under the GNU GPLv2 and later. + * See the COPYING file in the top-level directory. + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "qemu/osdep.h" +#include "hw/isa/superio.h" +#include "trace.h" + +static const TypeInfo isa_superio_type_info = { + .name = TYPE_ISA_SUPERIO, + .parent = TYPE_ISA_DEVICE, + .abstract = true, + .class_size = sizeof(ISASuperIOClass), +}; + +static void isa_superio_register_types(void) +{ + type_register_static(&isa_superio_type_info); +} + +type_init(isa_superio_register_types) diff --git a/MAINTAINERS b/MAINTAINERS index 212eaa836a..98a8918c20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -922,6 +922,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* @@ -933,6 +934,7 @@ 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/isa/superio.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* F: include/hw/timer/mc146818rtc* 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 Thu Mar 8 22:39: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: 883381 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="lygIq6Ux"; 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 3zy5J255vBz9sW5 for ; Fri, 9 Mar 2018 09:47:46 +1100 (AEDT) Received: from localhost ([::1]:42256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4K8-00044d-FN for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:47:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cq-0006sv-Pj for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cp-0003xi-TD for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:12 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:46445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cp-0003xA-Lw; Thu, 08 Mar 2018 17:40:11 -0500 Received: by mail-wr0-x243.google.com with SMTP id m12so7234526wrm.13; Thu, 08 Mar 2018 14:40:11 -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=IDISHE/WXhKazKS9RqpzgTEj/9/+RmtPBdEpXusdzis=; b=lygIq6UxZM53kJqwnngerswDcyZMXhPqgtsk3LQ0BEjvqnPcicgmW1aqMUyuKOY389 Xs6UezH2l2P93eOkyin/SpgSMXxFVYz3/ZP+D46O9QvOyUMSoD0s1T3/snfJ141Gzbs/ MrbpOmTYuYdfrShhZVtbvUCFzqE2cKkNoGuCX1rco9G/6Uvf2VEIJkr3j9pN29SCwMKo 0OqCmwCNu52SoJUPFIzxdNGeWDNWS2dFQLmbzRLQc2BDYwyrGCZMJ4IfS8TqaetAztXa URUz7LJv+1lQts76nrbuPPCLuIOXiZQy9olzFht9N2ONPPMRFuN9/tQk5gMe3VLzoGlg KTtw== 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=IDISHE/WXhKazKS9RqpzgTEj/9/+RmtPBdEpXusdzis=; b=cXeVzDbBvZg20GLxHzAB6cAKiaxBGdqShyBUFM31qT54BA327EN1u44AIsuH/xgVil LxqPmPwzYcLgWip4QQHhIUQhXDEZvdn8kBa8GmuG/qtZVQGPn2CU4jCh8aEgt2DfgVmb UfJ6XsRI/g5hQQ82mUkI1OcNgW1wo+65gHDaGbC3+nJq9hOntAzlVg+Zb+vFs5LN5QlG VTNJqlgK487D4piNPhiGf3lJh1gVkwJ7RgHs7zM1SeH/Smug6TQpKUPUskOpfBql29oC UeLOjybMkFxEWkNayCHcb8qbB1N2seWSv4f1QLWMX6ywu9IMFPWwzhv4io5GgB1xnATV B7jg== X-Gm-Message-State: APf1xPDe19HrZDzqdzJQWrNuvMuIwmZXXQUtM+xSLy6JwRzIT1vxZzxn 3oh4rPcJ+4aUBZ3wFnhPwnI= X-Google-Smtp-Source: AG47ELvhT6vN84uSh6eoOjZ+gODmIvF7NoUXKrswRnLglhQabDyeER+hk3aGu1jGOXNKzbnIHrmx+A== X-Received: by 10.223.135.232 with SMTP id c37mr22668907wrc.168.1520548810625; Thu, 08 Mar 2018 14:40:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:10 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:30 +0100 Message-Id: <20180308223946.26784-10-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:c0c::243 Subject: [Qemu-devel] [PATCH 09/25] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_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 , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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/isa/pc87312.h | 6 ++++-- hw/isa/pc87312.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index b65b219a8a..f3761d6fe1 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -25,14 +25,16 @@ #ifndef QEMU_PC87312_H #define QEMU_PC87312_H -#include "hw/isa/isa.h" +#include "hw/isa/superio.h" #define TYPE_PC87312_SUPERIO "pc87312" #define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO) typedef struct PC87312State { - ISADevice dev; + /*< private >*/ + ISASuperIODevice parent_dev; + /*< public >*/ uint16_t iobase; uint8_t config; /* initial configuration */ diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index fda91fed21..6b8100ff56 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -270,6 +270,7 @@ static void pc87312_realize(DeviceState *dev, Error **errp) ISABus *bus; Chardev *chr; DriveInfo *drive; + Error *local_err = NULL; char name[5]; int i; @@ -279,6 +280,12 @@ static void pc87312_realize(DeviceState *dev, Error **errp) isa_register_ioport(isa, &s->io, s->iobase); pc87312_hard_reset(s); + ISA_SUPERIO_GET_CLASS(dev)->parent_realize(dev, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + if (is_parallel_enabled(s)) { /* FIXME use a qdev chardev prop instead of parallel_hds[] */ chr = parallel_hds[0]; @@ -381,7 +388,9 @@ static Property pc87312_properties[] = { static void pc87312_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); + sc->parent_realize = dc->realize; dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; @@ -392,7 +401,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data) static const TypeInfo pc87312_type_info = { .name = TYPE_PC87312_SUPERIO, - .parent = TYPE_ISA_DEVICE, + .parent = TYPE_ISA_SUPERIO, .instance_size = sizeof(PC87312State), .instance_init = pc87312_initfn, .class_init = pc87312_class_init, From patchwork Thu Mar 8 22:39: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: 883397 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="R84jvWa9"; 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 3zy5RT0SLXz9scR for ; Fri, 9 Mar 2018 09:54:13 +1100 (AEDT) Received: from localhost ([::1]:42294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4QM-0001Dv-Rv for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:54:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cu-0006xA-Vt for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cr-000404-RZ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:17 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:35988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cr-0003yN-H4; Thu, 08 Mar 2018 17:40:13 -0500 Received: by mail-wr0-x244.google.com with SMTP id v111so7270544wrb.3; Thu, 08 Mar 2018 14:40:13 -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=E0bBpQrw5NVh3iEY5zyf8bqURLHM+BsQVthRY/z3jRE=; b=R84jvWa9Bu2Jp9/S/3ef4ZYSbsk/mqdf+PoKAMzev3MJhdQavJBNEZcTLWR5KB1cwB qKLLDfZmZUpYCDrZyfdD6dtjSjcGApZI1saAoeInhN91S5IKZSy4yuyYvNtM7XwKGHtw XymCaR9V9SfxCYNuKEArn0C9eOPOQawLGjUYn1SxcodyhpydH2/i60xo77Sk601N/ZBt uKm9xfQ5JTAa6IrQyqXgyHN22+zSIfjWM4HWsCqVvhTms00IaElxelLg3Z6OcrH0nz82 fahFIPb+Khh/qtkm9Whu0Lmyrb1jZ48bT23aFvsiphHJnUUv76ZHDuG64un4+fM6YH15 2YCw== 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=E0bBpQrw5NVh3iEY5zyf8bqURLHM+BsQVthRY/z3jRE=; b=ea0oT0U16gRseLSXDt3uCHFFcbNX6NL80ArnJjJTpFfff9hR1PKMqTVTYqhn0Cb/fZ LidIfEbsDlm5ckHIHwit7s5k65l7593/JkV97ovEdc6Fb5BLEFb5YBPK2oMX2Zh6l8ZV hUnZws4LREhAR+/LISd3LH8l25Crgm5Crf9/QRRVhswyK4BmNuRUjKc2qtwnD/HYb7EX xm/GbvKy5hS4B0UgABFiihgbRMpNY6oCCsUWeLy3hgu2FZzxtRrmMeXixExFQpCPZb9L /S7D8iWn09dnK6AlpK1Y2DP5uzE/uU3uMKVr6LOaToLGpleAqL+JCxmOkxIV1pxz2k/y pUCA== X-Gm-Message-State: APf1xPDvzP4D8X3pQWSrM7yH6GBYK20Nqz3yRsWJDGTSzL+/7xU8UYfL pAvPD21SqpK9DXL1vE0jb6g= X-Google-Smtp-Source: AG47ELv5Cpj2/pfB5O1jU2hClrg/T4dopzINV3oWx2ROqxI2W+NN5ruAFSKUpPko2f4UiuK9M9s75g== X-Received: by 10.223.134.170 with SMTP id 39mr22837242wrx.221.1520548812330; Thu, 08 Mar 2018 14:40:12 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:11 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:31 +0100 Message-Id: <20180308223946.26784-11-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:c0c::244 Subject: [Qemu-devel] [PATCH 10/25] hw/isa/superio: Factor out the parallel code from pc87312.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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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/isa/pc87312.h | 4 --- include/hw/isa/superio.h | 6 +++++ hw/isa/isa-superio.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ hw/isa/pc87312.c | 38 +++++++++++----------------- hw/isa/trace-events | 4 ++- 5 files changed, 89 insertions(+), 28 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index f3761d6fe1..bcc4578479 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -39,10 +39,6 @@ typedef struct PC87312State { uint16_t iobase; uint8_t config; /* initial configuration */ - struct { - ISADevice *dev; - } parallel; - struct { ISADevice *dev; } uart[2]; diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index cff6ad6c08..e9879cfde1 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -23,7 +23,11 @@ OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO) typedef struct ISASuperIODevice { + /*< private >*/ ISADevice parent_obj; + /*< public >*/ + + ISADevice *parallel[MAX_PARALLEL_PORTS]; } ISASuperIODevice; typedef struct ISASuperIOFuncs { @@ -39,6 +43,8 @@ typedef struct ISASuperIOClass { ISADeviceClass parent_class; /*< public >*/ DeviceRealize parent_realize; + + ISASuperIOFuncs parallel; } ISASuperIOClass; #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index 14ec16f831..eb263fcc3a 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -10,14 +10,79 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "sysemu/sysemu.h" +#include "chardev/char.h" #include "hw/isa/superio.h" #include "trace.h" +static void isa_superio_realize(DeviceState *dev, Error **errp) +{ + ISASuperIODevice *sio = ISA_SUPERIO(dev); + ISASuperIOClass *k = ISA_SUPERIO_GET_CLASS(sio); + ISABus *bus = isa_bus_from_device(ISA_DEVICE(dev)); + ISADevice *isa; + DeviceState *d; + Chardev *chr; + char *name; + int i; + + /* Parallel port */ + for (i = 0; i < k->parallel.count; i++) { + if (i >= ARRAY_SIZE(sio->parallel)) { + warn_report("superio: ignoring %td parallel controllers", + k->parallel.count - ARRAY_SIZE(sio->parallel)); + break; + } + if (!k->parallel.is_enabled || k->parallel.is_enabled(sio, i)) { + /* FIXME use a qdev chardev prop instead of parallel_hds[] */ + chr = parallel_hds[i]; + if (chr == NULL || chr->be) { + name = g_strdup_printf("discarding-parallel%d", i); + chr = qemu_chr_new(name, "null"); + } else { + name = g_strdup_printf("parallel%d", i); + } + isa = isa_create(bus, "isa-parallel"); + d = DEVICE(isa); + qdev_prop_set_uint32(d, "index", i); + if (k->parallel.get_iobase) { + qdev_prop_set_uint32(d, "iobase", + k->parallel.get_iobase(sio, i)); + } + if (k->parallel.get_irq) { + qdev_prop_set_uint32(d, "irq", k->parallel.get_irq(sio, i)); + } + qdev_prop_set_chr(d, "chardev", chr); + qdev_init_nofail(d); + sio->parallel[i] = isa; + trace_superio_create_parallel(i, + k->parallel.get_iobase ? + k->parallel.get_iobase(sio, i) : -1, + k->parallel.get_irq ? + k->parallel.get_irq(sio, i) : -1); + object_property_add_child(OBJECT(dev), name, + OBJECT(sio->parallel[i]), NULL); + g_free(name); + } + } +} + +static void isa_superio_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + + dc->realize = isa_superio_realize; + /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */ + dc->user_creatable = false; +} + static const TypeInfo isa_superio_type_info = { .name = TYPE_ISA_SUPERIO, .parent = TYPE_ISA_DEVICE, .abstract = true, .class_size = sizeof(ISASuperIOClass), + .class_init = isa_superio_class_init, }; static void isa_superio_register_types(void) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 6b8100ff56..1c15715c69 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -64,22 +64,25 @@ /* Parallel port */ -static inline bool is_parallel_enabled(PC87312State *s) +static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index) { - return s->regs[REG_FER] & FER_PARALLEL_EN; + PC87312State *s = PC87312(sio); + return index ? false : s->regs[REG_FER] & FER_PARALLEL_EN; } static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 }; -static inline uint16_t get_parallel_iobase(PC87312State *s) +static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR]; } static const unsigned int parallel_irq[] = { 5, 7, 5, 0 }; -static inline unsigned int get_parallel_irq(PC87312State *s) +static unsigned int get_parallel_irq(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); int idx; idx = (s->regs[REG_FAR] & FAR_PARALLEL_ADDR); if (idx == 0) { @@ -286,24 +289,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp) return; } - if (is_parallel_enabled(s)) { - /* FIXME use a qdev chardev prop instead of parallel_hds[] */ - chr = parallel_hds[0]; - if (chr == NULL) { - chr = qemu_chr_new("par0", "null"); - } - isa = isa_create(bus, "isa-parallel"); - d = DEVICE(isa); - qdev_prop_set_uint32(d, "index", 0); - qdev_prop_set_uint32(d, "iobase", get_parallel_iobase(s)); - qdev_prop_set_uint32(d, "irq", get_parallel_irq(s)); - qdev_prop_set_chr(d, "chardev", chr); - qdev_init_nofail(d); - s->parallel.dev = isa; - trace_pc87312_info_parallel(get_parallel_iobase(s), - get_parallel_irq(s)); - } - for (i = 0; i < 2; i++) { if (is_uart_enabled(s, i)) { /* FIXME use a qdev chardev prop instead of serial_hds[] */ @@ -395,8 +380,15 @@ static void pc87312_class_init(ObjectClass *klass, void *data) dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; dc->props = pc87312_properties; - /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */ + /* Reason: Uses serial_hds[0] in realize(), so it can't be used twice */ dc->user_creatable = false; + + sc->parallel = (ISASuperIOFuncs){ + .count = 1, + .is_enabled = is_parallel_enabled, + .get_iobase = get_parallel_iobase, + .get_irq = get_parallel_irq, + }; } static const TypeInfo pc87312_type_info = { diff --git a/hw/isa/trace-events b/hw/isa/trace-events index a4ab4e3634..97b1949981 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -1,9 +1,11 @@ # See docs/devel/tracing.txt for syntax documentation. +# hw/isa/isa-superio.c +superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" + # hw/isa/pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" pc87312_info_floppy(uint32_t base) "base 0x%x" pc87312_info_ide(uint32_t base) "base 0x%x" -pc87312_info_parallel(uint32_t base, uint32_t irq) "base 0x%x, irq %u" pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u" From patchwork Thu Mar 8 22:39: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: 883386 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="Zi5S/Zsa"; 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 3zy5ND1Vhxz9scM for ; Fri, 9 Mar 2018 09:51:24 +1100 (AEDT) Received: from localhost ([::1]:42281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Nd-00079b-V0 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:51:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cu-0006x7-Ur for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Ct-00042i-IL for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:16 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:55473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Ct-00041d-8j; Thu, 08 Mar 2018 17:40:15 -0500 Received: by mail-wm0-x243.google.com with SMTP id q83so682423wme.5; Thu, 08 Mar 2018 14:40:15 -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=1MEU4UZO8UQVeCcHia46QUO6NdKf3P29So+wBl4cHtA=; b=Zi5S/Zsay8B0gMAlpghhUG/FqJ6H304tflrSbfqD5jbcYwN0z05jy3lVOm5bzJg7o5 jxtsUUTZj+JTsFt//Ix7ItZyGs1JBkNNToqhw29hl1ZCBQLGM75ft211y6RvdYnYGbi/ 6JEg3zBsKyK8sevoBagYdc5P8zqgoZRV7UAI4+r9EnMDWX0jviI2xONSiopVB5LcNV90 3x1Lljv/bLiehducT5VD7z2K6mcKtsfeWn9UaHpbODWgbZIZ5H7/j7dmMCP1PUKWkBw1 yryi/IF9cweW616P/yoUCnvoNJsc6DifGoWIPllqWRZTWiSRf4prLKZB/5MHY2bBC+p/ Qnqg== 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=1MEU4UZO8UQVeCcHia46QUO6NdKf3P29So+wBl4cHtA=; b=UB74HS92+EfSpHvnDM3qBfZbF+Gc7g5NqIPWP14YW1aJcHDyNj5s2uCqxrBpk1TSPD 3mkhtlXMgzj+xG9ToXYNVcVxmTfP/MWCB/DKHXKINimNoLOGvu+ghFgQ0DtmTYgcgnhE h9GDPaqCzHDLKq506DtWXwI1ell7eW2/9YyrQZx9klbWtptb4kSw8VILbcMwITy5B+5f Xx36BqXPMS0lOAJZs63I/HQRQbG89fA2WK/P8ywtZ71S7dK1X6GsuWe/13WtqQwM7Q+6 BGLtxcI2/lIuvY6kI0/lje/2ElEU+NWJ/KM3ywiJmSD24/iqr22YyX3Sa2Po3oXfRjAi k5IQ== X-Gm-Message-State: AElRT7FXXGVi6CISsmh41jljRkvK2R+3nRCT/xBN0jC3EY+kSEPsUzHR w/Iqj8LocsYkWkMo9cC7pok= X-Google-Smtp-Source: AG47ELuckCTW0b2qA+nS4eHPMdyn/UCCvCYV1P8NznWXb3y0U2sMszY7zdD+1cYBdZqciB2Jv9wQkQ== X-Received: by 10.28.116.17 with SMTP id p17mr314025wmc.137.1520548814095; Thu, 08 Mar 2018 14:40:14 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:13 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:32 +0100 Message-Id: <20180308223946.26784-12-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::243 Subject: [Qemu-devel] [PATCH 11/25] hw/isa/superio: Factor out the serial code from pc87312.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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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/isa/pc87312.h | 4 ---- include/hw/isa/superio.h | 2 ++ hw/isa/isa-superio.c | 41 +++++++++++++++++++++++++++++++++++++++++ hw/isa/pc87312.c | 43 ++++++++++++------------------------------- hw/isa/trace-events | 2 +- 5 files changed, 56 insertions(+), 36 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index bcc4578479..1480615a2c 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -39,10 +39,6 @@ typedef struct PC87312State { uint16_t iobase; uint8_t config; /* initial configuration */ - struct { - ISADevice *dev; - } uart[2]; - struct { ISADevice *dev; } fdc; diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index e9879cfde1..0b516721c3 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -28,6 +28,7 @@ typedef struct ISASuperIODevice { /*< public >*/ ISADevice *parallel[MAX_PARALLEL_PORTS]; + ISADevice *serial[MAX_SERIAL_PORTS]; } ISASuperIODevice; typedef struct ISASuperIOFuncs { @@ -45,6 +46,7 @@ typedef struct ISASuperIOClass { DeviceRealize parent_realize; ISASuperIOFuncs parallel; + ISASuperIOFuncs serial; } ISASuperIOClass; #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index eb263fcc3a..6962421aad 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -14,6 +14,7 @@ #include "sysemu/sysemu.h" #include "chardev/char.h" #include "hw/isa/superio.h" +#include "hw/char/serial.h" #include "trace.h" static void isa_superio_realize(DeviceState *dev, Error **errp) @@ -66,6 +67,46 @@ static void isa_superio_realize(DeviceState *dev, Error **errp) g_free(name); } } + + /* Serial */ + for (i = 0; i < k->serial.count; i++) { + if (i >= ARRAY_SIZE(sio->serial)) { + warn_report("superio: ignoring %td serial controllers", + k->serial.count - ARRAY_SIZE(sio->serial)); + break; + } + if (!k->serial.is_enabled || k->serial.is_enabled(sio, i)) { + /* FIXME use a qdev chardev prop instead of serial_hds[] */ + chr = serial_hds[i]; + if (chr == NULL || chr->be) { + name = g_strdup_printf("discarding-serial%d", i); + chr = qemu_chr_new(name, "null"); + } else { + name = g_strdup_printf("serial%d", i); + } + isa = isa_create(bus, TYPE_ISA_SERIAL); + d = DEVICE(isa); + qdev_prop_set_uint32(d, "index", i); + if (k->serial.get_iobase) { + qdev_prop_set_uint32(d, "iobase", + k->serial.get_iobase(sio, i)); + } + if (k->serial.get_irq) { + qdev_prop_set_uint32(d, "irq", k->serial.get_irq(sio, i)); + } + qdev_prop_set_chr(d, "chardev", chr); + qdev_init_nofail(d); + sio->serial[i] = isa; + trace_superio_create_serial(i, + k->serial.get_iobase ? + k->serial.get_iobase(sio, i) : -1, + k->serial.get_irq ? + k->serial.get_irq(sio, i) : -1); + object_property_add_child(OBJECT(dev), name, + OBJECT(sio->serial[0]), NULL); + g_free(name); + } + } } static void isa_superio_class_init(ObjectClass *oc, void *data) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 1c15715c69..c2837bca43 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -29,8 +29,6 @@ #include "qemu/error-report.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" -#include "sysemu/sysemu.h" -#include "chardev/char.h" #include "trace.h" @@ -100,8 +98,9 @@ static const uint16_t uart_base[2][4] = { { 0x2e8, 0x238, 0x2e0, 0x228 } }; -static inline uint16_t get_uart_iobase(PC87312State *s, int i) +static uint16_t get_uart_iobase(ISASuperIODevice *sio, uint8_t i) { + PC87312State *s = PC87312(sio); int idx; idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3; if (idx == 0) { @@ -113,15 +112,17 @@ static inline uint16_t get_uart_iobase(PC87312State *s, int i) } } -static inline unsigned int get_uart_irq(PC87312State *s, int i) +static unsigned int get_uart_irq(ISASuperIODevice *sio, uint8_t i) { + PC87312State *s = PC87312(sio); int idx; idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3; return (idx & 1) ? 3 : 4; } -static inline bool is_uart_enabled(PC87312State *s, int i) +static bool is_uart_enabled(ISASuperIODevice *sio, uint8_t i) { + PC87312State *s = PC87312(sio); return s->regs[REG_FER] & (FER_UART1_EN << i); } @@ -271,11 +272,8 @@ static void pc87312_realize(DeviceState *dev, Error **errp) DeviceState *d; ISADevice *isa; ISABus *bus; - Chardev *chr; DriveInfo *drive; Error *local_err = NULL; - char name[5]; - int i; s = PC87312(dev); isa = ISA_DEVICE(dev); @@ -289,27 +287,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp) return; } - for (i = 0; i < 2; i++) { - if (is_uart_enabled(s, i)) { - /* FIXME use a qdev chardev prop instead of serial_hds[] */ - chr = serial_hds[i]; - if (chr == NULL) { - snprintf(name, sizeof(name), "ser%d", i); - chr = qemu_chr_new(name, "null"); - } - isa = isa_create(bus, "isa-serial"); - d = DEVICE(isa); - qdev_prop_set_uint32(d, "index", i); - qdev_prop_set_uint32(d, "iobase", get_uart_iobase(s, i)); - qdev_prop_set_uint32(d, "irq", get_uart_irq(s, i)); - qdev_prop_set_chr(d, "chardev", chr); - qdev_init_nofail(d); - s->uart[i].dev = isa; - trace_pc87312_info_serial(i, get_uart_iobase(s, i), - get_uart_irq(s, i)); - } - } - if (is_fdc_enabled(s)) { isa = isa_create(bus, "isa-fdc"); d = DEVICE(isa); @@ -380,8 +357,6 @@ static void pc87312_class_init(ObjectClass *klass, void *data) dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; dc->props = pc87312_properties; - /* Reason: Uses serial_hds[0] in realize(), so it can't be used twice */ - dc->user_creatable = false; sc->parallel = (ISASuperIOFuncs){ .count = 1, @@ -389,6 +364,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data) .get_iobase = get_parallel_iobase, .get_irq = get_parallel_irq, }; + sc->serial = (ISASuperIOFuncs){ + .count = 2, + .is_enabled = is_uart_enabled, + .get_iobase = get_uart_iobase, + .get_irq = get_uart_irq, + }; } static const TypeInfo pc87312_type_info = { diff --git a/hw/isa/trace-events b/hw/isa/trace-events index 97b1949981..c78dd6c353 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -2,10 +2,10 @@ # hw/isa/isa-superio.c superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" +superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" # hw/isa/pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" pc87312_info_floppy(uint32_t base) "base 0x%x" pc87312_info_ide(uint32_t base) "base 0x%x" -pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u" From patchwork Thu Mar 8 22:39: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: 883399 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="IMgRaM0U"; 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 3zy5Vd3D94z9sfc for ; Fri, 9 Mar 2018 09:56:57 +1100 (AEDT) Received: from localhost ([::1]:42316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4T1-0003jO-8O for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:56:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cw-000716-N9 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cv-00045X-Bj for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:18 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:40657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cv-00044S-1p; Thu, 08 Mar 2018 17:40:17 -0500 Received: by mail-wr0-x242.google.com with SMTP id o76so7248176wrb.7; Thu, 08 Mar 2018 14:40:16 -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=S/s1zVzCDRtP4IX91qkMGKGPLN8yzrYYdxfr8vZ4n3Y=; b=IMgRaM0UP5q9rO1c+c5y3P8enWoI/IZMOhjZA2b9oxRlZq1CNQBXrHXyjUsmCPdb1l ZQDu4dv8nBDsmCyMkyGvAXiRZT45uxQOXPimsj/iNtf+SptKP2bxkX1WdDYaD+zSDtpV tAy8LTpajd/77eNZlz5VA9b28jvZJjNPOC+S1oVRppE4uibgmYKiZ34tPmk7pGRUv8IV F5OngYppmUP3cHdmkLIPlvXZVO8iO7WkUnJfiwpD8sBBnzy/kZEoSiKDyQYalTIKp2Db +yXZNPfORk6ywPA/Krv9wZXqs8pirlvWKNzgo8j+HYg7FxBBSMNDE+A+cWK0vYdo3vpn Vk8w== 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=S/s1zVzCDRtP4IX91qkMGKGPLN8yzrYYdxfr8vZ4n3Y=; b=I736d+pTINRdjLj9YZC0N3mkBSXzq1nrmjforJP0utnXDeMNa/fscl7XwrPoN5Z9Sv +UMcPbsuUVp5CNYIPDVFG68WuTq8KhAb+6rRsIDMD7jZ6vFpV3i/Rwv/RPIwqv0Dj3bQ FZ+qb/afFGyVC9lSUDCdgA3uDJ4t9idMOQEmXMQcyQDBRQoYICh2X8F1/96JZTkoQdba gg5fkl792uIRKTNaEhcjCFtG640ag4qq6o2LEtg+G/cBFQqR+0WMyqngAqQ8Sq6Z+7b0 bSww9+6RlkJrCUSdDKsQVXiJUhxgxdGk+Rnd5gqj3kfYi08KE0N3eFFKLtPtLyxh9sdb QhgQ== X-Gm-Message-State: APf1xPBp5ELmtGvrx6AtdVD2zPiDXG1DM6xZ9QCARiIhVahGR/SQQEyq IOfp4YdxMSpkRlD9PkanPhOoaCt2 X-Google-Smtp-Source: AG47ELsezNah9Ml9Xq1Gv3INEHXf2RhLjjrSGinAgriX2sy6QlUrl+8W3RwSG2g/UJ98Wu2D9HT94A== X-Received: by 10.223.135.232 with SMTP id c37mr22669046wrc.168.1520548815966; Thu, 08 Mar 2018 14:40:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:15 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:33 +0100 Message-Id: <20180308223946.26784-13-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:c0c::242 Subject: [Qemu-devel] [PATCH 12/25] hw/isa/superio: Factor out the floppy disc controller code from pc87312.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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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/isa/pc87312.h | 4 ---- include/hw/isa/superio.h | 2 ++ hw/isa/isa-superio.c | 36 ++++++++++++++++++++++++++++++++++++ hw/isa/pc87312.c | 46 +++++++++++++++++++--------------------------- hw/isa/trace-events | 2 +- 5 files changed, 58 insertions(+), 32 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index 1480615a2c..e16263d4b1 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -39,10 +39,6 @@ typedef struct PC87312State { uint16_t iobase; uint8_t config; /* initial configuration */ - struct { - ISADevice *dev; - } fdc; - struct { ISADevice *dev; } ide; diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index 0b516721c3..e8007b9eee 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -29,6 +29,7 @@ typedef struct ISASuperIODevice { ISADevice *parallel[MAX_PARALLEL_PORTS]; ISADevice *serial[MAX_SERIAL_PORTS]; + ISADevice *floppy; } ISASuperIODevice; typedef struct ISASuperIOFuncs { @@ -47,6 +48,7 @@ typedef struct ISASuperIOClass { ISASuperIOFuncs parallel; ISASuperIOFuncs serial; + ISASuperIOFuncs floppy; } ISASuperIOClass; #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index 6962421aad..4b5e280b38 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -11,7 +11,10 @@ */ #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/error.h" #include "sysemu/sysemu.h" +#include "sysemu/block-backend.h" +#include "sysemu/blockdev.h" #include "chardev/char.h" #include "hw/isa/superio.h" #include "hw/char/serial.h" @@ -25,6 +28,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp) ISADevice *isa; DeviceState *d; Chardev *chr; + DriveInfo *drive; char *name; int i; @@ -107,6 +111,38 @@ static void isa_superio_realize(DeviceState *dev, Error **errp) g_free(name); } } + + /* Floppy disc */ + if (!k->floppy.is_enabled || k->floppy.is_enabled(sio, 0)) { + isa = isa_create(bus, "isa-fdc"); + d = DEVICE(isa); + if (k->floppy.get_iobase) { + qdev_prop_set_uint32(d, "iobase", k->floppy.get_iobase(sio, 0)); + } + if (k->floppy.get_irq) { + qdev_prop_set_uint32(d, "irq", k->floppy.get_irq(sio, 0)); + } + /* FIXME use a qdev drive property instead of drive_get() */ + drive = drive_get(IF_FLOPPY, 0, 0); + if (drive != NULL) { + qdev_prop_set_drive(d, "driveA", blk_by_legacy_dinfo(drive), + &error_fatal); + } + /* FIXME use a qdev drive property instead of drive_get() */ + drive = drive_get(IF_FLOPPY, 0, 1); + if (drive != NULL) { + qdev_prop_set_drive(d, "driveB", blk_by_legacy_dinfo(drive), + &error_fatal); + } + qdev_init_nofail(d); + sio->floppy = isa; + trace_superio_create_floppy(0, + k->floppy.get_iobase ? + k->floppy.get_iobase(sio, 0) : -1, + k->floppy.get_irq ? + k->floppy.get_irq(sio, 0) : -1); + } + } static void isa_superio_class_init(ObjectClass *oc, void *data) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index c2837bca43..a1845a91c3 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -27,8 +27,6 @@ #include "hw/isa/pc87312.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "sysemu/block-backend.h" -#include "sysemu/blockdev.h" #include "trace.h" @@ -129,16 +127,26 @@ static bool is_uart_enabled(ISASuperIODevice *sio, uint8_t i) /* Floppy controller */ -static inline bool is_fdc_enabled(PC87312State *s) +static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); + assert(!index); return s->regs[REG_FER] & FER_FDC_EN; } -static inline uint16_t get_fdc_iobase(PC87312State *s) +static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); + assert(!index); return (s->regs[REG_FER] & FER_FDC_ADDR) ? 0x370 : 0x3f0; } +static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index) +{ + assert(!index); + return 6; +} + /* IDE controller */ @@ -272,7 +280,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp) DeviceState *d; ISADevice *isa; ISABus *bus; - DriveInfo *drive; Error *local_err = NULL; s = PC87312(dev); @@ -287,28 +294,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp) return; } - if (is_fdc_enabled(s)) { - isa = isa_create(bus, "isa-fdc"); - d = DEVICE(isa); - qdev_prop_set_uint32(d, "iobase", get_fdc_iobase(s)); - qdev_prop_set_uint32(d, "irq", 6); - /* FIXME use a qdev drive property instead of drive_get() */ - drive = drive_get(IF_FLOPPY, 0, 0); - if (drive != NULL) { - qdev_prop_set_drive(d, "driveA", blk_by_legacy_dinfo(drive), - &error_fatal); - } - /* FIXME use a qdev drive property instead of drive_get() */ - drive = drive_get(IF_FLOPPY, 0, 1); - if (drive != NULL) { - qdev_prop_set_drive(d, "driveB", blk_by_legacy_dinfo(drive), - &error_fatal); - } - qdev_init_nofail(d); - s->fdc.dev = isa; - trace_pc87312_info_floppy(get_fdc_iobase(s)); - } - if (is_ide_enabled(s)) { isa = isa_create(bus, "isa-ide"); d = DEVICE(isa); @@ -370,6 +355,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data) .get_iobase = get_uart_iobase, .get_irq = get_uart_irq, }; + sc->floppy = (ISASuperIOFuncs){ + .count = 1, + .is_enabled = is_fdc_enabled, + .get_iobase = get_fdc_iobase, + .get_irq = get_fdc_irq, + }; } static const TypeInfo pc87312_type_info = { @@ -378,6 +369,7 @@ static const TypeInfo pc87312_type_info = { .instance_size = sizeof(PC87312State), .instance_init = pc87312_initfn, .class_init = pc87312_class_init, + /* FIXME use a qdev drive property instead of drive_get() */ }; static void pc87312_register_types(void) diff --git a/hw/isa/trace-events b/hw/isa/trace-events index c78dd6c353..8d9900882f 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -3,9 +3,9 @@ # hw/isa/isa-superio.c superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" +superio_create_floppy(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" # hw/isa/pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" -pc87312_info_floppy(uint32_t base) "base 0x%x" pc87312_info_ide(uint32_t base) "base 0x%x" From patchwork Thu Mar 8 22:39: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: 883378 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="W/hM2Qz8"; 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 3zy5Dd6lw9z9slC for ; Fri, 9 Mar 2018 09:44:49 +1100 (AEDT) Received: from localhost ([::1]:42238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4HH-0001bx-Ky for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:44:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cx-00073F-TV for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cw-00048A-Sw for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:19 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:50533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cw-00046v-MZ; Thu, 08 Mar 2018 17:40:18 -0500 Received: by mail-wm0-x243.google.com with SMTP id w128so727554wmw.0; Thu, 08 Mar 2018 14:40:18 -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=Oehs6xlUmOsUjom/w1oCrrUi/fyPjf1Ki6I4jmiAps0=; b=W/hM2Qz8zCHQAC6n+Ng8z0LR4kKBlYE4aN9dNPjd2xjDrZCoeQmL8MKSPfmqgbwLzL GkaF3mjT9w8tmEL4Rxj5qi/qWiXJ7hITmvtepmTiNQ7LFQaoaItOaTY3fyOhMnGgWfxP ZyQBoAeBtiwzMQCPwdGLWQ1E9ehNH/5BEurcJcobt8DAQmkAjcSKmwK2Pz+Yb+cnmOAA gSg+Qw0nkpppKfdLpItxVl8hrN/MV7bEu1qY6nF92czWN7Jr0PSvXffh4tiICYbKJhQS 6EunIa76CK+HPl89GD4tkUgJvc/Rms2XfNd4UhBBSJMnRONuEm2FHwKBeUp2Mc8ECh5E w68A== 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=Oehs6xlUmOsUjom/w1oCrrUi/fyPjf1Ki6I4jmiAps0=; b=cITTK5nQS46LVXOjWn5kYNcJvDcplHYbELJhlN6v/IL0ToLKSYpuCo0p0sZvLXjvAs kGkYRuxMhaP3EXapzA+9lYhRSY2db78zCLWtH5eViXmWEhq1+6BiEgsnYf0P9FIjwUYp GdFdel1ZaOGJc5kIaZHxwUDADFw1kbQuc977vQLePaMT8+pSPZzo6oNP+a6ahk3Ix2Cl 9iT25zCjWIszM5veSxKlRIB335pMJN4kCbnlbCOPPN6EXmoI6QpBij7Hi5N/idm14LY2 NwGIabv2PL/RpHE6WZlwtkHk1jUOlBWHlsYiZmKFx6DTirNjwLowjH31l6edkZe33zbC yDZg== X-Gm-Message-State: AElRT7HMp9Sfb/l9sNKCamcIykawPZMDSRMKPjot80okCisp0y811ypy YWybc5DpUpKTIAiiYKf6SqQ= X-Google-Smtp-Source: AG47ELsumHRLj9sGKHRwF3juZq7ipkiEttMddW92Gs/Txd0tWDUm7k132ajqsGYqMbp8Bvhkw/T96A== X-Received: by 10.28.52.9 with SMTP id b9mr333384wma.134.1520548817694; Thu, 08 Mar 2018 14:40:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:17 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth , Laurent Vivier Date: Thu, 8 Mar 2018 23:39:34 +0100 Message-Id: <20180308223946.26784-14-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::243 Subject: [Qemu-devel] [PATCH 13/25] hw/isa/superio: Add a keyboard/mouse controller (8042) 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 , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:PReP" , David Gibson , Guan Xuetao , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since the PC87312 inherits this abstract model, we remove the I8042 instance in the PREP machine. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson --- include/hw/isa/superio.h | 1 + hw/isa/isa-superio.c | 3 +++ hw/ppc/prep.c | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index e8007b9eee..2fc33bf3d3 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -30,6 +30,7 @@ typedef struct ISASuperIODevice { ISADevice *parallel[MAX_PARALLEL_PORTS]; ISADevice *serial[MAX_SERIAL_PORTS]; ISADevice *floppy; + ISADevice *kbc; } ISASuperIODevice; typedef struct ISASuperIOFuncs { diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index 4b5e280b38..041b47bdbf 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -17,6 +17,7 @@ #include "sysemu/blockdev.h" #include "chardev/char.h" #include "hw/isa/superio.h" +#include "hw/input/i8042.h" #include "hw/char/serial.h" #include "trace.h" @@ -143,6 +144,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp) k->floppy.get_irq(sio, 0) : -1); } + /* Keyboard, mouse */ + sio->kbc = isa_create_simple(bus, TYPE_I8042); } static void isa_superio_class_init(ObjectClass *oc, void *data) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 610ec7ec32..96d319b87c 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -642,7 +642,6 @@ static void ppc_prep_init(MachineState *machine) hd[2 * i], hd[2 * i + 1]); } - isa_create_simple(isa_bus, TYPE_I8042); cpu = POWERPC_CPU(first_cpu); sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET]; From patchwork Thu Mar 8 22:39: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: 883383 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="DBTQwwpj"; 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 3zy5MG3bBxz9sZw for ; Fri, 9 Mar 2018 09:50:34 +1100 (AEDT) Received: from localhost ([::1]:42272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Mq-0006LY-8v for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:50:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D0-00076C-GG for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cy-00049E-TH for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:22 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34431) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Cy-00048b-KP; Thu, 08 Mar 2018 17:40:20 -0500 Received: by mail-wr0-x241.google.com with SMTP id o8so7270275wra.1; Thu, 08 Mar 2018 14:40:20 -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=kkjbgdCAnmVHSSBjEW5AvUopJQQo3bqo+13aGn3TN7I=; b=DBTQwwpjoHOA4i0lz2SNEr3M/0GqujKfpWcEE6aYDO/CpESHILURmvOiHXobTsBlOa eIGJotDxdWz6SuNxe7tWTC9M591B2OzkFW/MkREMqQ0PySjHkvjHk2ZnYzHNHympywuD XEtmbr5Yfh4P4NQ7laNhvN0bfv17vY5fE8Wi0O7loaOuYgpdHOLpj3CnyJWOM61idlHP n2tKWPF0kmegWUr7uytyHaMEG2cemOs9oIxGwLfJ6usKVKafYQ7KuVr89m4EaKa5hdQd d3+uw11uoDDnmZbqxaGEYVoaorU9usihvxBZz9FMwekVYxF3KsPiSG+fQDEolai7C8hn jA+g== 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=kkjbgdCAnmVHSSBjEW5AvUopJQQo3bqo+13aGn3TN7I=; b=DtK077GwRqGy0R8FhUdlU7z7gEKwM0PLeAwwVRrq8uCI1gwqvlk5DV7YBxzlAzeesZ chzX4JHYOfTZ61bdfnrvCssNqAuxQHlje7UL//Zx1Y9uyVWzzN25oOzSLjCuLCXqiE8T eDBhBO15XiTP8410uoF7wY6U8KLTC1VUkU7M+9RJYidAjpo+/ujmxuLLhpKf8qofqLji t3JdILcWOiRoUow1d3aPQkiVkMmc7bAU78JqKjvaNmsGdNpJqDCfVSPW6XpaDgAy8nCP kqnw1XoGIWLLSdlpKuKfsHYPKwhVZ6blJL7LfFbrRT1lXoS5+FoKDPyUK6Rpw0TdTuV7 sHVQ== X-Gm-Message-State: APf1xPAdpKU7DVZLvjslSR5HriAXWQCAitdhDyOEJW6oBAiu8c+F8V/c RbTmtU+XXH6EaS38TNEJby0= X-Google-Smtp-Source: AG47ELvcuRU48X2XLsgrbebQUzH28aCUJvCc7mPzVh0vLqKsapgETbuyqYI8tUJuGeWzJmxNX/1d7w== X-Received: by 10.223.163.222 with SMTP id m30mr25740264wrb.30.1520548819573; Thu, 08 Mar 2018 14:40:19 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:18 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:35 +0100 Message-Id: <20180308223946.26784-15-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:c0c::241 Subject: [Qemu-devel] [PATCH 14/25] hw/isa/superio: Factor out the IDE code from pc87312.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: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , 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/isa/superio.h | 2 ++ hw/isa/isa-superio.c | 22 ++++++++++++++++++++++ hw/isa/pc87312.c | 36 ++++++++++++++++++++---------------- hw/isa/trace-events | 2 +- 4 files changed, 45 insertions(+), 17 deletions(-) diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index 2fc33bf3d3..3dd5448f8c 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -31,6 +31,7 @@ typedef struct ISASuperIODevice { ISADevice *serial[MAX_SERIAL_PORTS]; ISADevice *floppy; ISADevice *kbc; + ISADevice *ide; } ISASuperIODevice; typedef struct ISASuperIOFuncs { @@ -50,6 +51,7 @@ typedef struct ISASuperIOClass { ISASuperIOFuncs parallel; ISASuperIOFuncs serial; ISASuperIOFuncs floppy; + ISASuperIOFuncs ide; } ISASuperIOClass; #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index 041b47bdbf..f98711beff 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -146,6 +146,28 @@ static void isa_superio_realize(DeviceState *dev, Error **errp) /* Keyboard, mouse */ sio->kbc = isa_create_simple(bus, TYPE_I8042); + + /* IDE */ + if (k->ide.count && (!k->ide.is_enabled || k->ide.is_enabled(sio, 0))) { + isa = isa_create(bus, "isa-ide"); + d = DEVICE(isa); + if (k->ide.get_iobase) { + qdev_prop_set_uint32(d, "iobase", k->ide.get_iobase(sio, 0)); + } + if (k->ide.get_iobase) { + qdev_prop_set_uint32(d, "iobase2", k->ide.get_iobase(sio, 1)); + } + if (k->ide.get_irq) { + qdev_prop_set_uint32(d, "irq", k->ide.get_irq(sio, 0)); + } + qdev_init_nofail(d); + sio->ide = isa; + trace_superio_create_ide(0, + k->ide.get_iobase ? + k->ide.get_iobase(sio, 0) : -1, + k->ide.get_irq ? + k->ide.get_irq(sio, 0) : -1); + } } static void isa_superio_class_init(ObjectClass *oc, void *data) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index a1845a91c3..5cf64505fe 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -150,16 +150,28 @@ static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index) /* IDE controller */ -static inline bool is_ide_enabled(PC87312State *s) +static bool is_ide_enabled(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); + return s->regs[REG_FER] & FER_IDE_EN; } -static inline uint16_t get_ide_iobase(PC87312State *s) +static uint16_t get_ide_iobase(ISASuperIODevice *sio, uint8_t index) { + PC87312State *s = PC87312(sio); + + if (index == 1) { + return get_ide_iobase(sio, 0) + 0x206; + } return (s->regs[REG_FER] & FER_IDE_ADDR) ? 0x170 : 0x1f0; } +static unsigned int get_ide_irq(ISASuperIODevice *sio, uint8_t index) +{ + assert(index == 0); + return 14; +} static void reconfigure_devices(PC87312State *s) { @@ -277,14 +289,11 @@ static void pc87312_reset(DeviceState *d) static void pc87312_realize(DeviceState *dev, Error **errp) { PC87312State *s; - DeviceState *d; ISADevice *isa; - ISABus *bus; Error *local_err = NULL; s = PC87312(dev); isa = ISA_DEVICE(dev); - bus = isa_bus_from_device(isa); isa_register_ioport(isa, &s->io, s->iobase); pc87312_hard_reset(s); @@ -293,17 +302,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp) error_propagate(errp, local_err); return; } - - if (is_ide_enabled(s)) { - isa = isa_create(bus, "isa-ide"); - d = DEVICE(isa); - qdev_prop_set_uint32(d, "iobase", get_ide_iobase(s)); - qdev_prop_set_uint32(d, "iobase2", get_ide_iobase(s) + 0x206); - qdev_prop_set_uint32(d, "irq", 14); - qdev_init_nofail(d); - s->ide.dev = isa; - trace_pc87312_info_ide(get_ide_iobase(s)); - } } static void pc87312_initfn(Object *obj) @@ -361,6 +359,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data) .get_iobase = get_fdc_iobase, .get_irq = get_fdc_irq, }; + sc->ide = (ISASuperIOFuncs){ + .count = 1, + .is_enabled = is_ide_enabled, + .get_iobase = get_ide_iobase, + .get_irq = get_ide_irq, + }; } static const TypeInfo pc87312_type_info = { diff --git a/hw/isa/trace-events b/hw/isa/trace-events index 8d9900882f..80ac6175d6 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -4,8 +4,8 @@ superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" superio_create_floppy(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" +superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u" # hw/isa/pc87312.c pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" -pc87312_info_ide(uint32_t base) "base 0x%x" From patchwork Thu Mar 8 22:39: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: 883401 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="Sj/39BU8"; 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 3zy5Yb1gQPz9sfc for ; Fri, 9 Mar 2018 09:59:31 +1100 (AEDT) Received: from localhost ([::1]:42329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4VV-000631-4P for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:59:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D4-0007AQ-CL for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D0-0004As-Uh for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:26 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:34432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D0-00049Z-ED for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:22 -0500 Received: by mail-wr0-x242.google.com with SMTP id o8so7270341wra.1 for ; Thu, 08 Mar 2018 14:40:22 -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=IV0pzBsGANS34ps4xxZJbR881CnlULNAoIhbunxpJU4=; b=Sj/39BU8GJfHRaiSTBpxniS3E1beu5x4wRRCHaSuW5qzAlafLMAo8LqHA8Cf4FohS3 mJ7Saua3VRODso+nN51eRD7EkMDQJk2WUi1EKHdqsDK3dsfaxhxyOuzpRYD1ccCEwbrG 8jdyPMkMD5ynq2gEmuvt7RAc9yHk5sG+1pssLHsSgw/1IlCMfHFxIlhAycJq5FV8NBiI QhUAU9Jl3gg2JnRP308NOMNIXBKRvoIecOCY1awhfIbSAT2Aha3Q8F+XeNxqSu1RmcyV k/CamNmbU3JwTWKYGgAVrSpsm6bOx/sfsfajm+uzwxsTPOvgrZfL0E+tTdo1oCUssyEn ZHbQ== 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=IV0pzBsGANS34ps4xxZJbR881CnlULNAoIhbunxpJU4=; b=se2Pk+iFncT//TbtgaSMMtwJkkQpLVmyxWbn1xbQQgA7kMOzx/llpU4VWez8SUid2y T0L3Jzdnje3mY/6z/d2zDNq1RM/Qdh/PZA07ki4IvHVZdiPb3pbO1SE6NS3sTen2ZBEm qu7GHY+0gUT/f/pO81/rRiW2F5UGPcYiwfNWUqMpHwY6giBC9/xH2gJafEJ7mJVROE5a pRNHlki6ZTDwvd0p6KvjzsTA52R2vx/aZUGuRCgYjroCHvWe0dKwjxWCzKGVrGyFKx2Y +JgbnW8Jy9ihp0fq1TI9CGQKf7K1D4W+N89l3u3g9fd4aVlgVuvKe+qyHw2k8Ll3p0Fx 958A== X-Gm-Message-State: APf1xPChwOZXgcGrk5pW0M4WLTcHopb6Yhk6Vc+uuqMETPqlutFxn14P i7xhsnN81l4ubdhG/SaQF94= X-Google-Smtp-Source: AG47ELuf0NCYDDeGLbXMIB8R6F+o5zwM1uKpLqQEP+5nUnbMMtGFb23YPDHJksiGEozaMZ/gYYzaKQ== X-Received: by 10.223.187.72 with SMTP id x8mr22903244wrg.217.1520548821210; Thu, 08 Mar 2018 14:40:21 -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.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:20 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Yongbok Kim , Thomas Huth Date: Thu, 8 Mar 2018 23:39:36 +0100 Message-Id: <20180308223946.26784-16-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:c0c::242 Subject: [Qemu-devel] [PATCH 15/25] 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: Eduardo Habkost , =?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" Move the SouthBridge peripherals first, and keep the Super I/O peripherals last. 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 cd7bd0eef6..9e0724ca5a 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1062,10 +1062,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 @@ -1208,15 +1204,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 Thu Mar 8 22:39: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: 883382 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="vYMrCSaG"; 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 3zy5K029JXz9sW5 for ; Fri, 9 Mar 2018 09:48:36 +1100 (AEDT) Received: from localhost ([::1]:42260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Kw-0004i7-3r for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:48:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D4-0007AP-CI for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D2-0004CP-9P for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:26 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:41460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D1-0004BC-Vr for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:24 -0500 Received: by mail-wr0-x242.google.com with SMTP id f14so7246778wre.8 for ; Thu, 08 Mar 2018 14:40:23 -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=Yz21C6SNn44vrWph/wHJykqUCSUFUcIr9kzA0cOBv+A=; b=vYMrCSaGgj8U9ZbnmSgk5W61h/fNVWxF6W2ZwTmWdAZflWf8AFKjUwGzuaA7SxeZYk 1wA/2HGOSVIsB4XMzvDD5FFEUpfkcr9sHd/eARfoWo4kznY6zo4kk+SpFQseyObb1ncB 3RXvuG7wGe4zrF3ZqJPmgUt0ph2NByyiHya53z9AlyRG+TAT7sBnrxCBURabEbn6/2gm 5FMIThDYPc5Gl07rIO1XLMnwVwsjAnb76w4cNU+QdHCgdjj/i+/ccNrBxNSy90KhI/U2 3x+l4fu0tlEDJwxZiuIMbnKMySBh02HXUrFQu7Z5hqqjZIl4nh90aagyYPRW8l1GLezK EcdA== 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=Yz21C6SNn44vrWph/wHJykqUCSUFUcIr9kzA0cOBv+A=; b=UMEIq971hZY4LOxr4BBepjZaSDR3kBYPZB0Mrk9Jg0t8x4CVbb3lEdF6wG+71d5YrD S8VHj0Mlioj6O1lHGVMU2+Y6eNG413+1jb/+aR/HK+lAZuSZKpvRMAVUgCVEPmuPEJ/C 6wii3oz8tRu90bSS0uiuaEMu+cDG0qi1QGj08KuKdOEaHoMROt8f05iQe3ojJWObaE0+ yePV/hODwza0J2S7zJBBSpZhHNAkcXMWK88COpt6agU3ER/nXCOagCLr3lzgGVsUydj2 dAfZk41CD9GR/Ihc+/CfA5M4T9umH+MnF7nA1If+ylLa0u1ugTebFyDDHfyTJ2+ICoN1 B2Bw== X-Gm-Message-State: APf1xPAoSz5g7//ruGCHPxKs+2qpCzRwxft0AJo2gnNT34TnuXVsRzZ/ WrqBHYiCLJ3tAfG5Wc6gGqA= X-Google-Smtp-Source: AG47ELtrX2VJMxo1s0U5S6ouDGG5fgFgSjXE0r/Sg4agZ2qD3CZ1LXG8Li2P7xBxSczWfHegEHeRaA== X-Received: by 10.223.196.211 with SMTP id o19mr23275688wrf.256.1520548822888; Thu, 08 Mar 2018 14:40:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:22 -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 , Mark Cave-Ayland , Yongbok Kim , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:37 +0100 Message-Id: <20180308223946.26784-17-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:c0c::242 Subject: [Qemu-devel] [PATCH 16/25] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.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: Eduardo Habkost , =?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/superio.h | 2 ++ hw/isa/isa-superio.c | 19 +++++++++++++++++++ hw/mips/mips_malta.c | 35 ++++++++++------------------------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index 3dd5448f8c..b47aac3cf8 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -54,4 +54,6 @@ typedef struct ISASuperIOClass { ISASuperIOFuncs ide; } ISASuperIOClass; +#define TYPE_FDC37M81X_SUPERIO "fdc37m81x-superio" + #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index f98711beff..b95608a003 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -187,9 +187,28 @@ static const TypeInfo isa_superio_type_info = { .class_init = isa_superio_class_init, }; +/* SMS FDC37M817 Super I/O */ +static void fdc37m81x_class_init(ObjectClass *klass, void *data) +{ + ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); + + sc->serial.count = 2; /* NS16C550A */ + sc->parallel.count = 1; + sc->floppy.count = 1; /* SMSC 82077AA Compatible */ + sc->ide.count = 0; +} + +static const TypeInfo fdc37m81x_type_info = { + .name = TYPE_FDC37M81X_SUPERIO, + .parent = TYPE_ISA_SUPERIO, + .instance_size = sizeof(ISASuperIODevice), + .class_init = fdc37m81x_class_init, +}; + static void isa_superio_register_types(void) { type_register_static(&isa_superio_type_info); + type_register_static(&fdc37m81x_type_info); } type_init(isa_superio_register_types) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 9e0724ca5a..f6513a4fd5 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" @@ -1005,10 +1002,8 @@ void mips_malta_init(MachineState *machine) qemu_irq cbus_irq, i8259_irq; int piix4_devfn; I2CBus *smbus; - 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; @@ -1023,15 +1018,6 @@ void mips_malta_init(MachineState *machine) qdev_init_nofail(dev); - /* Make sure the first 3 serial ports are associated with a device. */ - for(i = 0; i < 3; i++) { - if (!serial_hds[i]) { - char label[32]; - snprintf(label, sizeof(label), "serial%d", i); - serial_hds[i] = qemu_chr_new(label, "null"); - } - } - /* create CPU */ mips_create_cpu(s, machine->cpu_type, &cbus_irq, &i8259_irq); @@ -1067,7 +1053,14 @@ void mips_malta_init(MachineState *machine) #else be = 0; #endif + /* FPGA */ + + /* Make sure the second serial port is associated with a device. */ + if (!serial_hds[2]) { + serial_hds[2] = qemu_chr_new("fpga-uart", "null"); + } + /* The CBUS UART is attached to the MIPS CPU INT2 pin, ie interrupt 4 */ malta_fpga_init(system_memory, FPGA_ADDRESS, cbus_irq, serial_hds[2]); @@ -1214,16 +1207,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); + /* Super I/O: SMS FDC37M817 */ + isa_create_simple(isa_bus, TYPE_FDC37M81X_SUPERIO); /* Network card */ network_init(pci_bus); From patchwork Thu Mar 8 22:39: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: 883396 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="p+nMjaKl"; 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 3zy5R55N6Pz9sl2 for ; Fri, 9 Mar 2018 09:53:53 +1100 (AEDT) Received: from localhost ([::1]:42292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Q3-0000vn-I4 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:53:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D5-0007B0-0H for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D3-0004D8-Qi for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:27 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:55473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D3-0004Ch-Fj for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:25 -0500 Received: by mail-wm0-x241.google.com with SMTP id q83so682872wme.5 for ; Thu, 08 Mar 2018 14:40:25 -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=QZ267pz5Pehx0/O/HW5sMwpiWd03lKnGPfIsK0JMZw4=; b=p+nMjaKlCa0dA+9j1501yB4K4JNZJlZhvI2pDGs6WcR/T22zS+3aRwJXUbI6x6VkO+ dfkPXthLFLoUqTlgrcjlHHWk4ivzbEeGAihq4Cit3z1eAVuBzsUeVQaYC579YoSkSdru uZ0iJ6tMyzC14gTEHZj0RzSQ6zV4VqGGx+qG64Yi0LzQCJ4z+pgBoyC529haOPnFB6KG QCstz1NCMpZIcC5/RCFPsaG3/eS9iR1hQx22nwqIVTeHgz+sZE4qzLQISi1JKyEgrRdM mQbm3K6uDnQkKU7o9+JqVl21Fixxz/tsoZ1HHKfciFnqdfQRHG1cxmG6WVT9lbaEh+72 o7Vg== 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=QZ267pz5Pehx0/O/HW5sMwpiWd03lKnGPfIsK0JMZw4=; b=IMTVQNRllHJWMdQxdDk9k2jJcoFfmCnbIRzJ7tpTB4OyYo5eWVLWxeNjhuAsMn9b2J I2xtflamUiNNHXbZ/FMzHQ6fBL5RY6lw6GR02kHB+b8+EmczcggdDfjidN8so8xz7TsW hmxVru4yraMxgW2c0ZI3Gr/XfBe7Y4NUFmkdtnRtJ/k54R5uM1E35wqOhkiksyA/BKgH klpMuJQ8UbhALJeZ8WWWJCjiDgEqujfgUVxN5yThO1IZCr9l75kyydvgzrmfHZ4QTSVH sM/8hRqTnh6xXjkcqajqwcJwfN6QS76RMkGnw8iZUKePlP4/SaSP2prlvvBG/pdlR4Zs kFaA== X-Gm-Message-State: AElRT7GtFSxvlXW5Lp8v0qiQPk7kx2p8Qzst3CbCV0sJ0AtFFMXAcQHQ fJU0qIC3yGr5BwcYLN4jkMSG4fhs X-Google-Smtp-Source: AG47ELuQ62QEEUj30INKb8L2m2L3cyMP+zbJZvi/cXfCT4+a3STRnanKFJOt/PM3bE/rjVDocnRtMw== X-Received: by 10.28.156.215 with SMTP id f206mr308836wme.131.1520548824456; Thu, 08 Mar 2018 14:40:24 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:23 -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 , Yongbok Kim , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:38 +0100 Message-Id: <20180308223946.26784-18-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 17/25] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_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: 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é --- hw/mips/mips_fulong2e.c | 83 ++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 9339e02120..ca1f76a724 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -78,8 +78,6 @@ #define FULONG2E_ATI_SLOT 6 #define FULONG2E_RTL8139_SLOT 7 -static ISADevice *pit; - static struct _loaderparams { int ram_size; const char *kernel_filename; @@ -232,11 +230,44 @@ static const uint8_t eeprom_spd[0x80] = { 0x20,0x30,0x20 }; -/* Audio support */ -static void audio_init (PCIBus *pci_bus) +static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc, + I2CBus **i2c_bus, ISABus **p_isa_bus) { - vt82c686b_ac97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 5)); - vt82c686b_mc97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 6)); + qemu_irq *i8259; + ISABus *isa_bus; + DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; + + isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(slot, 0)); + if (!isa_bus) { + fprintf(stderr, "vt82c686b_init error\n"); + exit(1); + } + *p_isa_bus = isa_bus; + /* Interrupt controller */ + /* The 8259 -> IP5 */ + i8259 = i8259_init(isa_bus, intc); + isa_bus_irqs(isa_bus, i8259); + /* init other devices */ + i8254_pit_init(isa_bus, 0x40, 0, NULL); + i8257_dma_init(isa_bus, 0); + + ide_drive_get(hd, ARRAY_SIZE(hd)); + vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1)); + + pci_create_simple(pci_bus, PCI_DEVFN(slot, 2), "vt82c686b-usb-uhci"); + pci_create_simple(pci_bus, PCI_DEVFN(slot, 3), "vt82c686b-usb-uhci"); + + *i2c_bus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(slot, 4), 0xeee1, NULL); + + /* 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 */ @@ -269,11 +300,9 @@ static void mips_fulong2e_init(MachineState *machine) MemoryRegion *bios = g_new(MemoryRegion, 1); long bios_size; int64_t kernel_entry; - qemu_irq *i8259; PCIBus *pci_bus; ISABus *isa_bus; I2CBus *smbus; - DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; MIPSCPU *cpu; CPUMIPSState *env; @@ -335,46 +364,16 @@ static void mips_fulong2e_init(MachineState *machine) /* North bridge, Bonito --> IP2 */ pci_bus = bonito_init((qemu_irq *)&(env->irq[2])); - /* South bridge */ - ide_drive_get(hd, ARRAY_SIZE(hd)); - - isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0)); - if (!isa_bus) { - error_report("vt82c686b_init error"); - exit(1); - } - - /* Interrupt controller */ - /* The 8259 -> IP5 */ - i8259 = i8259_init(isa_bus, env->irq[5]); - isa_bus_irqs(isa_bus, i8259); - - vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(FULONG2E_VIA_SLOT, 1)); - pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2), - "vt82c686b-usb-uhci"); - pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 3), - "vt82c686b-usb-uhci"); + /* South bridge -> IP5 */ + vt82c686b_southbridge_init(pci_bus, FULONG2E_VIA_SLOT, env->irq[5], + &smbus, &isa_bus); - smbus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 4), - 0xeee1, NULL); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd)); - /* init other devices */ - pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); - - /* Super I/O */ - isa_create_simple(isa_bus, TYPE_I8042); - 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 */ + /* Network card: RTL8139D */ network_init(pci_bus); } From patchwork Thu Mar 8 22:39: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: 883385 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="rv7ZO31T"; 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 3zy5Mx3gXFz9scM for ; Fri, 9 Mar 2018 09:51:08 +1100 (AEDT) Received: from localhost ([::1]:42277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4NM-0006oP-U3 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:51:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4D6-0007BF-DR for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D5-0004ET-HQ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:28 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:54058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D5-0004Dn-6L for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:27 -0500 Received: by mail-wm0-x241.google.com with SMTP id e194so700071wmd.3 for ; Thu, 08 Mar 2018 14:40: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=I9tlrpPAPTQoMufH7xOCWewFLCL19qQTxXS/LQtqwmY=; b=rv7ZO31TEUvQw+QS1L65YQ6bneCG3bcmsAnLxOpTF6X7yG4sFFqOiVxLPleJg597hv 632vgvtXyNz3DS4XvNuWSo4ek4ydVCEeSd3Bl0NkY9MIvmIpoVzrdQGSQDdGJacUo6F9 +tAeOP0GzISPoDb0OwEO7vLin5FrH3OkhVxytncCUjoulZVJ5tJGi+TnerDovt19hGCf S3dvQeUzwLE/vXyfZMdMiw7W0OlbQFTE1WZAuuFob+2F0YCllqqU061Hgc38kPQBB1dE Lt6maEUJtKRboyus1c0LVkm+SFMsBerQH5Ex2HSD+k/vvTnO242nIWGwJX0IoApFl25L 5piQ== 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=I9tlrpPAPTQoMufH7xOCWewFLCL19qQTxXS/LQtqwmY=; b=G1GIemMv6B7NY1Nikc5X/9ceo4yKVIVfS2uxdVyhHLlr6+U5fQaYRbTQGB9HxhGkwC bX/1BWWsV08+ozgV9TwATaVXDN69Jkf275K2Ln8Cxd8dt16sfb3+zHAG+PRxe+w6hVMx jKyu0tKIt1jM4pjbUNHDcWmG8yVv0fNgxJ1mRHOva/AmIVSOuCypNtT/MJuWAtVXv6vf sRCfmw3mBXoEg/RmXd+V/C9lgPBEVZK4EmfrUsk/Nxk4qSVFDQpk5jRc2b9QmVzIvied DzFWZQxcWNvatN34Wh20GyvP57gE2H2Edp/n8j3mV0AK/HjUIcKbANhgqEuip754jLZ3 QACA== X-Gm-Message-State: AElRT7G6p+dVxNi9hI6R17AApUu25hisNejiZ8VN72mmQvavqDFvvHso ieEEFOuReWbkdVByRSWcNdY= X-Google-Smtp-Source: AG47ELtMaDUcsTADws3ODVFryM6yKbH42j+LT5Uycb3my0hDrH5LDEhWWKPEmt8O5lmPDrHgv3pvxw== X-Received: by 10.28.109.90 with SMTP id i87mr287510wmc.71.1520548826212; Thu, 08 Mar 2018 14:40:26 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:25 -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:39 +0100 Message-Id: <20180308223946.26784-19-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 18/25] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_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: 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" This function only initialize the ISA bus. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/vt82c686.h | 2 +- hw/isa/vt82c686.c | 2 +- hw/mips/mips_fulong2e.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index 471b5e9e53..db97c8ed7a 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -2,7 +2,7 @@ #define HW_VT82C686_H /* vt82c686.c */ -ISABus *vt82c686b_init(PCIBus * bus, int devfn); +ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn); void vt82c686b_ac97_init(PCIBus *bus, int devfn); void vt82c686b_mc97_init(PCIBus *bus, int devfn); I2CBus *vt82c686b_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 070cc1889f..7eaf3c7e8f 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -478,7 +478,7 @@ static void vt82c686b_realize(PCIDevice *d, Error **errp) qemu_register_reset(vt82c686b_reset, d); } -ISABus *vt82c686b_init(PCIBus *bus, int devfn) +ISABus *vt82c686b_isa_init(PCIBus *bus, int devfn) { PCIDevice *d; diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index ca1f76a724..9ebc225d3b 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -237,7 +237,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc, ISABus *isa_bus; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; - isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(slot, 0)); + isa_bus = vt82c686b_isa_init(pci_bus, PCI_DEVFN(slot, 0)); if (!isa_bus) { fprintf(stderr, "vt82c686b_init error\n"); exit(1); 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 */ From patchwork Thu Mar 8 22:39: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: 883400 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="UQLiAJIh"; 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 3zy5Xw2KKVz9sfg for ; Fri, 9 Mar 2018 09:58:56 +1100 (AEDT) Received: from localhost ([::1]:42324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Uw-0005TQ-64 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:58:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DA-0007EA-08 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4D8-0004JO-UZ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:31 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:50534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4D8-0004Id-Ld for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:30 -0500 Received: by mail-wm0-x242.google.com with SMTP id w128so728150wmw.0 for ; Thu, 08 Mar 2018 14:40: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=fvAHyDfqdwOMzP2f5LHoO1qd2HN2DlmYaezctJSGzOI=; b=UQLiAJIhHkk7Gwdt8q7ADlV1dMLO5CLODlSynIt8/5bvpzAAIXLxH+gpskV7k/BDXM Wjg4tgooOOjeF3dOJNxqdISYs9HQ6u+8LCm+zYz7sXCTXEwGJUyD9fTYldRpH/btD97H RLEBJIPGR01FEac9A/9uQdgHDsCgUbK4TekFV6+rSbMDbIVfMLWNdx5DeisjtanbdHkI g8CWNGCUH8re65KL5SqD+fnFY7t2hBbRfEwNw5ZvPQgBo8/6P0jhWY7YpKoORlIul1ux 4LikJiK6BCD5ut8/+F88iDdFOj0+SJwGhlH4Zglr8qWta2zB/q6akQKxsUg22v2Vztqm Eajg== 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=fvAHyDfqdwOMzP2f5LHoO1qd2HN2DlmYaezctJSGzOI=; b=GrrjNjrRhEQxrLfIbLVdNgWnr4jmSDGKXH1PstTnVmjDAcGzXXrlRHc86868gZ2AKI 4hd+yPaZgDCgLjjvIYNDSqUHwQ02YVF8PFothYx6Smh3sH7n344elTrT7zoLvxlz2PpR O9Udij1Cu0KuP56oNCb4FnJFO4ny0sRSW0A9mq8ZIDE1HZUoqsT9EtrQu9ZI2VqTwEGt qZGmFxPCVwKaiiiFZqzPvSI+pmAEIL/RZTSYayZXiuaJaXWsyQYcBlpnZkHCsoIdGIgg r1BhFnN9DznrnldcBgMAlBhW3shG7KDPshMRjHvlYQuM9tCHjD55WrL9VHIpvDdjZu46 FljQ== X-Gm-Message-State: AElRT7Fafiwahdl7IoS6Kq4gDputn1u5CMlRe0grra271Lq1Qf78OiPi bHjMpnTOBQ3UCj3FN0VJ3Lc= X-Google-Smtp-Source: AG47ELsowCqo/1iepXJY50+nVcJGzQ9eHumMLxc0XDn6xsYad7Ze4KheIBrTwYZnrfhXwUzXfvlQRw== X-Received: by 10.28.95.139 with SMTP id t133mr302681wmb.16.1520548829614; Thu, 08 Mar 2018 14:40:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:29 -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 , Thomas Huth Date: Thu, 8 Mar 2018 23:39:41 +0100 Message-Id: <20180308223946.26784-21-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::242 Subject: [Qemu-devel] [PATCH 20/25] MAINTAINERS: Add entries for the VT82C686B Super I/O 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 , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" So far, it is only used by the MIPS Fulong 2E mini PC. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 98a8918c20..facdab44e1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -689,6 +689,8 @@ Fulong 2E M: Yongbok Kim S: Odd Fixes F: hw/mips/mips_fulong2e.c +F: hw/isa/vt82c686.c +F: include/hw/isa/vt82c686.h Boston M: Paul Burton From patchwork Thu Mar 8 22:39: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: 883404 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="hm0IDRRW"; 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 3zy5cR6LKwz9sfk for ; Fri, 9 Mar 2018 10:01:57 +1100 (AEDT) Received: from localhost ([::1]:42345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Xq-0008HJ-Oi for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 18:01:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DF-0007KP-Lw for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4DA-0004LA-P6 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:37 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:54868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4DA-0004Ju-3l for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:32 -0500 Received: by mail-wm0-x242.google.com with SMTP id z81so691031wmb.4 for ; Thu, 08 Mar 2018 14:40:31 -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=5v5NeUaG9qWqCqBrZNNvsdvs0YNbVEvNjCi3l1xME1w=; b=hm0IDRRWPC8PJoYDvWuczCcioLoW8yw+njsTOPga3KsPefeiG6CGc0G/SQ0BN8nCCu vlRgXkHwb/apNmlqr8XMDMziy4GYKbPxVrrZHkIT9teWDKiAnnR+Zrf4LIhsQc/rR0MD HwIsdXtVTMus8UurEjQIQGYLEFfo/3LB/p5W2Ux7G8DV5MKSoDJGJ9qhGu6BwxjvneFt Mt+VwNwiO877s732U4te+BPk/u02fb5xh822XoJomdK//tWQ50XFYNFiE+QyOF1Lh4EB ur2VdDOLXxSiNbegQaNZQ0iwtxmBM7RYtqPiaCdMgbdJKxzb3D9mrsdT74iAvEsTQJlx TDyA== 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=5v5NeUaG9qWqCqBrZNNvsdvs0YNbVEvNjCi3l1xME1w=; b=LsDGEe1xXXu2tWSM3JJrQCWUjIm9iuIEzVEY5/pOwcfdXJuEL0vYw2tphPBTVqQ5gK jn1rnUlgo1SOC0iqsuFLy92Cyn59aRUQStRubvoEN6tRtEqKBMENyMvrcWSo3LhofapF rweUmHq7J2Rp2OzPPJYJaSxrvls4FnVriOWly13qPySedXNNE8pYF5CpdHF0TrV1eFgC 3x6TV8zoBHSR2jxjj78qg0EN1m9vaQ8uQi/RyhtrnS93LpXDGR7pm78LBtmvJla8xvW2 D1g8UvZWKwfVNG0hsOAkJjAT8qimjJioU6sR2EszwuGHs6FQ4L8uOI5pOUuV3TynRsF0 LT4g== X-Gm-Message-State: AElRT7FgV5+h/N/VwMfjmgnOsx+o17+Y28areT3QDNqpNctr+D0UlMJq +vzy5+xJ+yjMdhRHfKUqBow= X-Google-Smtp-Source: AG47ELsazHANXn800Mz0u/8nvW042K+rdDMWuZxfhlKPlrwZQGKZ/fKLo4qYiSc9CqVvgSxhm6eqQw== X-Received: by 10.28.164.196 with SMTP id n187mr267224wme.141.1520548831167; Thu, 08 Mar 2018 14:40:31 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Michael S . Tsirkin" , Paolo Bonzini , Richard Henderson , Aurelien Jarno , Thomas Huth Date: Thu, 8 Mar 2018 23:39:42 +0100 Message-Id: <20180308223946.26784-22-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::242 Subject: [Qemu-devel] [PATCH 21/25] MAINTAINERS: Split the Alpha TCG/machine section 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 , Alexey Kardashevskiy , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , Marcel Apfelbaum , Guan Xuetao , Yongbok Kim , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index facdab44e1..e806491d6c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -127,7 +127,6 @@ Alpha M: Richard Henderson S: Maintained F: target/alpha/ -F: hw/alpha/ F: tests/tcg/alpha/ F: disas/alpha.c @@ -402,6 +401,11 @@ F: include/*/*win32* X: qga/*win32* F: qemu.nsi +Alpha Machines +M: Richard Henderson +S: Maintained +F: hw/alpha/ + ARM Machines ------------ Allwinner-a10 From patchwork Thu Mar 8 22:39: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: 883403 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="ZKYdPCCw"; 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 3zy5bK2LYSz9sfc for ; Fri, 9 Mar 2018 10:01:01 +1100 (AEDT) Received: from localhost ([::1]:42339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Wx-0007An-7Y for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 18:00:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DH-0007KU-3z for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4DC-0004NZ-5N for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:39 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4DB-0004M5-Sx for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:34 -0500 Received: by mail-wm0-x241.google.com with SMTP id s206so1072536wme.0 for ; Thu, 08 Mar 2018 14:40: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=QaNNKXkVGEKCr5sIVQUd1JBzNNqPtiZvtGJmknFkalg=; b=ZKYdPCCw6h9TPB2dhzxv8OaYgPM2cm4IKIaQd0Q1KB9XqGYvpNHPpKRazPtz7WLo0n 3evFXoXnCExYLr7F64TfnwZwmd8Tv2Bmjwzd1EkbRtJAlf1I7zlDC5/sqVl6WgexlU2i fr1bjLPEJlEy402xPU+wuSTozfuGAdn7mbBsgc7WQPEc2gq6E0aydjApf7fMcMteJzYR fSnYjq4srBAgwqzRP6rdH24MT+M+sLOMFqZ8Y5jJdtvyqpVtZtLIC5U3L5DYOMJ537vl iK6SgC9Q3ksUyfqhovFlf2W14xcXM+nitrrNCWcAsGs8dW6Set2XTP0MzRC1Gb0x6De0 8TFA== 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=QaNNKXkVGEKCr5sIVQUd1JBzNNqPtiZvtGJmknFkalg=; b=WkaDLMl2IuFtc8ES4ZIl9qs5LOM/X6MMVhNB1vTIY8ZTguGFuMR0r9AZdiGOwiDdbx XhHn8X5YG2MRt4gdrZO7BzkgM7xozZBONODa0ayEQy+vYAxiagkm14851+mXF9fzq0+/ Vl/lgcpNUdAHD7kiRTCb/aPsDvTxZXAI3Z7qvNcYR6sx5S806ZDe+5z6X7hJm1TxE7mK lHatKGBSghtAR5lytrTUH+361zVL45sR8lSIPUQa3nq7I2Y9/01sV44mSldMmnKcu2vJ moScI7aWJYMFD7vsuySaLhBuSWXxdqWcmGnf2KSMmXruqJ4oDdOz4HY6VLP1jmgBDGkQ JrbA== X-Gm-Message-State: AElRT7HASJ2+ts7Ma3wxsrUb+36OGcrnLh4UxeI4T47SyLmgr7HQv+/y QzpldkABkesVjrYB/CrZO5s= X-Google-Smtp-Source: AG47ELuuqtJHguFdsCG2NYVCynp4waLntgVKqI7zfSndU9UnPn5VSgOx74t9gnfbhI2fIbTZxSV2Kg== X-Received: by 10.28.245.9 with SMTP id t9mr44845wmh.33.1520548832800; Thu, 08 Mar 2018 14:40:32 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:32 -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 , Mark Cave-Ayland , Alexey Kardashevskiy , Richard Henderson , Thomas Huth Date: Thu, 8 Mar 2018 23:39:43 +0100 Message-Id: <20180308223946.26784-23-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 22/25] hw/isa/superio: Add the SMC FDC37C669 Super I/O 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 , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Guan Xuetao , Yongbok Kim , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- Richard: I added the smc37c669 device in the Alpha machine, since it is the only user, as Michael previously suggested the non-PC devices should not be in the "PC chipset" entry which is already big (that's why some devices got moved from there to MIPS and PPC). include/hw/isa/superio.h | 1 + hw/isa/smc37c669-superio.c | 115 +++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + hw/isa/Makefile.objs | 2 +- 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 hw/isa/smc37c669-superio.c diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index b47aac3cf8..f9ba29aa30 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -55,5 +55,6 @@ typedef struct ISASuperIOClass { } ISASuperIOClass; #define TYPE_FDC37M81X_SUPERIO "fdc37m81x-superio" +#define TYPE_SMC37C669_SUPERIO "smc37c669-superio" #endif /* HW_ISA_SUPERIO_H */ diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c new file mode 100644 index 0000000000..aa233c6967 --- /dev/null +++ b/hw/isa/smc37c669-superio.c @@ -0,0 +1,115 @@ +/* + * SMC FDC37C669 Super I/O controller + * + * Copyright (c) 2018 Philippe Mathieu-Daudé + * + * This code is licensed under the GNU GPLv2 and later. + * See the COPYING file in the top-level directory. + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/isa/superio.h" + +/* UARTs (compatible with NS16450 or PC16550) */ + +static bool is_serial_enabled(ISASuperIODevice *sio, uint8_t index) +{ + return index < 2; +} + +static uint16_t get_serial_iobase(ISASuperIODevice *sio, uint8_t index) +{ + return index ? 0x2f8 : 0x3f8; +} + +static unsigned int get_serial_irq(ISASuperIODevice *sio, uint8_t index) +{ + return index ? 3 : 4; +} + +/* Parallel port */ + +static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index) +{ + return index < 1; +} + +static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index) +{ + return 0x3bc; +} + +static unsigned int get_parallel_irq(ISASuperIODevice *sio, uint8_t index) +{ + return 7; +} + +static unsigned int get_parallel_dma(ISASuperIODevice *sio, uint8_t index) +{ + return 3; +} + +/* Diskette controller (Software compatible with the Intel PC8477) */ + +static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index) +{ + return index < 1; +} + +static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index) +{ + return 0x3f0; +} + +static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index) +{ + return 6; +} + +static unsigned int get_fdc_dma(ISASuperIODevice *sio, uint8_t index) +{ + return 2; +} + +static void smc37c669_class_init(ObjectClass *klass, void *data) +{ + ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); + + sc->parallel = (ISASuperIOFuncs){ + .count = 1, + .is_enabled = is_parallel_enabled, + .get_iobase = get_parallel_iobase, + .get_irq = get_parallel_irq, + .get_dma = get_parallel_dma, + }; + sc->serial = (ISASuperIOFuncs){ + .count = 2, + .is_enabled = is_serial_enabled, + .get_iobase = get_serial_iobase, + .get_irq = get_serial_irq, + }; + sc->floppy = (ISASuperIOFuncs){ + .count = 1, + .is_enabled = is_fdc_enabled, + .get_iobase = get_fdc_iobase, + .get_irq = get_fdc_irq, + .get_dma = get_fdc_dma, + }; + sc->ide.count = 0; +} + +static const TypeInfo smc37c669_type_info = { + .name = TYPE_SMC37C669_SUPERIO, + .parent = TYPE_ISA_SUPERIO, + .instance_size = sizeof(ISASuperIODevice), + .class_size = sizeof(ISASuperIOClass), + .class_init = smc37c669_class_init, +}; + +static void smc37c669_register_types(void) +{ + type_register_static(&smc37c669_type_info); +} + +type_init(smc37c669_register_types) diff --git a/MAINTAINERS b/MAINTAINERS index e806491d6c..db20e52f5d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -405,6 +405,7 @@ Alpha Machines M: Richard Henderson S: Maintained F: hw/alpha/ +F: hw/isa/smc37c669-superio.c ARM Machines ------------ diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs index cac655ba58..83e06f6c04 100644 --- a/hw/isa/Makefile.objs +++ b/hw/isa/Makefile.objs @@ -1,5 +1,5 @@ common-obj-$(CONFIG_ISA_BUS) += isa-bus.o -common-obj-$(CONFIG_ISA_BUS) += isa-superio.o +common-obj-$(CONFIG_ISA_BUS) += isa-superio.o smc37c669-superio.o common-obj-$(CONFIG_APM) += apm.o common-obj-$(CONFIG_I82378) += i82378.o common-obj-$(CONFIG_PC87312) += pc87312.o From patchwork Thu Mar 8 22:39: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: 883405 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="UXL31nJ6"; 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 3zy5fH1YBkz9sfk for ; Fri, 9 Mar 2018 10:03:35 +1100 (AEDT) Received: from localhost ([::1]:42355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4ZR-0001Af-3m for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 18:03:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DI-0007MH-RW for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4DD-0004Oa-Qh for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:40 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:50535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4DD-0004O2-Is for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:35 -0500 Received: by mail-wm0-x242.google.com with SMTP id w128so728432wmw.0 for ; Thu, 08 Mar 2018 14:40: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=tPKe60jAPGqC1x9BVaAR9UT5kMd9v4doCYyl5jwN5EU=; b=UXL31nJ6QN2fRiPC0XK5kvArBiJfGw87T+C1w4XBwvig2L1blaIt1wBwU2vy0x2y+Z 5XQ8fhimxp9yX8g3E39dIT4FfpY9iKHbnudNXpwcsu4rOasw/dher7yuWmRwVMsSO6ZZ GMZROldTjoEHIWYOoh3g4qzTzn1rwr6HW6XDI81fMRNgF8ulDt5TLNSaSLCfdx9LtQYP E4tVHxAAyKipSTPFSm3eIU/qjWzf6JGwfU1HJ+CHerhz7ek+9fEZYjXB8CEVSdlUtAc9 /W8mOobFwXgwuXUR3FrJVGBRWanBQxGlOicu3E/V3UlM70fVfw8E3vbRrGnz00UgiFEU EUlA== 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=tPKe60jAPGqC1x9BVaAR9UT5kMd9v4doCYyl5jwN5EU=; b=sv6pj9wpL9ALkPBpHlzORiBTVYj8czsRV/xQKkpMoRv2cV5rTS7jRBxyTUmEMP/VOD W+PXI0pKkId62ICpILZyvREufhzM13P15WXjbm9t3L3HXA5dS4ZjyRv2nqEc1Z8MbFLv 7zBfdPiC3etj3/f2asnQgseOIWM7lVGweTm3/hracXdGLuQzqsINhLaVhRvabV1ugIaD 00QR+lvWhEcdewOSTriluUDgnivpBD7B2w+qeHcHexilpe1ZtL4bM+gbDA6pQFOjzqWw 08wQlSENmegba7GoCnIIg045ANYChf5B/cBaHVXsjPERp65+pAdLXr8UyWfgE3CByxwy zocw== X-Gm-Message-State: AElRT7FsDgv6R2rIaWdfNx993SykN85/CbMcZ0S5zSN0csZKXwxE+hE7 1CKkLHw72CtdQHefubuH728= X-Google-Smtp-Source: AG47ELtJk3n4rDYrFtomTDxVQQh9nPbQFYjYUUyZXz8K43YPTl6Lh5FJo/VEPKhcyxW34qI7MmDhZw== X-Received: by 10.28.166.206 with SMTP id p197mr275404wme.81.1520548834620; Thu, 08 Mar 2018 14:40:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:34 -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 , Richard Henderson , Thomas Huth Date: Thu, 8 Mar 2018 23:39:44 +0100 Message-Id: <20180308223946.26784-24-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::242 Subject: [Qemu-devel] [PATCH 23/25] hw/alpha/dp264: Add the ISA DMA controller 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 , Yongbok Kim , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- default-configs/alpha-softmmu.mak | 2 ++ hw/alpha/dp264.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak index e0d75e3058..3740adc5e9 100644 --- a/default-configs/alpha-softmmu.mak +++ b/default-configs/alpha-softmmu.mak @@ -4,7 +4,9 @@ include pci.mak include usb.mak CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y +CONFIG_I82374=y CONFIG_I8254=y +CONFIG_I8257=y CONFIG_PCKBD=y CONFIG_VGA_CIRRUS=y CONFIG_IDE_CORE=y diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index e13cb576fd..ffad678ea7 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -21,6 +21,7 @@ #include "hw/timer/i8254.h" #include "hw/input/i8042.h" #include "hw/char/serial.h" +#include "hw/dma/i8257.h" #include "qemu/cutils.h" #define MAX_IDE_BUS 2 @@ -95,6 +96,9 @@ static void clipper_init(MachineState *machine) pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); } + /* 2 82C37 (dma) */ + isa_create_simple(isa_bus, "i82374"); + /* IDE disk setup. */ { DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; From patchwork Thu Mar 8 22:39: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: 883395 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="EM7ektlG"; 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 3zy5Qt21Yhz9scZ for ; Fri, 9 Mar 2018 09:53:42 +1100 (AEDT) Received: from localhost ([::1]:42290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Ps-0000km-3n for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:53:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DI-0007MJ-SJ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4DF-0004PQ-Dc for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:40 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:37305) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4DF-0004P4-6h for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:37 -0500 Received: by mail-wm0-x244.google.com with SMTP id 139so694736wmn.2 for ; Thu, 08 Mar 2018 14:40: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=PV0zG50CLD4CRQ3Go/FdO67r9aU1bGuOfTBtuUZTSAU=; b=EM7ektlG4nunRwKfDBIE5O4+WdMiHYhDXxfoYE7PROu33SnO9XHFcREYAwpFjnhw3v F49RGp+zazDprlUl/ot2T3MWaXXfHcF08BavNdzdi2dGLXjnMbtABwmhLSyHtnIhSebO oTdKQdUqErreBYq4LLK+U62zZJXCgLUM08JBhh/+fzEoB8XXORNdl1DQWP9g5ZNFcI+t v5vXtc57ZwljSln3EZxLfiuluG1NaHRSe/CW6WxqYBaER7cnGdL8niXcaavQqJXC1du/ 14VqU4+S/9g7GjDP6Q1hrDjF+RZtJPLdfEkR3pEsTW3kLBihlrS1BHhSw6kk2epp8Wkv K80g== 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=PV0zG50CLD4CRQ3Go/FdO67r9aU1bGuOfTBtuUZTSAU=; b=YIAXhiw8c8d8zjXUi64avb1NlczynjuDuAI4m6tfpoXJwlqEOyDdOP9uRW4r9WDgur zCcbMwMEHJ1ODXqUNxzcsBgXmhsEqkVJ58CO2ni44TmV3+aKmhWm8hNZoVO+Dj9MjIN+ YAPpA9eXhRoOMi1HfTXWz4aptsY+Dhh060WIUecfojh0FM2uFhZS6ECis5S+1qOpceGc eRMSZpeVxmDfcLo/PBNE0oKNsqjJKQoCn1gpnCWzIPRjB1G6rCP2T9+5LxVKWBn44VRj OIpC5NMnibPgWQTwxuWHQ3uvHU4ywyktraUj9pyuF2HeI84mCAjIqD8PSSt7tvWqRF6z QEGg== X-Gm-Message-State: AElRT7FNs0QoTGY59U8z5uEO8qgIEnlyHz9mEXxB0tOQ02G5rrkVTTiu ZAWK33PDtPEM1ERX+ZfWBAA= X-Google-Smtp-Source: AG47ELviRRtAR+FNlTJCg10H1Q3dJa0r7jp9xqVg9ownmEJVax9Hofrff14XxmmJXfZiHrHjBaIKwQ== X-Received: by 10.28.174.80 with SMTP id x77mr326367wme.130.1520548836212; Thu, 08 Mar 2018 14:40:36 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:35 -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 , Richard Henderson , Aurelien Jarno , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:45 +0100 Message-Id: <20180308223946.26784-25-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::244 Subject: [Qemu-devel] [PATCH 24/25] hw/alpha/dp264: Use the TYPE_SMC37C669_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 , Yongbok Kim , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- default-configs/alpha-softmmu.mak | 3 +++ hw/alpha/dp264.c | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak index 3740adc5e9..bbe361f01a 100644 --- a/default-configs/alpha-softmmu.mak +++ b/default-configs/alpha-softmmu.mak @@ -7,6 +7,9 @@ CONFIG_SERIAL_ISA=y CONFIG_I82374=y CONFIG_I8254=y CONFIG_I8257=y +CONFIG_PARALLEL=y +CONFIG_PARALLEL_ISA=y +CONFIG_FDC=y CONFIG_PCKBD=y CONFIG_VGA_CIRRUS=y CONFIG_IDE_CORE=y diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index ffad678ea7..80b987f7fb 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -19,8 +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 "hw/isa/superio.h" #include "hw/dma/i8257.h" #include "qemu/cutils.h" @@ -83,14 +82,10 @@ 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, TYPE_I8042); /* VGA setup. Don't bother loading the bios. */ pci_vga_init(pci_bus); - /* Serial code setup. */ - serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); - /* Network setup. e1000 is good enough, failing Tulip support. */ for (i = 0; i < nb_nics; i++) { pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); @@ -99,6 +94,9 @@ static void clipper_init(MachineState *machine) /* 2 82C37 (dma) */ isa_create_simple(isa_bus, "i82374"); + /* Super I/O */ + isa_create_simple(isa_bus, TYPE_SMC37C669_SUPERIO); + /* IDE disk setup. */ { DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; From patchwork Thu Mar 8 22:39: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: 883387 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="JeEtzLvw"; 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 3zy5NL3SwTz9scR for ; Fri, 9 Mar 2018 09:51:30 +1100 (AEDT) Received: from localhost ([::1]:42283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Nk-0007Hl-8R for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:51:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4DI-0007MI-Ro for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4DG-0004QA-UX for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:40 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33240) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4DG-0004Pp-NQ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:38 -0500 Received: by mail-wm0-x244.google.com with SMTP id s206so1072720wme.0 for ; Thu, 08 Mar 2018 14:40:38 -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=ZORzMwhVNq6Apd7n9O7vbwV2SKlYu0hZ5RimPoQv8pc=; b=JeEtzLvwFSVhzLJnN+miS/vYVfxdNuL1OoagsaMZdc+7jg4nfuyZPvO5L+WkE9IH8r olOccSUfDUdiijY51H3eIdZiVMrHILDOW910FgWhijnuKO2lCzkF156u+pooJRKlvR4f Do/6VvqOVHHNMJ2GfhoD+6Ppk3fCEsxLik51oD12YB3O9ZoMCDIeVtpPlBaKOKEEedyx 1oqD3TPhVfodQi5Ln7bStfeSZM80oFawQkmi4UjlKxE52f2XqjswF+tVG9m5k3TUkCQs dcdqBeekkS1XnczDtu0WXdpFnXM+GLEPeOMSRCr7ktSxpEAyl2ojTt/wxkzezat1lwKt E1Vg== 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=ZORzMwhVNq6Apd7n9O7vbwV2SKlYu0hZ5RimPoQv8pc=; b=WADJvzEn7NiontlOqJAgiU+nvul7ZYs6f4S0L8/JEJ5QWbk2EnOwFmVwo7aM6CKBk0 tWa/OscSY6NPxsmgvsro15i8uocQSqZ1TsbAmajuYARoEruLkOV0lbEPXgm1Q2ZWuKzG PUAX5JQfCDIqohIBbZZaO6hn3xH1r9Nq7RaMs1TOB1osQsxdRPpbEaknuCb8wYcYYeTo JGX/b53df+ru8aArKq5Hd5pNoEZLchqNKjdAZQx5iObuQJR7+jmVli9KPNku94bqZ+Yl PrcFs5rRixx3zXHWs1Mkm0fasbiPuUHMR1wvkescdqOYoNzZYf7ptxKlpT13Lyp93xGF e5Vw== X-Gm-Message-State: AElRT7EI9nttu+KNlY7kvFNBtckVxZRy8Pw0VHODQf849EgLv+gZB647 kv+j72INaziNiY/gfyUe6MQ= X-Google-Smtp-Source: AG47ELtYta4p2VFauzC2EkzYIpwInWZkSSDEgPcIwnDvdtJGBepMTYJdmwBZRfmVBvKADJ8xk0X2AQ== X-Received: by 10.28.245.9 with SMTP id t9mr44969wmh.33.1520548837729; Thu, 08 Mar 2018 14:40:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:37 -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 , Thomas Huth Date: Thu, 8 Mar 2018 23:39:46 +0100 Message-Id: <20180308223946.26784-26-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::244 Subject: [Qemu-devel] [PATCH 25/25] hw/i386/pc: Factor out the superio 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: Eduardo Habkost , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Guan Xuetao , 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é --- hw/i386/pc.c | 72 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index cdcdfafe8e..20fa62f5d6 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1519,6 +1519,44 @@ static const MemoryRegionOps ioportF0_io_ops = { }, }; +static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport) +{ + int i; + DriveInfo *fd[MAX_FD]; + qemu_irq *a20_line; + ISADevice *i8042, *port92, *vmmouse; + + serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); + parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); + + 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); + } + + i8042 = isa_create_simple(isa_bus, "i8042"); + if (!no_vmport) { + vmport_init(isa_bus); + vmmouse = isa_try_create(isa_bus, "vmmouse"); + } else { + vmmouse = NULL; + } + if (vmmouse) { + DeviceState *dev = DEVICE(vmmouse); + qdev_prop_set_ptr(dev, "ps2_mouse", i8042); + qdev_init_nofail(dev); + } + port92 = isa_create_simple(isa_bus, "port92"); + + a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2); + i8042_setup_a20_line(i8042, a20_line[0]); + port92_init(port92, a20_line[1]); + g_free(a20_line); +} + void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, bool create_fdctrl, @@ -1527,13 +1565,11 @@ 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; qemu_irq rtc_irq = NULL; - qemu_irq *a20_line; - ISADevice *i8042, *port92, *vmmouse, *pit = NULL; + ISADevice *pit = NULL; MemoryRegion *ioport80_io = g_new(MemoryRegion, 1); MemoryRegion *ioportF0_io = g_new(MemoryRegion, 1); @@ -1590,36 +1626,10 @@ 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_setup_a20_line(i8042, a20_line[0]); - if (!no_vmport) { - vmport_init(isa_bus); - vmmouse = isa_try_create(isa_bus, "vmmouse"); - } else { - vmmouse = NULL; - } - if (vmmouse) { - DeviceState *dev = DEVICE(vmmouse); - qdev_prop_set_ptr(dev, "ps2_mouse", i8042); - qdev_init_nofail(dev); - } - port92 = isa_create_simple(isa_bus, "port92"); - port92_init(port92, a20_line[1]); - 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); - } + /* Super I/O */ + pc_superio_init(isa_bus, create_fdctrl, no_vmport); } void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)