From patchwork Sat Dec 16 09:02:25 2017 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: 10116867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85FAE603B5 for ; Sat, 16 Dec 2017 09:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B5CD292B6 for ; Sat, 16 Dec 2017 09:07:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 703C1292C5; Sat, 16 Dec 2017 09:07:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17FDC292B6 for ; Sat, 16 Dec 2017 09:07:29 +0000 (UTC) Received: from localhost ([::1]:49875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQ8RM-0008Pr-8F for patchwork-qemu-devel@patchwork.kernel.org; Sat, 16 Dec 2017 04:07:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQ8N1-0004j5-Io for qemu-devel@nongnu.org; Sat, 16 Dec 2017 04:03:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQ8N0-00025i-Mf for qemu-devel@nongnu.org; Sat, 16 Dec 2017 04:02:59 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:58847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQ8N0-00024k-CB for qemu-devel@nongnu.org; Sat, 16 Dec 2017 04:02:58 -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=pum7JD9MJi5bZrkroC/M1EwFLGNaIspMKBN+RYcqaIc=; b=K824LSabPQMdBaCWxOU+wy+qP7CCRcuGaj5x0Y1o4UzORynfpXbgApSkHuXu2+Fj/3a4It+KrdiT4p30/dRXLgsqXJtrJZRVSuRhQCQRuyVK61ER6//InTtc7uuLFfBkY6vMS1Se12QyaeZx8WUe626XJPejQ/QlXYS0uCmByHE=; Received: from [2a01:e34:ee6b:9c80:6267:20ff:fe65:a488] (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 1eQ8Mr-0001v2-Se; Sat, 16 Dec 2017 09:02:50 +0000 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 16 Dec 2017 10:02:25 +0100 Message-Id: <20171216090228.28505-13-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171216090228.28505-1-hpoussin@reactos.org> References: <20171216090228.28505-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 12/15] 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=20Poussineau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove mc146818rtc instanciated in malta board, to not have it twice. Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 12 ++++++++++++ hw/mips/mips_malta.c | 4 ---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index bc13169a00..82890f0712 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; @@ -202,6 +204,15 @@ static void piix4_realize(PCIDevice *pci, 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; qemu_register_reset(piix4_reset, s); } @@ -216,6 +227,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 d3db2b503e..c0ee2ad0cd 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; @@ -1206,7 +1205,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 */ @@ -1222,8 +1220,6 @@ void mips_malta_init(MachineState *machine) smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); g_free(smbus_eeprom_buf); - rtc_init(isa_bus, 2000, NULL); - /* Network card */ network_init(pci_bus);