From nobody Tue Oct 28 12:16:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515380038618998.9776303131467; Sun, 7 Jan 2018 18:53:58 -0800 (PST) Received: from localhost ([::1]:59383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNZV-0004PR-Sv for importer@patchew.org; Sun, 07 Jan 2018 21:53:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNSJ-0006gk-G5 for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNSI-0002MB-IU for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:31 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:42609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNSI-0002Lz-EU for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:30 -0500 Received: by mail-qt0-x243.google.com with SMTP id g9so12060521qth.9 for ; Sun, 07 Jan 2018 18:46:30 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pN54l5060qnSKve+RUs6hFoj4ulmEP357iz1qzBmy3Q=; b=jVs4cb5UkvqXvKg9ou6HA75I0dyU8xXmr24IJiFsSZmng8OwmlEqu0zYKXUMx9VlHd NuqYaWvvKtODc7LJOFl0mjdSt0byDAMb6cxi+WJNyPOjTAjF/cFga2G8bCQ0T1LcoRX6 adM5hql/DZ73SeqMnVMAB1e/nEipynUoUxivzJEaT/mbSp4lT1ySaeuIbihGl+9RXYod tggzAbC1vJDFIrn5Ec/3xnArh8lGLMYzarggyGDjzA7RGUQ6yGLDiiqC/JIp1S038P/x gvd5Cs3zYenb5OUpvXYjqEDPXj7ziRbwly4uWMgoegbATGHuiooRktnC7TZ2J9+Xntnt TWqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pN54l5060qnSKve+RUs6hFoj4ulmEP357iz1qzBmy3Q=; b=INVhIISN1qRiGp9NJA3wWwkEDzV+I/Beya9LV6dn+zubdmbZAiuDdCSn+DKJHsCLe8 yYy4bBMCLi0Z219+vfNBnO7msdrslK6UeKbN47frVlaj2bm4qW7G3HUba1myywahoKWQ YeGgHfJ0QIkS1pgpSOoMAL9K6nNxf9/k4vN4Uox61D3Is25Pu4Y1aZcwuwp4vZ7PWhoc rjJ8CIBa/dfhKMb06qevGoKrVT83DRkuwrCwpg6FVnWnQNoP5cpaBAECHo44nQ6ios+/ DopUkCmuX4ZXB+xPHZGrFgC8y/rM7llB7I9fB5PRvF8B7bEFNdq3j1YE90P8UvMu2AiX hMyg== X-Gm-Message-State: AKwxytfCE6iRrSF3v4+VeyIV6iOeDjcZiccAYjABeZlHnFtJcCjV4DMw hh4/jmg7wpT8GVhLPzSbwac= X-Google-Smtp-Source: ACJfBotJWz9uGylSNjF1OQooNqSz3uhSe60PCP7RTT9z8+ODlrbiJJtAECq1McB9MH5hseUvrLiwwQ== X-Received: by 10.200.24.197 with SMTP id o5mr14272694qtk.79.1515379589858; Sun, 07 Jan 2018 18:46:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:35 -0300 Message-Id: <20180108024558.17983-7-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 06/29] hw/isa: add a generic isa_superio_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/isa/superio.h | 17 +++++++++++++++++ hw/isa/isa-superio.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 2 ++ hw/isa/Makefile.objs | 1 + 4 files changed, 65 insertions(+) create mode 100644 include/hw/isa/superio.h create mode 100644 hw/isa/isa-superio.c diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h new file mode 100644 index 0000000000..e685b96653 --- /dev/null +++ b/include/hw/isa/superio.h @@ -0,0 +1,17 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2018 Philippe Mathieu-Daud=C3=A9 + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_ISA_SUPERIO_H +#define HW_ISA_SUPERIO_H + +#include "hw/isa/isa.h" + +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count, + int parallel_count, int drive_count); + +#endif diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c new file mode 100644 index 0000000000..93d8457c6b --- /dev/null +++ b/hw/isa/isa-superio.c @@ -0,0 +1,45 @@ +/* + * Generic ISA Super I/O + * + * Copyright (c) 2018 Philippe Mathieu-Daud=C3=A9 + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "sysemu/blockdev.h" +#include "hw/isa/superio.h" +#include "hw/char/serial.h" +#include "hw/char/parallel.h" +#include "hw/block/fdc.h" +#include "hw/input/i8042.h" + +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count, + int parallel_count, int drive_count) +{ + serial_hds_isa_init(isa_bus, 0, serial_count); + + parallel_hds_isa_init(isa_bus, parallel_count); + + if (drive_count) { + DriveInfo **fd; + int i; + + if (drive_count > MAX_FD) { + warn_report("superio: ignoring %d floppy controllers", + drive_count - MAX_FD); + drive_count =3D MAX_FD; + } + fd =3D g_new(DriveInfo *, drive_count); + + for (i =3D 0; i < drive_count; i++) { + fd[i] =3D drive_get(IF_FLOPPY, 0, i); + } + fdctrl_init_isa(isa_bus, fd); + + g_free(fd); /* FIXME */ + } + + return isa_create_simple(isa_bus, TYPE_I8042); +} diff --git a/MAINTAINERS b/MAINTAINERS index 7f9e98a046..6f867da743 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -875,6 +875,7 @@ F: hw/input/pckbd.c F: hw/intc/apic* F: hw/intc/ioapic* F: hw/intc/i8259* +F: hw/isa/isa-superio.c F: hw/misc/debugexit.c F: hw/misc/pc-testdev.c F: hw/timer/hpet* @@ -885,6 +886,7 @@ F: include/hw/display/vga.h F: include/hw/char/parallel.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h +F: include/hw/isa/superio.h F: include/hw/input/i8042.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs index fb37c55cf2..cac655ba58 100644 --- a/hw/isa/Makefile.objs +++ b/hw/isa/Makefile.objs @@ -1,4 +1,5 @@ common-obj-$(CONFIG_ISA_BUS) +=3D isa-bus.o +common-obj-$(CONFIG_ISA_BUS) +=3D isa-superio.o common-obj-$(CONFIG_APM) +=3D apm.o common-obj-$(CONFIG_I82378) +=3D i82378.o common-obj-$(CONFIG_PC87312) +=3D pc87312.o --=20 2.15.1