From patchwork Sat Jan 6 15:37:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="GtSY+Yfi"; 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 3zDQpV4fM7z9s75 for ; Sun, 7 Jan 2018 02:45:06 +1100 (AEDT) Received: from localhost ([::1]:39769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqee-0003JV-Mv for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:45:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VM-7u for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqab-000117-Vd for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqab-0000w6-I6; Sat, 06 Jan 2018 10:40:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=bl7JbmIMkZySBNr2v4z+KATFUd4zI8kw13Ne16fkqvg=; b=GtSY+Yfi9Cb0CfMJsoolxeBwmhzx7B8zyZ0ZOlObKaOqaAVc8y13MM9F71ebx/pSSl45oif6mkfVuJRXYxBh8d0MxLuxjyTrAX7cKZZBr3IvBlfCN8AVR1rRuk/tmLRs7WaS48usmv2x/xqhbpOPX6M0icsGSrS8yz2wVu0fPVA=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaK-0003wc-GU; Sat, 06 Jan 2018 15:40:36 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:15 +0100 Message-Id: <20180106153730.30313-2-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 01/16] fdc: move object structures to header file 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: Kevin Wolf , John Snow , =?utf-8?q?Herv=C3=A9_Poussineau?= , "open list:Floppy" , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We are now able to embed floppy controllers in another object. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Acked-by: John Snow --- hw/block/fdc.c | 102 ------------------------------------------------ include/hw/block/fdc.h | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 102 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 7b7dd41296..c81e0313c8 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -60,15 +60,8 @@ #define TYPE_FLOPPY_BUS "floppy-bus" #define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS) -typedef struct FDCtrl FDCtrl; -typedef struct FDrive FDrive; static FDrive *get_drv(FDCtrl *fdctrl, int unit); -typedef struct FloppyBus { - BusState bus; - FDCtrl *fdc; -} FloppyBus; - static const TypeInfo floppy_bus_info = { .name = TYPE_FLOPPY_BUS, .parent = TYPE_BUS, @@ -178,36 +171,6 @@ static FDriveSize drive_size(FloppyDriveType drive) #define FD_SECTOR_SC 2 /* Sector size code */ #define FD_RESET_SENSEI_COUNT 4 /* Number of sense interrupts on RESET */ -/* Floppy disk drive emulation */ -typedef enum FDiskFlags { - FDISK_DBL_SIDES = 0x01, -} FDiskFlags; - -struct FDrive { - FDCtrl *fdctrl; - BlockBackend *blk; - BlockConf *conf; - /* Drive status */ - FloppyDriveType drive; /* CMOS drive type */ - uint8_t perpendicular; /* 2.88 MB access mode */ - /* Position */ - uint8_t head; - uint8_t track; - uint8_t sect; - /* Media */ - FloppyDriveType disk; /* Current disk type */ - FDiskFlags flags; - uint8_t last_sect; /* Nb sector per track */ - uint8_t max_track; /* Nb of tracks */ - uint16_t bps; /* Bytes per sector */ - uint8_t ro; /* Is read-only */ - uint8_t media_changed; /* Is media changed */ - uint8_t media_rate; /* Data rate of medium */ - - bool media_validated; /* Have we validated the media? */ -}; - - static FloppyDriveType get_fallback_drive_type(FDrive *drv); /* Hack: FD_SEEK is expected to work on empty drives. However, QEMU @@ -819,60 +782,6 @@ enum { #define FD_MULTI_TRACK(state) ((state) & FD_STATE_MULTI) #define FD_FORMAT_CMD(state) ((state) & FD_STATE_FORMAT) -struct FDCtrl { - MemoryRegion iomem; - qemu_irq irq; - /* Controller state */ - QEMUTimer *result_timer; - int dma_chann; - uint8_t phase; - IsaDma *dma; - /* Controller's identification */ - uint8_t version; - /* HW */ - uint8_t sra; - uint8_t srb; - uint8_t dor; - uint8_t dor_vmstate; /* only used as temp during vmstate */ - uint8_t tdr; - uint8_t dsr; - uint8_t msr; - uint8_t cur_drv; - uint8_t status0; - uint8_t status1; - uint8_t status2; - /* Command FIFO */ - uint8_t *fifo; - int32_t fifo_size; - uint32_t data_pos; - uint32_t data_len; - uint8_t data_state; - uint8_t data_dir; - uint8_t eot; /* last wanted sector */ - /* States kept only to be returned back */ - /* precompensation */ - uint8_t precomp_trk; - uint8_t config; - uint8_t lock; - /* Power down config (also with status regB access mode */ - uint8_t pwrd; - /* Floppy drives */ - FloppyBus bus; - uint8_t num_floppies; - FDrive drives[MAX_FD]; - struct { - BlockBackend *blk; - FloppyDriveType type; - } qdev_for_drives[MAX_FD]; - int reset_sensei; - uint32_t check_media_rate; - FloppyDriveType fallback; /* type=auto failure fallback */ - /* Timers state */ - uint8_t timer0; - uint8_t timer1; - PortioList portio_list; -}; - static FloppyDriveType get_fallback_drive_type(FDrive *drv) { return drv->fdctrl->fallback; @@ -891,17 +800,6 @@ typedef struct FDCtrlSysBus { #define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC) -typedef struct FDCtrlISABus { - ISADevice parent_obj; - - uint32_t iobase; - uint32_t irq; - uint32_t dma; - struct FDCtrl state; - int32_t bootindexA; - int32_t bootindexB; -} FDCtrlISABus; - static uint32_t fdctrl_read (void *opaque, uint32_t reg) { FDCtrl *fdctrl = opaque; diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index 1749dabf25..d076b2fc1a 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -2,12 +2,115 @@ #define HW_FDC_H #include "qemu-common.h" +#include "hw/block/block.h" +#include "hw/isa/isa.h" /* fdc.c */ #define MAX_FD 2 +typedef struct FDCtrl FDCtrl; + +/* Floppy disk drive emulation */ +typedef enum FDiskFlags { + FDISK_DBL_SIDES = 0x01, +} FDiskFlags; + +typedef struct FDrive { + FDCtrl *fdctrl; + BlockBackend *blk; + BlockConf *conf; + /* Drive status */ + FloppyDriveType drive; /* CMOS drive type */ + uint8_t perpendicular; /* 2.88 MB access mode */ + /* Position */ + uint8_t head; + uint8_t track; + uint8_t sect; + /* Media */ + FloppyDriveType disk; /* Current disk type */ + FDiskFlags flags; + uint8_t last_sect; /* Nb sector per track */ + uint8_t max_track; /* Nb of tracks */ + uint16_t bps; /* Bytes per sector */ + uint8_t ro; /* Is read-only */ + uint8_t media_changed; /* Is media changed */ + uint8_t media_rate; /* Data rate of medium */ + + bool media_validated; /* Have we validated the media? */ +} FDrive; + +typedef struct FloppyBus { + BusState bus; + FDCtrl *fdc; +} FloppyBus; + +struct FDCtrl { + MemoryRegion iomem; + qemu_irq irq; + /* Controller state */ + QEMUTimer *result_timer; + int dma_chann; + uint8_t phase; + IsaDma *dma; + /* Controller's identification */ + uint8_t version; + /* HW */ + uint8_t sra; + uint8_t srb; + uint8_t dor; + uint8_t dor_vmstate; /* only used as temp during vmstate */ + uint8_t tdr; + uint8_t dsr; + uint8_t msr; + uint8_t cur_drv; + uint8_t status0; + uint8_t status1; + uint8_t status2; + /* Command FIFO */ + uint8_t *fifo; + int32_t fifo_size; + uint32_t data_pos; + uint32_t data_len; + uint8_t data_state; + uint8_t data_dir; + uint8_t eot; /* last wanted sector */ + /* States kept only to be returned back */ + /* precompensation */ + uint8_t precomp_trk; + uint8_t config; + uint8_t lock; + /* Power down config (also with status regB access mode */ + uint8_t pwrd; + /* Floppy drives */ + FloppyBus bus; + uint8_t num_floppies; + FDrive drives[MAX_FD]; + struct { + BlockBackend *blk; + FloppyDriveType type; + } qdev_for_drives[MAX_FD]; + int reset_sensei; + uint32_t check_media_rate; + FloppyDriveType fallback; /* type=auto failure fallback */ + /* Timers state */ + uint8_t timer0; + uint8_t timer1; + PortioList portio_list; +}; + #define TYPE_ISA_FDC "isa-fdc" +typedef struct FDCtrlISABus { + ISADevice parent_obj; + + uint32_t iobase; + uint32_t irq; + uint32_t dma; + struct FDCtrl state; + int32_t bootindexA; + int32_t bootindexB; +} FDCtrlISABus; + ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds); void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, hwaddr mmio_base, DriveInfo **fds); From patchwork Sat Jan 6 15:37:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="fCXO1A6u"; 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 3zDQpT34Skz9s7G for ; Sun, 7 Jan 2018 02:45:05 +1100 (AEDT) Received: from localhost ([::1]:39767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqed-0003Ix-ET for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:45:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VS-N8 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqae-00014r-F2 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqae-0000yP-8J; Sat, 06 Jan 2018 10:40:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=fFUEIGffkVIgZZbsUqGDa+8piSBZWOjW5tJjjnPT3hg=; b=fCXO1A6u3Lt8rCjP8RJprt8fZCAJTBrqSI37ZwIZLY02ZVgf8VKW5OeB/TIBl5cUE7V4Ax+GD0kbp7B4J7cBo+f75P6lYWGXdI6LeeW5h8mHxmzJKX6DBBGMbMtDfbYg0eymOmnmTAkqXeGXNfpQkx4Zc/AHpfFfEoBGWu8GLjA=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaP-0003wc-1s; Sat, 06 Jan 2018 15:40:41 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:16 +0100 Message-Id: <20180106153730.30313-3-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 02/16] serial/parallel: move object structures to header file 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: "open list:PowerPC" , =?utf-8?q?Herv=C3=A9_Poussi?= =?utf-8?q?neau?= , Alexander Graf , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We are now able to embed serial/parallel ports in another object. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/char/parallel.c | 31 +----------------------------- hw/char/serial-isa.c | 13 +------------ hw/ppc/pnv.c | 2 +- include/hw/char/isa.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/char/serial.h | 1 - 5 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 include/hw/char/isa.h diff --git a/hw/char/parallel.c b/hw/char/parallel.c index f79dc76543..6b36d425ff 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -28,6 +28,7 @@ #include "chardev/char-parallel.h" #include "chardev/char-fe.h" #include "hw/isa/isa.h" +#include "hw/char/isa.h" #include "hw/i386/pc.h" #include "sysemu/sysemu.h" @@ -67,36 +68,6 @@ #define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE) -typedef struct ParallelState { - MemoryRegion iomem; - uint8_t dataw; - uint8_t datar; - uint8_t status; - uint8_t control; - qemu_irq irq; - int irq_pending; - CharBackend chr; - int hw_driver; - int epp_timeout; - uint32_t last_read_offset; /* For debugging */ - /* Memory-mapped interface */ - int it_shift; - PortioList portio_list; -} ParallelState; - -#define TYPE_ISA_PARALLEL "isa-parallel" -#define ISA_PARALLEL(obj) \ - OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL) - -typedef struct ISAParallelState { - ISADevice parent_obj; - - uint32_t index; - uint32_t iobase; - uint32_t isairq; - ParallelState state; -} ISAParallelState; - static void parallel_update_irq(ParallelState *s) { if (s->irq_pending) diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index d7c5cc11fe..2c6cf81790 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -26,18 +26,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/char/serial.h" -#include "hw/isa/isa.h" - -#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIAL) - -typedef struct ISASerialState { - ISADevice parent_obj; - - uint32_t index; - uint32_t iobase; - uint32_t isairq; - SerialState state; -} ISASerialState; +#include "hw/char/isa.h" static const int isa_serial_io[MAX_SERIAL_PORTS] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 94ffc8e137..bf518d92a2 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -41,7 +41,7 @@ #include "hw/ppc/pnv_xscom.h" #include "hw/isa/isa.h" -#include "hw/char/serial.h" +#include "hw/char/isa.h" #include "hw/timer/mc146818rtc.h" #include diff --git a/include/hw/char/isa.h b/include/hw/char/isa.h new file mode 100644 index 0000000000..39f7be41c5 --- /dev/null +++ b/include/hw/char/isa.h @@ -0,0 +1,50 @@ +#ifndef HW_CHAR_ISA_H +#define HW_CHAR_ISA_H + +#include "qemu-common.h" +#include "hw/char/serial.h" +#include "hw/isa/isa.h" + +typedef struct ParallelState { + MemoryRegion iomem; + uint8_t dataw; + uint8_t datar; + uint8_t status; + uint8_t control; + qemu_irq irq; + int irq_pending; + CharBackend chr; + int hw_driver; + int epp_timeout; + uint32_t last_read_offset; /* For debugging */ + /* Memory-mapped interface */ + int it_shift; + PortioList portio_list; +} ParallelState; + +typedef struct ISAParallelState { + ISADevice parent_obj; + + uint32_t index; + uint32_t iobase; + uint32_t isairq; + ParallelState state; +} ISAParallelState; + +#define TYPE_ISA_PARALLEL "isa-parallel" +#define ISA_PARALLEL(obj) \ + OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL) + +typedef struct ISASerialState { + ISADevice parent_obj; + + uint32_t index; + uint32_t iobase; + uint32_t isairq; + SerialState state; +} ISASerialState; + +#define TYPE_ISA_SERIAL "isa-serial" +#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIAL) + +#endif diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index c4daf11a14..ec7da3d7f6 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -95,7 +95,6 @@ SerialState *serial_mm_init(MemoryRegion *address_space, Chardev *chr, enum device_endian end); /* serial-isa.c */ -#define TYPE_ISA_SERIAL "isa-serial" void serial_hds_isa_init(ISABus *bus, int from, int to); #endif From patchwork Sat Jan 6 15:37:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="aN5h9ILT"; 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 3zDQkr53Wtz9s7g for ; Sun, 7 Jan 2018 02:41:55 +1100 (AEDT) Received: from localhost ([::1]:39755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqbX-0000YF-6N for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:41:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VV-Rv for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqae-00015f-RA for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqae-0000yZ-K3 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=LWnhDxb4BX1RHl0t7Y4lpFjDET5kANEh7mOpzsR5E9M=; b=aN5h9ILTmNnF3qTkZ0VMEu01d9Mi9k/IjJl9XnktHDp0S6rkhrCRxrAoE/c0GUMbGfsoO2th677U2YFwPs550Il61A9alVZScgZfi5tpiSYPDYG/WhkFVw/tFZ6gJFA3NjEVgNDV56jbqxL3NMS/tL/c3Utuzg4bgessVNqcSOs=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaQ-0003wc-WF; Sat, 06 Jan 2018 15:40:43 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:17 +0100 Message-Id: <20180106153730.30313-4-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 03/16] mc146818rtc: move structure to header file 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: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We are now able to embed a timer in another object. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/timer/mc146818rtc.c | 30 ------------------------------ include/hw/timer/mc146818rtc.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 35a05a64cc..3e8c0b7d33 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -62,36 +62,6 @@ #define RTC_CLOCK_RATE 32768 #define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768) -#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) - -typedef struct RTCState { - ISADevice parent_obj; - - MemoryRegion io; - uint8_t cmos_data[128]; - uint8_t cmos_index; - int32_t base_year; - uint64_t base_rtc; - uint64_t last_update; - int64_t offset; - qemu_irq irq; - int it_shift; - /* periodic timer */ - QEMUTimer *periodic_timer; - int64_t next_periodic_time; - /* update-ended timer */ - QEMUTimer *update_timer; - uint64_t next_alarm_time; - uint16_t irq_reinject_on_ack_count; - uint32_t irq_coalesced; - uint32_t period; - QEMUTimer *coalesced_timer; - Notifier clock_reset_notifier; - LostTickPolicy lost_tick_policy; - Notifier suspend_notifier; - QLIST_ENTRY(RTCState) link; -} RTCState; - static void rtc_set_time(RTCState *s); static void rtc_update_time(RTCState *s); static void rtc_set_cmos(RTCState *s, const struct tm *tm); diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h index fe6ed63f71..7385622604 100644 --- a/include/hw/timer/mc146818rtc.h +++ b/include/hw/timer/mc146818rtc.h @@ -5,6 +5,35 @@ #include "hw/timer/mc146818rtc_regs.h" #define TYPE_MC146818_RTC "mc146818rtc" +#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) + +typedef struct RTCState { + ISADevice parent_obj; + + MemoryRegion io; + uint8_t cmos_data[128]; + uint8_t cmos_index; + int32_t base_year; + uint64_t base_rtc; + uint64_t last_update; + int64_t offset; + qemu_irq irq; + int it_shift; + /* periodic timer */ + QEMUTimer *periodic_timer; + int64_t next_periodic_time; + /* update-ended timer */ + QEMUTimer *update_timer; + uint64_t next_alarm_time; + uint16_t irq_reinject_on_ack_count; + uint32_t irq_coalesced; + uint32_t period; + QEMUTimer *coalesced_timer; + Notifier clock_reset_notifier; + LostTickPolicy lost_tick_policy; + Notifier suspend_notifier; + QLIST_ENTRY(RTCState) link; +} RTCState; ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq); From patchwork Sat Jan 6 15:37:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="SBpKGQxi"; 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 3zDQpS6sgjz9s75 for ; Sun, 7 Jan 2018 02:45:04 +1100 (AEDT) Received: from localhost ([::1]:39768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqed-0003JF-1m for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:45:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqag-0000Vc-P2 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqaf-000188-Rg for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:58 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqaf-0000zK-IE for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=dd+EigXdzTVFwZAMJHUZOTt/yb/I5K5X2XS8LYj5/GQ=; b=SBpKGQxi+VSG0MlYowmcdwVGazOFzrcoma/Nu0c9ixtCp7KZSFBVDtjeQAqhtsHvU9WZ+6nnEJV1+8NzUbA/yhpCA65Cb48d+r2XT62Y5N7urmRRKibkJxDaGBMUfNTrVnDQQTrFyxcNWladK5JX3WAnbWaRB2LSPR0nh7/GyEc=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaS-0003wc-Br; Sat, 06 Jan 2018 15:40:44 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:18 +0100 Message-Id: <20180106153730.30313-5-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 04/16] mc146818rtc: always register rtc to rtc list X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We are not required anymore to use rtc_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/timer/mc146818rtc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 3e8c0b7d33..0d0cae3031 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -967,17 +967,16 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) OBJECT(s), "date", NULL); qdev_init_gpio_out(dev, &s->irq, 1); + QLIST_INSERT_HEAD(&rtc_devices, s, link); } ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) { DeviceState *dev; ISADevice *isadev; - RTCState *s; isadev = isa_create(bus, TYPE_MC146818_RTC); dev = DEVICE(isadev); - s = MC146818_RTC(isadev); qdev_prop_set_int32(dev, "base_year", base_year); qdev_init_nofail(dev); if (intercept_irq) { @@ -985,7 +984,6 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) } else { isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); } - QLIST_INSERT_HEAD(&rtc_devices, s, link); return isadev; } @@ -1016,8 +1014,6 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) dc->reset = rtc_resetdev; dc->vmsd = &vmstate_rtc; dc->props = mc146818rtc_properties; - /* Reason: needs to be wired up by rtc_init() */ - dc->user_creatable = false; } static void rtc_finalize(Object *obj) From patchwork Sat Jan 6 15:37:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="dogeprVN"; 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 3zDQtK0swCz9s75 for ; Sun, 7 Jan 2018 02:48:23 +1100 (AEDT) Received: from localhost ([::1]:39795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqhp-0005is-9B for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:48:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqah-0000Vp-1n for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqaf-00017w-Ok for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqaf-0000zn-IE for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=Q6Z11fMZfdtnSlpeeENWEmcA+5op2Xb9ciBPs1tlSHc=; b=dogeprVN83zYtTSKQoIw4CVxr0oBpPwiUWoqcmUEgr8zGOXbmpOGhCP9WCg6D8SEYFe4m/CaRxzGPCjZaJOPgUuasMiTncJqQjM1kavin7oskAxaeMwVaivKnlMaVpUSr/gs2GtDucpaRPfVUkz3SP3W6mai+KPvdD4Nrk+BC60=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaT-0003wc-P5; Sat, 06 Jan 2018 15:40:46 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:19 +0100 Message-Id: <20180106153730.30313-6-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 05/16] piix4: rename some variables in realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" PIIX4 structure is now 's' PCI device is now 'pci_dev' DeviceState is now 'dev' Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 6b8bc3faf0..7b231b704b 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -87,16 +87,17 @@ static const VMStateDescription vmstate_piix4 = { } }; -static void piix4_realize(PCIDevice *dev, Error **errp) +static void piix4_realize(PCIDevice *pci_dev, Error **errp) { - PIIX4State *d = PIIX4_PCI_DEVICE(dev); + DeviceState *dev = DEVICE(pci_dev); + PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); - if (!isa_bus_new(DEVICE(d), pci_address_space(dev), - pci_address_space_io(dev), errp)) { + if (!isa_bus_new(dev, pci_address_space(pci_dev), + pci_address_space_io(pci_dev), errp)) { return; } - piix4_dev = &d->dev; - qemu_register_reset(piix4_reset, d); + piix4_dev = pci_dev; + qemu_register_reset(piix4_reset, s); } int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) From patchwork Sat Jan 6 15:37:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="ukS3iQJf"; 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 3zDQkr4yCzz9s75 for ; Sun, 7 Jan 2018 02:41:55 +1100 (AEDT) Received: from localhost ([::1]:39754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqbW-0000X2-Ku for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:41:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VP-9O for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqae-00014L-4j for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqad-000132-UA for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=G4XKj6FvgcnvlPJ7jaqqeb2jjlY6I+npz01aLwC5WSw=; b=ukS3iQJfi/SESwbg6B7gZscBJHh9mNG8XIUlhRY24AtIDY2WXDaxvf+iIcjf99+s62jt44EQ3hs5gzNYmvTyCE5+P0VEnGjmWmY5XQAcTOSiFymA6OpemsXByz1zunafAKkuI0Aqt/vuiLNirdxsxd9cNsCKAQn39YyZyA+PGuI=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaV-0003wc-4V; Sat, 06 Jan 2018 15:40:47 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:20 +0100 Message-Id: <20180106153730.30313-7-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 06/16] piix4: add Reset Control Register X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The RCR I/O port (0xcf9) is used to generate a hard reset or a soft reset. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 7b231b704b..ce15370d4d 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -2,6 +2,7 @@ * QEMU PIIX4 PCI Bridge Emulation * * Copyright (c) 2006 Fabrice Bellard + * Copyright (c) 2018 Hervé Poussineau * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,6 +34,10 @@ PCIDevice *piix4_dev; typedef struct PIIX4State { PCIDevice dev; + + /* Reset Control Register */ + MemoryRegion rcr_mem; + uint8_t rcr; } PIIX4State; #define TYPE_PIIX4_PCI_DEVICE "PIIX4" @@ -87,6 +92,34 @@ static const VMStateDescription vmstate_piix4 = { } }; +static void piix4_rcr_write(void *opaque, hwaddr addr, uint64_t val, + unsigned int len) +{ + PIIX4State *s = opaque; + + if (val & 4) { + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + s->rcr = val & 2; /* keep System Reset type only */ +} + +static uint64_t piix4_rcr_read(void *opaque, hwaddr addr, unsigned int len) +{ + PIIX4State *s = opaque; + return s->rcr; +} + +static const MemoryRegionOps piix4_rcr_ops = { + .read = piix4_rcr_read, + .write = piix4_rcr_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .impl = { + .min_access_size = 1, + .max_access_size = 1, + }, +}; + static void piix4_realize(PCIDevice *pci_dev, Error **errp) { DeviceState *dev = DEVICE(pci_dev); @@ -96,6 +129,12 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) pci_address_space_io(pci_dev), errp)) { return; } + + memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, + "reset-control", 1); + memory_region_add_subregion_overlap(pci_address_space_io(pci_dev), 0xcf9, + &s->rcr_mem, 1); + piix4_dev = pci_dev; qemu_register_reset(piix4_reset, s); } From patchwork Sat Jan 6 15:37:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="MYRIW90d"; 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 3zDQpN6blnz9s75 for ; Sun, 7 Jan 2018 02:45:00 +1100 (AEDT) Received: from localhost ([::1]:39764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqeY-0003Gl-O4 for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:44:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VN-89 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqad-00013G-H9 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqad-00011x-7F for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=hL4hHIzKeqABMlwOwC8uzbtwwR0MmkOsAIXYrPD7OqQ=; b=MYRIW90dPzanpZEy57C/iAMFMhXQ/2Hx+tdNik3ynjympsz/QoYkFg0SZ9nVbsRTmxv8xk+RaS0/HqgPETz9l5WqZk1vcebZziqOsySagDB459KL+GLb1GUSKWKbVvqccpiXIOUoeV/jzpTnNoJRcTUaliPaCeGIOFDX7MSG0dM=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaW-0003wc-GN; Sat, 06 Jan 2018 15:40:48 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:21 +0100 Message-Id: <20180106153730.30313-8-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 07/16] piix4: add a i8259 interrupt controller as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add ISA irqs as piix4 gpio in, and CPU interrupt request as piix4 gpio out. Remove i8259 instanciated in malta board, to not have it twice. We can also remove the now unused piix4_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 40 +++++++++++++++++++++++++++++----------- hw/mips/mips_malta.c | 28 ++++++++++++---------------- include/hw/i386/pc.h | 1 - 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index ce15370d4d..d21a448db1 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -34,6 +34,8 @@ PCIDevice *piix4_dev; typedef struct PIIX4State { PCIDevice dev; + qemu_irq cpu_intr; + qemu_irq *isa; /* Reset Control Register */ MemoryRegion rcr_mem; @@ -92,6 +94,18 @@ static const VMStateDescription vmstate_piix4 = { } }; +static void piix4_request_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->cpu_intr, level); +} + +static void piix4_set_i8259_irq(void *opaque, int irq, int level) +{ + PIIX4State *s = opaque; + qemu_set_irq(s->isa[irq], level); +} + static void piix4_rcr_write(void *opaque, hwaddr addr, uint64_t val, unsigned int len) { @@ -124,28 +138,32 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) { DeviceState *dev = DEVICE(pci_dev); PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); + ISABus *isa_bus; + qemu_irq *i8259_out_irq; - if (!isa_bus_new(dev, pci_address_space(pci_dev), - pci_address_space_io(pci_dev), errp)) { + isa_bus = isa_bus_new(dev, pci_address_space(pci_dev), + pci_address_space_io(pci_dev), errp); + if (!isa_bus) { return; } + qdev_init_gpio_in_named(dev, piix4_set_i8259_irq, "isa", ISA_NUM_IRQS); + qdev_init_gpio_out_named(dev, &s->cpu_intr, "intr", 1); + memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, "reset-control", 1); memory_region_add_subregion_overlap(pci_address_space_io(pci_dev), 0xcf9, &s->rcr_mem, 1); - piix4_dev = pci_dev; - qemu_register_reset(piix4_reset, s); -} + /* initialize i8259 pic */ + i8259_out_irq = qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); + s->isa = i8259_init(isa_bus, *i8259_out_irq); -int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) -{ - PCIDevice *d; + /* initialize ISA irqs */ + isa_bus_irqs(isa_bus, s->isa); - d = pci_create_simple_multifunction(bus, devfn, true, "PIIX4"); - *isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(d), "isa.0")); - return d->devfn; + piix4_dev = pci_dev; + qemu_register_reset(piix4_reset, s); } static void piix4_class_init(ObjectClass *klass, void *data) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 37f19428d6..043fe40bce 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -96,7 +96,7 @@ typedef struct { SysBusDevice parent_obj; MIPSCPSState *cps; - qemu_irq *i8259; + qemu_irq i8259[16]; } MaltaState; static ISADevice *pit; @@ -998,8 +998,8 @@ void mips_malta_init(MachineState *machine) int64_t kernel_entry, bootloader_run_addr; PCIBus *pci_bus; ISABus *isa_bus; - qemu_irq *isa_irq; qemu_irq cbus_irq, i8259_irq; + PCIDevice *pci; int piix4_devfn; I2CBus *smbus; int i; @@ -1180,28 +1180,24 @@ void mips_malta_init(MachineState *machine) /* Board ID = 0x420 (Malta Board with CoreLV) */ stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420); - /* - * We have a circular dependency problem: pci_bus depends on isa_irq, - * isa_irq is provided by i8259, i8259 depends on ISA, ISA depends - * on piix4, and piix4 depends on pci_bus. To stop the cycle we have - * qemu_irq_proxy() adds an extra bit of indirection, allowing us - * to resolve the isa_irq -> i8259 dependency after i8259 is initialized. - */ - isa_irq = qemu_irq_proxy(&s->i8259, 16); - /* Northbridge */ - pci_bus = gt64120_register(isa_irq); + pci_bus = gt64120_register(s->i8259); /* Southbridge */ ide_drive_get(hd, ARRAY_SIZE(hd)); - piix4_devfn = piix4_init(pci_bus, &isa_bus, 80); + pci = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), + true, "PIIX4"); + dev = DEVICE(pci); + isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); + piix4_devfn = pci->devfn; /* Interrupt controller */ - /* The 8259 is attached to the MIPS CPU INT0 pin, ie interrupt 2 */ - s->i8259 = i8259_init(isa_bus, i8259_irq); + qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); + for (i = 0; i < 16; i++) { + s->i8259[i] = qdev_get_gpio_in_named(dev, "isa", i); + } - isa_bus_irqs(isa_bus, s->i8259); pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1); pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 6f77eb0665..3308ab4b93 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -300,7 +300,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCIBus *find_i440fx(void); /* piix4.c */ extern PCIDevice *piix4_dev; -int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn); /* pc_sysfw.c */ void pc_system_firmware_init(MemoryRegion *rom_memory, From patchwork Sat Jan 6 15:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="W2Wb9dZZ"; 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 3zDQkr4yFVz9s7G for ; Sun, 7 Jan 2018 02:41:55 +1100 (AEDT) Received: from localhost ([::1]:39757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqbZ-0000ZK-Tx for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:41:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqaf-0000VQ-9R for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqae-000157-HW for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqae-00013g-BO for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=RP+3srA/B5kww2gqy/x7vbaSLlMKp97twQFS8T4SU40=; b=W2Wb9dZZiX1NZ3aOgSl7fB6lot1wTDwGS+sPDD090Np5NGbWQ808pR0+C1XZIH2O/cRzUa42mxAmLwTlZqcwBvBztxE/GwxVaXZLzMxFoWqUPgsggxkKIPI6vCo8m4Rx3dl3kI5/32A/x2gbe7xp4dPNry5bE7LFpMj6sSDr3Xc=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaX-0003wc-TO; Sat, 06 Jan 2018 15:40:50 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:22 +0100 Message-Id: <20180106153730.30313-9-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 08/16] piix4: add a i8257 dma controller as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove i8257 instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 3 +++ hw/mips/mips_malta.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index d21a448db1..38757d3ea2 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -162,6 +162,9 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* initialize ISA irqs */ isa_bus_irqs(isa_bus, s->isa); + /* DMA */ + DMA_init(isa_bus, 0); + piix4_dev = pci_dev; qemu_register_reset(piix4_reset, s); } diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 043fe40bce..647688c58a 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1205,7 +1205,6 @@ 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); /* Super I/O */ isa_create_simple(isa_bus, "i8042"); From patchwork Sat Jan 6 15:37:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="FtRwrsIy"; 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 3zDQxN0GBnz9s0g for ; Sun, 7 Jan 2018 02:51:04 +1100 (AEDT) Received: from localhost ([::1]:39867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqkQ-0007vZ-2W for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:51:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqah-0000WU-8B for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqaf-00017r-Pm for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42454) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqaf-00015p-HM for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=9aJEXlfCxYBaAUtpUZ5XTZ7QjnJF6vdjqtpfusDAlO4=; b=FtRwrsIycao50Ybs5w+NtxIxEPGAyTiVG2+GCwOx0Z04I0icGlU8ppLrhciPGHMDJGz1eGfLbHl1Xm5J+B4zGw0h8Y9zGwC21ZeexmbwpW90e2b7kWNT6Y23ZicLj1m/6ZmzgQQqCkGkcfLWJ5CnAs/mqg74N0M5i58fIc7jchE=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaZ-0003wc-An; Sat, 06 Jan 2018 15:40:51 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:23 +0100 Message-Id: <20180106153730.30313-10-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 09/16] piix4: add a i8254 pit controller as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove i8254 instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 4 ++++ hw/mips/mips_malta.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 38757d3ea2..3f59750e5a 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #include "hw/isa/isa.h" #include "hw/sysbus.h" +#include "hw/timer/i8254.h" PCIDevice *piix4_dev; @@ -162,6 +163,9 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* initialize ISA irqs */ isa_bus_irqs(isa_bus, s->isa); + /* initialize pit */ + i8254_pit_init(isa_bus, 0x40, 0, NULL); + /* DMA */ DMA_init(isa_bus, 0); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 647688c58a..afe13c684f 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -99,8 +99,6 @@ typedef struct { qemu_irq i8259[16]; } MaltaState; -static ISADevice *pit; - static struct _loaderparams { int ram_size, ram_low_size; const char *kernel_filename; @@ -1204,7 +1202,6 @@ void mips_malta_init(MachineState *machine) 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); /* Super I/O */ isa_create_simple(isa_bus, "i8042"); From patchwork Sat Jan 6 15:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856408 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="TBbK0ohc"; 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 3zDQtK0vjWz9s7G for ; Sun, 7 Jan 2018 02:48:23 +1100 (AEDT) Received: from localhost ([::1]:39800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqhp-0005jY-S9 for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:48:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqai-0000YR-0E for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqah-0001Al-Aq for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:00 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqah-00019X-4E for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:40:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=Q/b8IUgkZzZJYmb+U0LZlsPS+xqW7zv/WpZ8Fr7/TSI=; b=TBbK0ohcIEhr+a7uEBsB22caByIz21//Am4f9YTSZ8Roo/eh4EopgLpL2eeADUlwKBpDnoU/1xKDpUrt0pQfjSq/OKCo5PJg0U+kZ3pnApTGGMOGM7LHX3dPtpBEOdaTu1K/MWnR5ILk1LaTw61vzeABTEK8+lx0Dz0olViHyNQ=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaa-0003wc-Pq; Sat, 06 Jan 2018 15:40:53 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:24 +0100 Message-Id: <20180106153730.30313-11-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 10/16] piix4: add a i8042 keyboard/mouse controller as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove i8042 instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 3 +++ hw/mips/mips_malta.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 3f59750e5a..1aab78cdd2 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -169,6 +169,9 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* DMA */ DMA_init(isa_bus, 0); + /* Super I/O */ + isa_create_simple(isa_bus, "i8042"); + piix4_dev = pci_dev; qemu_register_reset(piix4_reset, s); } diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index afe13c684f..7498fad006 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1204,8 +1204,6 @@ void mips_malta_init(MachineState *machine) g_free(smbus_eeprom_buf); /* Super I/O */ - isa_create_simple(isa_bus, "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 Sat Jan 6 15:37:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856412 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="BZjivXd7"; 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 3zDR0Z6nfhz9s75 for ; Sun, 7 Jan 2018 02:53:50 +1100 (AEDT) Received: from localhost ([::1]:39989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqn6-000231-Rt for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:53:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqak-0000bB-BA for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqaj-0001DV-2z for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:02 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42469) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqai-0001CY-Px for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=raCptP1HoV1odUyVfxKSqQyHSbylj/CRQ3QXFI7tAfM=; b=BZjivXd7GUs9hIYdCKo46Q2RjHYLNU1gZ+k7oX5ibC99y8ZrasmA74ps0v7qrs9VEKZq2Sl8rrKv64DFw93S/NSDsWKS/0SK3q4u8I7ZugHQwLS+vmfXHM2UHH6vXCe+T+LWXBGpjo0yjzjUJk62AE2qb+eX4awVhbgWBVw61qA=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqac-0003wc-7C; Sat, 06 Jan 2018 15:40:54 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:25 +0100 Message-Id: <20180106153730.30313-12-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 11/16] piix4: add a floppy controller, 1 parallel port and 2 serial ports 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: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove their instanciation from malta board, to not have them twice. Automatically create serial/parallel ports in PIIX4 if not provided. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/mips/mips_malta.c | 41 +++++++++++++++++--------------- 2 files changed, 89 insertions(+), 19 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 1aab78cdd2..7a13e83270 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -28,8 +28,10 @@ #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/isa/isa.h" +#include "hw/char/isa.h" #include "hw/sysbus.h" #include "hw/timer/i8254.h" +#include "qapi/error.h" PCIDevice *piix4_dev; @@ -38,6 +40,10 @@ typedef struct PIIX4State { qemu_irq cpu_intr; qemu_irq *isa; + FDCtrlISABus floppy; + ISASerialState serial[2]; + ISAParallelState parallel; + /* Reset Control Register */ MemoryRegion rcr_mem; uint8_t rcr; @@ -141,6 +147,8 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); ISABus *isa_bus; qemu_irq *i8259_out_irq; + int i; + Error *err = NULL; isa_bus = isa_bus_new(dev, pci_address_space(pci_dev), pci_address_space_io(pci_dev), errp); @@ -172,10 +180,68 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) /* Super I/O */ isa_create_simple(isa_bus, "i8042"); + /* floppy */ + qdev_set_parent_bus(DEVICE(&s->floppy), BUS(isa_bus)); + object_property_set_bool(OBJECT(&s->floppy), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + + /* serial ports */ + for (i = 0; i < 2; i++) { + qdev_set_parent_bus(DEVICE(&s->serial[i]), BUS(isa_bus)); + if (!qemu_chr_fe_backend_connected(&s->serial[i].state.chr)) { + char prop[] = "serial?"; + char label[] = "piix4.serial?"; + prop[6] = i + '0'; + label[12] = i + '0'; + qdev_prop_set_chr(dev, prop, qemu_chr_new(label, "null")); + } + object_property_set_bool(OBJECT(&s->serial[i]), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + } + + /* parallel port */ + qdev_set_parent_bus(DEVICE(&s->parallel), BUS(isa_bus)); + if (!qemu_chr_fe_backend_connected(&s->parallel.state.chr)) { + qdev_prop_set_chr(dev, "parallel", + qemu_chr_new("pii4x.parallel", "null")); + } + object_property_set_bool(OBJECT(&s->parallel), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + piix4_dev = pci_dev; qemu_register_reset(piix4_reset, s); } +static void piix4_init(Object *obj) +{ + PIIX4State *s = PIIX4_PCI_DEVICE(obj); + int i; + + object_initialize(&s->floppy, sizeof(s->floppy), TYPE_ISA_FDC); + for (i = 0; i < 2; i++) { + object_initialize(&s->serial[i], sizeof(s->serial[i]), TYPE_ISA_SERIAL); + } + object_initialize(&s->parallel, sizeof(s->parallel), TYPE_ISA_PARALLEL); + + object_property_add_alias(obj, "floppy", OBJECT(&s->floppy), "driveA", + &error_abort); + object_property_add_alias(obj, "serial0", OBJECT(&s->serial[0]), "chardev", + &error_abort); + object_property_add_alias(obj, "serial1", OBJECT(&s->serial[1]), "chardev", + &error_abort); + object_property_add_alias(obj, "parallel", OBJECT(&s->parallel), "chardev", + &error_abort); +} + static void piix4_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -199,6 +265,7 @@ static const TypeInfo piix4_info = { .name = TYPE_PIIX4_PCI_DEVICE, .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PIIX4State), + .instance_init = piix4_init, .class_init = piix4_class_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 7498fad006..30fb30fc0e 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1003,7 +1003,7 @@ void mips_malta_init(MachineState *machine) int i; DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; - DriveInfo *fd[MAX_FD]; + DriveInfo *fd; int fl_idx = 0; int fl_sectors = bios_size >> 16; int be; @@ -1018,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); @@ -1069,6 +1060,9 @@ void mips_malta_init(MachineState *machine) #endif /* FPGA */ /* The CBUS UART is attached to the MIPS CPU INT2 pin, ie interrupt 4 */ + if (!serial_hds[2]) { + serial_hds[2] = qemu_chr_new("serial2", "null"); + } malta_fpga_init(system_memory, FPGA_ADDRESS, cbus_irq, serial_hds[2]); /* Load firmware in flash / BIOS. */ @@ -1184,9 +1178,25 @@ void mips_malta_init(MachineState *machine) /* Southbridge */ ide_drive_get(hd, ARRAY_SIZE(hd)); - pci = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), - true, "PIIX4"); + pci = pci_create_multifunction(pci_bus, PCI_DEVFN(10, 0), + true, "PIIX4"); dev = DEVICE(pci); + + /* Floppy */ + fd = drive_get(IF_FLOPPY, 0, 0); + if (fd) { + qdev_prop_set_drive(dev, "floppy", blk_by_legacy_dinfo(fd), + &error_fatal); + } + + /* Serial ports */ + qdev_prop_set_chr(dev, "serial0", serial_hds[0]); + qdev_prop_set_chr(dev, "serial1", serial_hds[1]); + + /* Parallel port */ + qdev_prop_set_chr(dev, "parallel", parallel_hds[0]); + + qdev_init_nofail(dev); isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); piix4_devfn = pci->devfn; @@ -1205,13 +1215,6 @@ void mips_malta_init(MachineState *machine) /* Super I/O */ mc146818_rtc_init(isa_bus, 2000, NULL); - 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); /* Network card */ network_init(pci_bus); From patchwork Sat Jan 6 15:37:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="KOmqCsn3"; 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 3zDQxh5HPqz9s4q for ; Sun, 7 Jan 2018 02:51:20 +1100 (AEDT) Received: from localhost ([::1]:39868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqkg-0008BG-R4 for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:51:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqao-0000dl-KF for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqal-0001HX-Br for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:06 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqal-0001Fy-5E for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=SiUxbybdF2eJ8S6/AcbX9utMbdZjIWhocfyVTU2hTs0=; b=KOmqCsn3fRavUQUlzrkoD1eVRLbD/4AqqQxzT+TdmZBXvpRd8ycjfVEZ/SKfDDlBfPxjkUyGBG1wzT0Wqg+P+30cetuk+IqoCljBDwIJ+AemZTG8dLCoE5OpY9q9f4gxjE8QO2wtAyiKdCPFsnbVCxkFrBOvAF/nMa+mgew8z6g=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqad-0003wc-KL; Sat, 06 Jan 2018 15:40:55 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:26 +0100 Message-Id: <20180106153730.30313-13-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 12/16] piix4: add a mc146818rtc controller as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove mc146818rtc instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 12 ++++++++++++ hw/mips/mips_malta.c | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 7a13e83270..0d68fcb193 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -31,6 +31,7 @@ #include "hw/char/isa.h" #include "hw/sysbus.h" #include "hw/timer/i8254.h" +#include "hw/timer/mc146818rtc.h" #include "qapi/error.h" PCIDevice *piix4_dev; @@ -43,6 +44,7 @@ typedef struct PIIX4State { FDCtrlISABus floppy; ISASerialState serial[2]; ISAParallelState parallel; + RTCState rtc; /* Reset Control Register */ MemoryRegion rcr_mem; @@ -217,6 +219,15 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) return; } + /* timer */ + qdev_set_parent_bus(DEVICE(&s->rtc), BUS(isa_bus)); + object_property_set_bool(OBJECT(&s->rtc), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, RTC_ISA_IRQ); + piix4_dev = pci_dev; qemu_register_reset(piix4_reset, s); } @@ -231,6 +242,7 @@ static void piix4_init(Object *obj) object_initialize(&s->serial[i], sizeof(s->serial[i]), TYPE_ISA_SERIAL); } object_initialize(&s->parallel, sizeof(s->parallel), TYPE_ISA_PARALLEL); + object_initialize(&s->rtc, sizeof(s->rtc), TYPE_MC146818_RTC); object_property_add_alias(obj, "floppy", OBJECT(&s->floppy), "driveA", &error_abort); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 30fb30fc0e..3d304a6e0a 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -995,7 +995,6 @@ void mips_malta_init(MachineState *machine) uint8_t *smbus_eeprom_buf = g_malloc0(smbus_eeprom_size); int64_t kernel_entry, bootloader_run_addr; PCIBus *pci_bus; - ISABus *isa_bus; qemu_irq cbus_irq, i8259_irq; PCIDevice *pci; int piix4_devfn; @@ -1197,7 +1196,6 @@ void mips_malta_init(MachineState *machine) qdev_prop_set_chr(dev, "parallel", parallel_hds[0]); qdev_init_nofail(dev); - isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); piix4_devfn = pci->devfn; /* Interrupt controller */ @@ -1213,9 +1211,6 @@ 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 */ - mc146818_rtc_init(isa_bus, 2000, NULL); - /* Network card */ network_init(pci_bus); From patchwork Sat Jan 6 15:37:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="oO83l3c8"; 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 3zDR3D2YWSz9s75 for ; Sun, 7 Jan 2018 02:56:08 +1100 (AEDT) Received: from localhost ([::1]:40027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqpK-0004WA-Fz for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:56:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqao-0000dm-KI for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqal-0001IG-Mj for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:06 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqal-0001GX-EZ for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=n1/JpaYP0S9lsKOcePXn3DQQv9vL4ryn2vDDeXbCeyg=; b=oO83l3c8f1K6yeIJKqxvOtdxhTs8FOZm6XlBhfcH7EPaJ5pW00V74BDHnfq4dvNac1A1L4EFg6itawlzl51w4TFr3TX3fpWXGJmnewbCmBYrsAUl+41l7oPifWVFCNlEaMbrGJpicglbgc7X77Icxg/zJGwymYUIXsdEIUuo7/o=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqaf-0003wc-0i; Sat, 06 Jan 2018 15:40:57 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:27 +0100 Message-Id: <20180106153730.30313-14-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 13/16] piix4: add a speaker as specified in datasheet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 0d68fcb193..b313e4fe73 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -30,6 +30,7 @@ #include "hw/isa/isa.h" #include "hw/char/isa.h" #include "hw/sysbus.h" +#include "hw/audio/pcspk.h" #include "hw/timer/i8254.h" #include "hw/timer/mc146818rtc.h" #include "qapi/error.h" @@ -148,6 +149,7 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) DeviceState *dev = DEVICE(pci_dev); PIIX4State *s = DO_UPCAST(PIIX4State, dev, pci_dev); ISABus *isa_bus; + ISADevice *pit; qemu_irq *i8259_out_irq; int i; Error *err = NULL; @@ -174,7 +176,10 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) isa_bus_irqs(isa_bus, s->isa); /* initialize pit */ - i8254_pit_init(isa_bus, 0x40, 0, NULL); + pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); + + /* speaker */ + pcspk_init(isa_bus, pit); /* DMA */ DMA_init(isa_bus, 0); From patchwork Sat Jan 6 15:37:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="owhB+/8S"; 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 3zDR0j37mhz9s75 for ; Sun, 7 Jan 2018 02:53:57 +1100 (AEDT) Received: from localhost ([::1]:39991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqnD-0002AO-Bn for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:53:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqap-0000f6-Fz for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqao-0001MX-OY for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:07 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42502) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqao-0001K1-9h for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=sdFSJJCJUGKbPAHruFgNLVYSxMNP+ZZLQ8Qba9oZvSY=; b=owhB+/8SQ5m0f+AtMbSqLKsTmrxEHKWKNyMvJZy3JNha6eWrgou9w1cQyCFPxbD4xWVdcvSkw+3QTfgCdI6oZcnFRsgBehCvowbXlIG2zbrZ187kg0DS1geiBLYEZ/I9vej3KZpmP1NCYnJw9tEGZwgqwJ3aXkPn5dBnB521x4Y=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqag-0003wc-Iq; Sat, 06 Jan 2018 15:40:58 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:28 +0100 Message-Id: <20180106153730.30313-15-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 14/16] piix4: convert reset function to QOM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index b313e4fe73..159a27d2d9 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -56,10 +56,10 @@ typedef struct PIIX4State { #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) -static void piix4_reset(void *opaque) +static void piix4_reset(DeviceState *dev) { - PIIX4State *d = opaque; - uint8_t *pci_conf = d->dev.config; + PIIX4State *s = PIIX4_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; pci_conf[0x04] = 0x07; // master, memory and I/O pci_conf[0x05] = 0x00; @@ -234,7 +234,6 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, RTC_ISA_IRQ); piix4_dev = pci_dev; - qemu_register_reset(piix4_reset, s); } static void piix4_init(Object *obj) @@ -268,6 +267,7 @@ static void piix4_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; k->class_id = PCI_CLASS_BRIDGE_ISA; + dc->reset = piix4_reset; dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix4; /* From patchwork Sat Jan 6 15:37:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="P7VmauDF"; 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 3zDR3K0SYWz9s75 for ; Sun, 7 Jan 2018 02:56:13 +1100 (AEDT) Received: from localhost ([::1]:40040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqpP-0004am-5R for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:56:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqar-0000hq-LT for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqaq-0001RS-LP for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:09 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqaq-0001Pc-Eh for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=hR4cT50YhWKOnlae7dLiNSW7LfnuiRajxmYgHlUuLgE=; b=P7VmauDFZkaL58wuCl1TUH9AYTdJ+fL4R+s84/mMY32oMjU7V1ZdEYIjIQFWYZnZnp5c3P3mo77dBQ2De1+p3t3/2wCWnTqHGZ10PMx3KsNbAW7fUJdnuR2LkSkIFV6K6noqrVFCv2ubogluR8JB0Uw2Uq1EJLS7+mHtCDVdpx0=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqah-0003wc-UO; Sat, 06 Jan 2018 15:41:00 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:29 +0100 Message-Id: <20180106153730.30313-16-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 15/16] piix4: rename PIIX4 object to piix4-isa 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: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Other piix4 parts are already named piix4-ide and piix4-usb-uhci. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 1 - hw/mips/mips_malta.c | 2 +- include/hw/isa/isa.h | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 159a27d2d9..1447d41934 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -52,7 +52,6 @@ typedef struct PIIX4State { uint8_t rcr; } PIIX4State; -#define TYPE_PIIX4_PCI_DEVICE "PIIX4" #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 3d304a6e0a..93ec013ea2 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1178,7 +1178,7 @@ void mips_malta_init(MachineState *machine) ide_drive_get(hd, ARRAY_SIZE(hd)); pci = pci_create_multifunction(pci_bus, PCI_DEVFN(10, 0), - true, "PIIX4"); + true, TYPE_PIIX4_PCI_DEVICE); dev = DEVICE(pci); /* Floppy */ diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 95593408ef..1f47692447 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -153,4 +153,7 @@ static inline ISABus *isa_bus_from_device(ISADevice *d) /* i8257.c */ void DMA_init(ISABus *bus, int high_page_enable); + +#define TYPE_PIIX4_PCI_DEVICE "piix4-isa" + #endif From patchwork Sat Jan 6 15:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 856409 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=reactos.org header.i=@reactos.org header.b="WBOZKM8S"; 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 3zDQvc0Sxyz9s7G for ; Sun, 7 Jan 2018 02:49:32 +1100 (AEDT) Received: from localhost ([::1]:39835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqiw-0006aB-4C for incoming@patchwork.ozlabs.org; Sat, 06 Jan 2018 10:49:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqau-0000kg-B1 for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqat-0001Yy-Gu for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:12 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqat-0001Wn-9l for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=keEA5r1SlZKPeFx+b9agW7O+dPdazYrSHU2Xzbc/zSQ=; b=WBOZKM8Szs85vkemNg6YqidAMxbtHigoxX6z8yZZO3XxfFFPOvWxcxzu7iI/bW2JJuBx/oLlL5aFLcNeUX8zpzHdlzSwmoZnhFXBvbKRLnuGNNKqDlzvtWCteBr+5wHkRNi93WUrJwAuxkQrN5hsehcAspOz45htSIVDypNnVfQ=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqal-0003wc-DR; Sat, 06 Jan 2018 15:41:03 +0000 From: =?utf-8?q?Herv=C3=A9_Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:30 +0100 Message-Id: <20180106153730.30313-17-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 16/16] piix4: we can now instanciate a PIIX4 with -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: =?utf-8?q?Herv=C3=A9_Poussineau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Note that the PIC master can't be connected to CPU using the command line, but it's not necessary to have a working ISA bus (for I/O, memory and DMA). Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 1447d41934..f8e43636ab 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -269,12 +269,6 @@ static void piix4_class_init(ObjectClass *klass, void *data) dc->reset = piix4_reset; dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix4; - /* - * Reason: part of PIIX4 southbridge, needs to be wired up, - * e.g. by mips_malta_init() - */ - dc->user_creatable = false; - dc->hotpluggable = false; } static const TypeInfo piix4_info = {