From patchwork Sun Nov 3 07:55:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11224301 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A56ED1747 for ; Sun, 3 Nov 2019 07:56:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69D8620848 for ; Sun, 3 Nov 2019 07:56:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="VUZBYAlA"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="tGX3zcoG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69D8620848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAko-0001No-0F for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Nov 2019 02:56:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36473) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAjU-00084t-G1 for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRAjR-0003pV-VW for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:32 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:41689) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRAjN-0003mw-E5; Sun, 03 Nov 2019 02:55:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1572767725; x=1604303725; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=o6hQdj7L0oPmZjyIXqAxLqekcwOscWKaimmvFu/uyI0=; b=VUZBYAlApl9/qFziXm1ZcBoBpi7AUXAkhS3vIQMSj1lbNRzWfsoZ1DP9 wUB9ffckp7oNdBHzRk+vsacOuN4uDwwsGheG368tptaJX2ovaAaseVENg YsC3sguikLEngiTaLrVWt/kYEqOmeqsH6/rLLjfnVOsxlp7AJwZTqJtRv ys4O4WIGE+jX3IhfBJsgRQTxJFKgAKPOw9ptXe6CY2q1qaMDPemMQ3zc/ Baw/cvpzUu7WfgYUqh7ANJl05BMTlEyyvjW+9ZyjDsGfC2RHsFJGxejh/ 7IxAouqRg3JLVr2w7MUkZH+NzClibg2wO5lLFNDFyk68QjBtQWJb2iNDM g==; IronPort-SDR: HuseZSUvA4CThqoZzUGOXkW3sIhsHu7nbzI9KJ19a5t/ucuYxW3OnQShW4b6Q2Xff/rkL7yxPQ gHo/zrdl/RDNp2yQTLEKIl28oKTppl+Or/osB/WWxZ0OZcVawt582HipqeVGci7Lyza+/u6zwy NOxDSzQ74Jg0sZnLeGfMCslfYhKL2NKvx58WY3exImNdmrBrdK5TdGuZBhjTJZlzs0Su1V27FC 4dK2RLGRssSraFomEAnq0w9iwFxYSODTeB5Yp5knoSxhQxPSeoG1grJsR+eDvQv9gJylVQllP2 TvY= X-IronPort-AV: E=Sophos;i="5.68,262,1569254400"; d="scan'208";a="229199000" Received: from mail-dm3nam03lp2053.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([104.47.41.53]) by ob1.hgst.iphmx.com with ESMTP; 03 Nov 2019 15:55:24 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DcNEy32o/jPUHSXhGDXpUWbPSIIDJl0HejVmxajGHRZk4BR/JPcc+1hK5O+35teWMPWIJnUhDI6DSRCOlKpBYxJPGb5Gdu8KSRh67D6xFU4ygeedZkW9CLKTRGk63cr9OML+MDWxu9gVLIMtPjcIISiuOB/V4K3sTHCeGqzl76EDnKlok0+QBItCUxSLC1mlpijhcSiTvaMyV+3uaTb0sGmaKbnWlydD8BL4Bbdh5Ye7mbzprz4t+2pQbGK77Hy7JmamPFwKsxCgrE7XmDwWBduLi8+SykwThpkNwctkFPK9fm6ISLg8cWdbSJMqbwY4EFQUgNtuzhhkXKiAk59LJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E9qz/XnZ5x4KwvGwF1lN+CC+AZFDxgrFU65QSwbuSO4=; b=Ue8qD2zIPOrmcRYIylY5Lcv9C1NyVuTM0lrXZypHfbgzcppApo5edfq4m6sYJAS4KnO7D9xZdsXJVnrmTRwA/svO085dZSf9DCQkGEKlxQhRsg9pgn3cl5YloHuUdnkJ8Bwikro6u1sB0W6ZfpDIirMOL32LA7d1LDohSp47VePI3wYDJhcWooqiXNW/bCLosiB0oftQKnqjtMkyyCG7kHQcrziho92NRPFMwVCGaKdJJ00KCPb6X/TgRVTLO+u7k2LmnA6vDkan3qhCKmmLcWY66cf7uuwKNbzvOyRXqQ+py6idGs+XSJ9pI8yDwbVjXKAdBX12959dlZOUagcCyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E9qz/XnZ5x4KwvGwF1lN+CC+AZFDxgrFU65QSwbuSO4=; b=tGX3zcoGVjUV/PxOH+msTVB9JtAf6BDhZ0uH2ADCoh18PEk0symZbCSVxo3IvxXg2JbocjIWgYGRN3eDsAnVI+BrcpNyJ5/wT09XyBYDpXiS7Ay/95HHu1x6pxluOkI0t22OM+M0E3K/7oIe2wU2C4OGKJDay0E3A1M7ZcCfl6M= Received: from DM6PR04MB6059.namprd04.prod.outlook.com (20.178.226.89) by DM6PR04MB4635.namprd04.prod.outlook.com (20.176.106.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Sun, 3 Nov 2019 07:55:23 +0000 Received: from DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70]) by DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70%6]) with mapi id 15.20.2408.024; Sun, 3 Nov 2019 07:55:23 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v6 1/3] hw: rtc: Add Goldfish RTC device Thread-Topic: [PATCH v6 1/3] hw: rtc: Add Goldfish RTC device Thread-Index: AQHVkhwL02B5pSK/0UiGl9Z4PAWbsg== Date: Sun, 3 Nov 2019 07:55:23 +0000 Message-ID: <20191103075353.86497-2-anup.patel@wdc.com> References: <20191103075353.86497-1-anup.patel@wdc.com> In-Reply-To: <20191103075353.86497-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::20) To DM6PR04MB6059.namprd04.prod.outlook.com (2603:10b6:5:129::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [106.51.18.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d0fdee6f-f36d-4f49-aef6-08d760332e14 x-ms-traffictypediagnostic: DM6PR04MB4635: x-ms-exchange-purlcount: 2 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:257; x-forefront-prvs: 0210479ED8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(376002)(396003)(366004)(136003)(346002)(189003)(199004)(71200400001)(55236004)(4326008)(305945005)(66556008)(71190400001)(6116002)(76176011)(3846002)(14454004)(102836004)(36756003)(256004)(476003)(110136005)(14444005)(8936002)(7736002)(99286004)(54906003)(81166006)(386003)(316002)(2616005)(11346002)(966005)(6306002)(25786009)(26005)(6436002)(50226002)(66066001)(6506007)(1076003)(66476007)(478600001)(2171002)(81156014)(8676002)(9456002)(5660300002)(6512007)(64756008)(446003)(52116002)(486006)(6486002)(66946007)(44832011)(2906002)(186003)(66446008)(30864003)(86362001)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR04MB4635; H:DM6PR04MB6059.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z1tm5OdgDq2QNOHVc0O8/O7t6RlxZQuqluBSrcO9AFmDL+pp4eKRM+Oqjiv+Jru7cGB6o1I6ts9cEihMJYZpbXdKCLDUgjznTABm0aTYweNWr4+x8bQ5niMlmMRpLfAF+1hEuVw3wEbw9KK1FcYb3fqbkYmOG3Gbk+vAaYcJx/E7poS3ucYO7juZU4gmwkLfq0BUvv8y74WqS10eZbExCQwuJODcc4pJ2mQDJ4Bz+R8kiZFzl8f4Ln6LadqEl24RqXi3G7/rWiS2UF2Sw7feLWfPDb4EwayKH8DlqcLCilN7R9MFNOgQzv614ZMbcIoIGyddULkHD1N6YXxH2VArc59EkNt4Jmeff7YY2M8lu2W0r3fvcAke7KrtmPUtmYg+tyBZcnvqxYdw536OLsTVd7idUolXDLGh+w7tuVz2TWoAgENhpWxzvSQ07ECHB/+5kP+m3QhJv4d8jqJJO+FhlGEQpvFw5fEsDuTwN9cuYv8= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0fdee6f-f36d-4f49-aef6-08d760332e14 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2019 07:55:23.3348 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tHOizB52pkcRgUpAaIW68RaJGcq4FU1g7zCwwZdqAeIyiFkisfFh0qAdbpitraTZS/5f6JvCMZYTYTlGCNbaHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB4635 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 68.232.141.245 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , "qemu-riscv@nongnu.org" , "qemu-devel@nongnu.org" , Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch adds model for Google Goldfish virtual platform RTC device. We will be adding Goldfish RTC device to the QEMU RISC-V virt machine for providing real date-time to Guest Linux. The corresponding Linux driver for Goldfish RTC device is already available in upstream Linux. For now, VM migration support is available but untested for Goldfish RTC device. It will be hardened in-future when we implement VM migration for KVM RISC-V. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis --- hw/rtc/Kconfig | 3 + hw/rtc/Makefile.objs | 1 + hw/rtc/goldfish_rtc.c | 288 ++++++++++++++++++++++++++++++++++ hw/rtc/trace-events | 4 + include/hw/rtc/goldfish_rtc.h | 46 ++++++ 5 files changed, 342 insertions(+) create mode 100644 hw/rtc/goldfish_rtc.c create mode 100644 include/hw/rtc/goldfish_rtc.h diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig index 45daa8d655..bafe6ac2c9 100644 --- a/hw/rtc/Kconfig +++ b/hw/rtc/Kconfig @@ -21,3 +21,6 @@ config MC146818RTC config SUN4V_RTC bool + +config GOLDFISH_RTC + bool diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs index 8dc9fcd3a9..aa208d0d10 100644 --- a/hw/rtc/Makefile.objs +++ b/hw/rtc/Makefile.objs @@ -11,3 +11,4 @@ common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o obj-$(CONFIG_MC146818RTC) += mc146818rtc.o common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o common-obj-$(CONFIG_ASPEED_SOC) += aspeed_rtc.o +common-obj-$(CONFIG_GOLDFISH_RTC) += goldfish_rtc.o diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c new file mode 100644 index 0000000000..f71f6eaab0 --- /dev/null +++ b/hw/rtc/goldfish_rtc.c @@ -0,0 +1,288 @@ +/* + * Goldfish virtual platform RTC + * + * Copyright (C) 2019 Western Digital Corporation or its affiliates. + * + * For more details on Google Goldfish virtual platform refer: + * https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "hw/rtc/goldfish_rtc.h" +#include "migration/vmstate.h" +#include "hw/irq.h" +#include "hw/qdev-properties.h" +#include "hw/sysbus.h" +#include "qemu/timer.h" +#include "sysemu/sysemu.h" +#include "qemu/cutils.h" +#include "qemu/log.h" + +#include "trace.h" + +#define RTC_TIME_LOW 0x00 +#define RTC_TIME_HIGH 0x04 +#define RTC_ALARM_LOW 0x08 +#define RTC_ALARM_HIGH 0x0c +#define RTC_IRQ_ENABLED 0x10 +#define RTC_CLEAR_ALARM 0x14 +#define RTC_ALARM_STATUS 0x18 +#define RTC_CLEAR_INTERRUPT 0x1c + +static void goldfish_rtc_update(GoldfishRTCState *s) +{ + qemu_set_irq(s->irq, (s->irq_pending & s->irq_enabled) ? 1 : 0); +} + +static void goldfish_rtc_interrupt(void *opaque) +{ + GoldfishRTCState *s = (GoldfishRTCState *)opaque; + + s->alarm_running = 0; + s->irq_pending = 1; + goldfish_rtc_update(s); +} + +static uint64_t goldfish_rtc_get_count(GoldfishRTCState *s) +{ + return s->tick_offset + (uint64_t)qemu_clock_get_ns(rtc_clock); +} + +static void goldfish_rtc_clear_alarm(GoldfishRTCState *s) +{ + timer_del(s->timer); + s->alarm_running = 0; +} + +static void goldfish_rtc_set_alarm(GoldfishRTCState *s) +{ + uint64_t ticks = goldfish_rtc_get_count(s); + uint64_t event = s->alarm_next; + + if (event <= ticks) { + goldfish_rtc_clear_alarm(s); + goldfish_rtc_interrupt(s); + } else { + /* + * We should be setting timer expiry to: + * qemu_clock_get_ns(rtc_clock) + (event - ticks) + * but this is equivalent to: + * event - s->tick_offset + */ + timer_mod(s->timer, event - s->tick_offset); + s->alarm_running = 1; + } +} + +static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset, + unsigned size) +{ + GoldfishRTCState *s = opaque; + uint64_t r = 0; + + switch (offset) { + case RTC_TIME_LOW: + r = goldfish_rtc_get_count(s) & 0xffffffff; + break; + case RTC_TIME_HIGH: + r = goldfish_rtc_get_count(s) >> 32; + break; + case RTC_ALARM_LOW: + r = s->alarm_next & 0xffffffff; + break; + case RTC_ALARM_HIGH: + r = s->alarm_next >> 32; + break; + case RTC_IRQ_ENABLED: + r = s->irq_enabled; + break; + case RTC_ALARM_STATUS: + r = s->alarm_running; + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad offset 0x%x\n", __func__, (uint32_t)offset); + break; + } + + trace_goldfish_rtc_read(offset, r); + + return r; +} + +static void goldfish_rtc_write(void *opaque, hwaddr offset, + uint64_t value, unsigned size) +{ + GoldfishRTCState *s = opaque; + uint64_t current_tick, new_tick; + + switch (offset) { + case RTC_TIME_LOW: + current_tick = goldfish_rtc_get_count(s); + new_tick = current_tick & (0xffffffffULL << 32); + new_tick |= value; + s->tick_offset += new_tick - current_tick; + break; + case RTC_TIME_HIGH: + current_tick = goldfish_rtc_get_count(s); + new_tick = current_tick & 0xffffffffULL; + new_tick |= (value << 32); + s->tick_offset += new_tick - current_tick; + break; + case RTC_ALARM_LOW: + s->alarm_next &= (0xffffffffULL << 32); + s->alarm_next |= value; + goldfish_rtc_set_alarm(s); + break; + case RTC_ALARM_HIGH: + s->alarm_next &= 0xffffffffULL; + s->alarm_next |= (value << 32); + break; + case RTC_IRQ_ENABLED: + s->irq_enabled = (uint32_t)(value & 0x1); + goldfish_rtc_update(s); + break; + case RTC_CLEAR_ALARM: + goldfish_rtc_clear_alarm(s); + break; + case RTC_CLEAR_INTERRUPT: + s->irq_pending = 0; + goldfish_rtc_update(s); + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad offset 0x%x\n", __func__, (uint32_t)offset); + break; + } + + trace_goldfish_rtc_write(offset, value); +} + +static int goldfish_rtc_pre_save(void *opaque) +{ + uint64_t delta; + GoldfishRTCState *s = opaque; + + /* + * We want to migrate this offset, which sounds straightforward. + * Unfortunately, we cannot directly pass tick_offset because + * rtc_clock on destination Host might not be same source Host. + * + * To tackle, this we pass tick_offset relative to vm_clock from + * source Host and make it relative to rtc_clock at destination Host. + */ + delta = qemu_clock_get_ns(rtc_clock) - + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + s->tick_offset_vmstate = s->tick_offset + delta; + + return 0; +} + +static int goldfish_rtc_post_load(void *opaque, int version_id) +{ + uint64_t delta; + GoldfishRTCState *s = opaque; + + /* + * We extract tick_offset from tick_offset_vmstate by doing + * reverse math compared to pre_save() function. + */ + delta = qemu_clock_get_ns(rtc_clock) - + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + s->tick_offset = s->tick_offset_vmstate - delta; + + return 0; +} + +static const MemoryRegionOps goldfish_rtc_ops = { + .read = goldfish_rtc_read, + .write = goldfish_rtc_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .valid = { + .min_access_size = 4, + .max_access_size = 4 + } +}; + +static const VMStateDescription goldfish_rtc_vmstate = { + .name = TYPE_GOLDFISH_RTC, + .version_id = 1, + .pre_save = goldfish_rtc_pre_save, + .post_load = goldfish_rtc_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT64(tick_offset_vmstate, GoldfishRTCState), + VMSTATE_UINT64(alarm_next, GoldfishRTCState), + VMSTATE_UINT32(alarm_running, GoldfishRTCState), + VMSTATE_UINT32(irq_pending, GoldfishRTCState), + VMSTATE_UINT32(irq_enabled, GoldfishRTCState), + VMSTATE_END_OF_LIST() + } +}; + +static void goldfish_rtc_reset(DeviceState *dev) +{ + GoldfishRTCState *s = GOLDFISH_RTC(dev); + struct tm tm; + + timer_del(s->timer); + + qemu_get_timedate(&tm, 0); + s->tick_offset = mktimegm(&tm); + s->tick_offset *= NANOSECONDS_PER_SECOND; + s->tick_offset -= qemu_clock_get_ns(rtc_clock); + s->tick_offset_vmstate = 0; + s->alarm_next = 0; + s->alarm_running = 0; + s->irq_pending = 0; + s->irq_enabled = 0; +} + +static void goldfish_rtc_realize(DeviceState *d, Error **errp) +{ + SysBusDevice *dev = SYS_BUS_DEVICE(d); + GoldfishRTCState *s = GOLDFISH_RTC(d); + + memory_region_init_io(&s->iomem, OBJECT(s), &goldfish_rtc_ops, s, + "goldfish_rtc", 0x1000); + sysbus_init_mmio(dev, &s->iomem); + + sysbus_init_irq(dev, &s->irq); + + s->timer = timer_new_ns(rtc_clock, goldfish_rtc_interrupt, s); +} + +static void goldfish_rtc_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = goldfish_rtc_realize; + dc->reset = goldfish_rtc_reset; + dc->vmsd = &goldfish_rtc_vmstate; +} + +static const TypeInfo goldfish_rtc_info = { + .name = TYPE_GOLDFISH_RTC, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(GoldfishRTCState), + .class_init = goldfish_rtc_class_init, +}; + +static void goldfish_rtc_register_types(void) +{ + type_register_static(&goldfish_rtc_info); +} + +type_init(goldfish_rtc_register_types) diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events index d6749f4616..0bfaa26cb8 100644 --- a/hw/rtc/trace-events +++ b/hw/rtc/trace-events @@ -17,3 +17,7 @@ pl031_set_alarm(uint32_t ticks) "alarm set for %u ticks" # aspeed-rtc.c aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 + +# goldfish_rtc.c +goldfish_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 +goldfish_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h new file mode 100644 index 0000000000..3be586bdcb --- /dev/null +++ b/include/hw/rtc/goldfish_rtc.h @@ -0,0 +1,46 @@ +/* + * Goldfish virtual platform RTC + * + * Copyright (C) 2019 Western Digital Corporation or its affiliates. + * + * For more details on Google Goldfish virtual platform refer: + * https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#ifndef HW_RTC_GOLDFISH_RTC_H +#define HW_RTC_GOLDFISH_RTC_H + +#include "hw/sysbus.h" + +#define TYPE_GOLDFISH_RTC "goldfish_rtc" +#define GOLDFISH_RTC(obj) \ +OBJECT_CHECK(GoldfishRTCState, (obj), TYPE_GOLDFISH_RTC) + +typedef struct GoldfishRTCState { + SysBusDevice parent_obj; + + MemoryRegion iomem; + QEMUTimer *timer; + qemu_irq irq; + + uint64_t tick_offset; + uint64_t tick_offset_vmstate; + uint64_t alarm_next; + uint32_t alarm_running; + uint32_t irq_pending; + uint32_t irq_enabled; +} GoldfishRTCState; + +#endif From patchwork Sun Nov 3 07:55:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11224299 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B0E516B1 for ; Sun, 3 Nov 2019 07:56:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3081520848 for ; Sun, 3 Nov 2019 07:56:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="gNju+hJR"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="wsRs5XNE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3081520848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAkn-0001O1-S7 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Nov 2019 02:56:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAjY-00088x-1j for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRAjW-0003r2-Rg for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:35 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:41717) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRAjU-0003po-1e; Sun, 03 Nov 2019 02:55:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1572767732; x=1604303732; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ky8BZ8iaJiI0A0WDHkxMzZD2O+ipw7mbPNxy7q+UjxQ=; b=gNju+hJRs3bSM6TAFTbA6kq6RtUr71mUNJFDhekxtr9lG5gr3/6hUWP3 CKNzFCBDn79w43aGRr2lzeCqGD4GpNMqVUOjx62qgsIOOVrAMMJraZiQr 1J24hp+OR6BZdGzizzPqyKqAC9Go5Jbd0ndly9/du6UgRbZ/IVszaURV9 vmeZvS5phc4rWVZIz3gYD5LufAJHfFclVP3A8qrc9zbt3X3e0fUHOkag3 +/TYodBgZVaE7/rOLwotZ+4L3cWFnzpes+G9DP+8k5mF8mbQk22RCk7fn 7dnH1SFFc0ijulPauPO2xqzjLbqrgCElRrT81UO5HzJsbkEhtcBkvLw3s A==; IronPort-SDR: M9I5GuufprTqTnXLyBy6phzNrzu3+tdF5dF2UamMRLQvgVLdxt3Ir82TpOIxzxAI32I2guRiN3 h5YAqFSyG/JhEIcvnVWEjInaDua0+BHkGOWvLBDBLRIiLUu8pG6VEHfykRvJhBTDR8CbLctz8h ax1NGzNw93LW1y4frL/E01cAtS8gxolZBp8BGZlI+VOjV7Riiqwun0vpGicAB1zoT5kNk/Y4MU Smy478H1S1vYf5Qvh08iRG7FhalvszUGATI3o2Ru/a1Qgv3wAH9DcENNPbXKefcE1/kHF97YGM ECE= X-IronPort-AV: E=Sophos;i="5.68,262,1569254400"; d="scan'208";a="229199001" Received: from mail-dm3nam03lp2058.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([104.47.41.58]) by ob1.hgst.iphmx.com with ESMTP; 03 Nov 2019 15:55:30 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lwhZ0QYnGJMAFfWJMsxc/cPoPIEEba5yUTkYP4Xbz2ooKVnK2dZH9O4COJjrm3iJm1zJR+B7mxjdzDpBjp8NUmKh+nKGlJ0IwiTpTcB9Cvf4mWm/masbB2ScLaTfZUkJzys/+j3l/tqJhXh10kfo5zfcMNE9xg5LsVGsJiTG/UlPQDlU4y7jNLebzQzXJRnVyGXABba1l3G50xz80CUN2/Wrxqk1fR2vfyyPG0B9Qfv26+P7ViC/fauYr78Xy4UMUM8VM80W6Q3LtYq1JZR7BppyZtORAH+KnZbRUnlvh6vJYQi03hfokUWTOMGoefzirjllMdYccTXfU1jQVVbs3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YfO82K7SRKK9ZCscBuVbuPJlRokkEhnF0xm0w3c+H70=; b=jxrccz6XK9EVkoatt99qfgyodt/aPRZgP4zzJm0aEsooIijzgdgBzcmRj/qMczybyaOs6PGFjftssJHivrf+7aJADGm9M7bZXSA/o3KMyOrvKCDWrtDb9DUO5dqt75tSdNyTK8zAz9vr8StDY6mvLLuuCcSN1wWCAoWXXaRDQRRT77Ss2yqn/71f9WThQHRZJo2+6I2vOZ+4OvD3E1zI7SgnUW5ealYyKoNBZv++GYZMyiMcBM3Qdzg5E5qRrMy7YcCmCU2TH2/D6oOa+UN30mv+6rneivliU7divhCKZnVGwV53uvCQP1Arfv1n0sfqlw7cnF2gUPSnxKjyfGwm9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YfO82K7SRKK9ZCscBuVbuPJlRokkEhnF0xm0w3c+H70=; b=wsRs5XNEssiVO7wcHoC8ZUCGocQhkXsDm0LvReVhv8ObH5cOVrS+WH169kdfGHwO686X/oj3ZyT1km/BgzQpRZb6j8AHDdv//hfIrnQL5RlhSmfP88wbA5eVPbrlOIxD7O/ij+tIPD1txXzseI/mfxfHZ6lh8WWnVhxcHCKLvuk= Received: from DM6PR04MB6059.namprd04.prod.outlook.com (20.178.226.89) by DM6PR04MB4635.namprd04.prod.outlook.com (20.176.106.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Sun, 3 Nov 2019 07:55:29 +0000 Received: from DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70]) by DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70%6]) with mapi id 15.20.2408.024; Sun, 3 Nov 2019 07:55:29 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v6 2/3] riscv: virt: Use Goldfish RTC device Thread-Topic: [PATCH v6 2/3] riscv: virt: Use Goldfish RTC device Thread-Index: AQHVkhwPG0F9IkEqREKQwHL7/6aKCA== Date: Sun, 3 Nov 2019 07:55:29 +0000 Message-ID: <20191103075353.86497-3-anup.patel@wdc.com> References: <20191103075353.86497-1-anup.patel@wdc.com> In-Reply-To: <20191103075353.86497-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::20) To DM6PR04MB6059.namprd04.prod.outlook.com (2603:10b6:5:129::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [106.51.18.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8258c7dd-27f8-4476-4355-08d7603331be x-ms-traffictypediagnostic: DM6PR04MB4635: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:121; x-forefront-prvs: 0210479ED8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(376002)(396003)(366004)(136003)(346002)(189003)(199004)(71200400001)(55236004)(4326008)(305945005)(66556008)(71190400001)(6116002)(76176011)(3846002)(14454004)(102836004)(36756003)(256004)(476003)(110136005)(8936002)(7736002)(99286004)(54906003)(81166006)(386003)(316002)(2616005)(11346002)(25786009)(26005)(6436002)(50226002)(66066001)(6506007)(1076003)(66476007)(478600001)(2171002)(81156014)(8676002)(9456002)(5660300002)(6512007)(64756008)(446003)(52116002)(486006)(6486002)(66946007)(44832011)(2906002)(186003)(66446008)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR04MB4635; H:DM6PR04MB6059.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XTzYDJBzBI/SXs24JO0WJgZGRohI3wcx1W/6IcdxNjZAZUT+xU/W1Talbo+9vM+ebOhJt//GnDZW0Dki2+MMLSYpV+mj4V22kiPwA1QyYtiit3iLjd9CmX+AcSPDzVY4/bKsj60Wh1vvp+pCr1TseV/9umCdtZtolwLOAJESI/kQY4KPAd+7w8mDfkmI1UnTXkHyX7IOMkvievcmSVpxXFJctJWVgETkeIlWRh0+kHDXKc9Zcu2eybQw1I6PHab0aAdu86GIlA52KmLPlD5wALrZNBOgaL+zi+kRKixWIKI1ZeMDjLslD2QkaC3mioi5cj3QfDmBMNyJZRAr8qdQTnEw+hVCkXn31M2KUXZCkAjnAsdYzlBtIcok6tw8qn7ICW9sbaaLG6r38MBogk1f1HM37989ZLvxXJfMsJp4DcOMJd2dlw/xJ6Nqeu4IN5dJ MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8258c7dd-27f8-4476-4355-08d7603331be X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2019 07:55:29.4793 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xVDB+ZNvY+epa+mSPJk8obVpELHY2XdjPka1IeN1E5u9CVCO4p5wUJWJO2ULgj5yw4mueNWt4uXGSnVaFoJbEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB4635 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 68.232.141.245 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , "qemu-riscv@nongnu.org" , "qemu-devel@nongnu.org" , Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" We extend QEMU RISC-V virt machine by adding Goldfish RTC device to it. This will allow Guest Linux to sync it's local date/time with Host date/time via RTC device. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Reviewed-by: Alistair Francis --- hw/riscv/Kconfig | 1 + hw/riscv/virt.c | 15 +++++++++++++++ include/hw/riscv/virt.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig index b12660b9f8..ff9fbe958a 100644 --- a/hw/riscv/Kconfig +++ b/hw/riscv/Kconfig @@ -34,6 +34,7 @@ config RISCV_VIRT select PCI select HART select SERIAL + select GOLDFISH_RTC select VIRTIO_MMIO select PCI_EXPRESS_GENERIC_BRIDGE select PFLASH_CFI01 diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index cc8f311e6b..818678a4b2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -58,6 +58,7 @@ static const struct MemmapEntry { [VIRT_DEBUG] = { 0x0, 0x100 }, [VIRT_MROM] = { 0x1000, 0x11000 }, [VIRT_TEST] = { 0x100000, 0x1000 }, + [VIRT_RTC] = { 0x101000, 0x1000 }, [VIRT_CLINT] = { 0x2000000, 0x10000 }, [VIRT_PLIC] = { 0xc000000, 0x4000000 }, [VIRT_UART0] = { 0x10000000, 0x100 }, @@ -376,6 +377,17 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); qemu_fdt_setprop_cell(fdt, nodename, "interrupts", UART0_IRQ); + nodename = g_strdup_printf("/rtc@%lx", + (long)memmap[VIRT_RTC].base); + qemu_fdt_add_subnode(fdt, nodename); + qemu_fdt_setprop_string(fdt, nodename, "compatible", + "google,goldfish-rtc"); + qemu_fdt_setprop_cells(fdt, nodename, "reg", + 0x0, memmap[VIRT_RTC].base, + 0x0, memmap[VIRT_RTC].size); + qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); + qemu_fdt_setprop_cell(fdt, nodename, "interrupts", RTC_IRQ); + qemu_fdt_add_subnode(fdt, "/chosen"); qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); if (cmdline) { @@ -579,6 +591,9 @@ static void riscv_virt_board_init(MachineState *machine) 0, qdev_get_gpio_in(DEVICE(s->plic), UART0_IRQ), 399193, serial_hd(0), DEVICE_LITTLE_ENDIAN); + sysbus_create_simple("goldfish_rtc", memmap[VIRT_RTC].base, + qdev_get_gpio_in(DEVICE(s->plic), RTC_IRQ)); + virt_flash_create(s); for (i = 0; i < ARRAY_SIZE(s->flash); i++) { diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index b17048a93a..e69355efaf 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -44,6 +44,7 @@ enum { VIRT_DEBUG, VIRT_MROM, VIRT_TEST, + VIRT_RTC, VIRT_CLINT, VIRT_PLIC, VIRT_UART0, @@ -57,6 +58,7 @@ enum { enum { UART0_IRQ = 10, + RTC_IRQ = 11, VIRTIO_IRQ = 1, /* 1 to 8 */ VIRTIO_COUNT = 8, PCIE_IRQ = 0x20, /* 32 to 35 */ From patchwork Sun Nov 3 07:55:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11224303 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3CCF1515 for ; Sun, 3 Nov 2019 07:57:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 889F020848 for ; Sun, 3 Nov 2019 07:57:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="PRLO2IwO"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="huDjZZ8E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 889F020848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAkv-0001Z2-9x for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Nov 2019 02:57:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36523) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRAjd-0008I9-Rp for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRAjc-0003t3-Se for qemu-devel@nongnu.org; Sun, 03 Nov 2019 02:55:41 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:41717) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRAjZ-0003po-Cw; Sun, 03 Nov 2019 02:55:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1572767737; x=1604303737; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=/ITj0ywC3DPHtnCF2WlDaELAwxT+3DRuxefGThUb2Vk=; b=PRLO2IwOkd88uthyxFjal+lyni17+oVOKlBiGlnurSI68Je3wCH5CnHs fk1rLpJXYFGWiqRYSARwmi+HieN/8boi+Dmo2YKiEp7pXmyltSD/hfgx0 7G6ZNE9MtS9gOS85t2EE+uWDAkKz/st/wNCaS9Bd8j5/CVLazl24ymPKf 6U0bHOzybb2VZe79JbDxC86P8jNdaQX1lv1s6fVM2KDCLXdFfL7w36q8F XpjJnEmONXrfvCyYYuuP78LaeGXO6V2De5UXIX35hH2cu6cn6iR1gdqfx i1kGSpHIwXcPl8/feyV4PPtZ3MbJmTd8x0rlBJLAQXf6fQxcpw0KpPvh6 g==; IronPort-SDR: Jbj8zQZLmt0pCcbSYg3zYs0e/0CCOfvBIG09H0GPCJuP17IEYpNYe+upOgPFRvK+lac/BVcrGQ fm+solsVqBvhP8n5rCxQX8urI9S6lpY3PzyRTMFdkfuKxe0bPC/UEnlRTv4ZN426Rm45/IkYhQ HZcJ4Ee9Em7hrd1I8uVl5fG+HQok2PE0Yj2ekTtt6Wp2TsTNocwYIawR87t6kJbfhyLkHY9jn3 l7Yt/GskD3mb1jXbsXFYaqR0n6VnJDoiSpmzuw4peNvqlZ/jsnUM1S0S/KTqDF1hc4Qqdd3AK+ WFs= X-IronPort-AV: E=Sophos;i="5.68,262,1569254400"; d="scan'208";a="229199005" Received: from mail-dm3nam03lp2050.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([104.47.41.50]) by ob1.hgst.iphmx.com with ESMTP; 03 Nov 2019 15:55:36 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RilWPVP0EET9zwFmFm2EuGIGx+PqgQGfaA9AwPnyeJhdtn29rCtZu1o69dnq14sTxbAE6unsUemXck1wGAMnEohq31N3ry5pjETKm+Wl9oqs24FmHNUd5q2XfQMF8ffXNzJqnMAQljV55glkzClNzmQqL5pvKmIPAqX0p/IR7vvqYeqjSuZAZMJBGTOaYagoU9vBK6jdGrf/6ktxV9tInS0rdf/CpqCpgbd7eJ/jpGuqsc2kLw5QLZZbAgFebZc9E8pZxGby0wp+DSycImVfdCJ2h6FyyNJYgHAdkic5ASlbPPPpYs8P6JnPWw0uPL2RzEem75DwJ+hBy/Rzz41L8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ITj0ywC3DPHtnCF2WlDaELAwxT+3DRuxefGThUb2Vk=; b=GQF0PV66m5Y8UQ2GSxJQCYNI8IqiDVn2kYU/V9RRkJF7hlYCZudGdbGPg9DGlB+mTHtMGh8mzmVoc/iSzdQr4ExADpsHyR0R96ZLLOZTIRvRi0oEZn/BQgfJrtZXNmQ2njjZc71nGllpnsZMtwnZR/D4w3bW2bNIqNpNAJa50HjX2sfl72fNgAdtHjGTUbbUaPdsljSast4AbsfgivN0aP3D5Yk6Z4LDehUkKYoLcyLwoEI7K23tgzeXWLLZE3uPUq7QTvEHnjQGSs0StTPo2fyR/uSB8G5ltrkyWaaHEhHqzPgnKdNc5JmPjtIPA8FKrYy7CXkUG6HyP1zVlbNdvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ITj0ywC3DPHtnCF2WlDaELAwxT+3DRuxefGThUb2Vk=; b=huDjZZ8EtI1dwEWbBVVVBmgeX8CAop/gNtX1xdFFgcRhPQm7Hm0R7L2mSXO/4Q2XFYMdzaYmNie1OrUlTul+Qn2Ss9AT0zH/96zuEFwaRhi0h34H1s89lQ3wDXxIP2XyH0mB8Q2rX43WX0+xE+4fr1rqVbpVjnvLOPXHFe3+pnk= Received: from DM6PR04MB6059.namprd04.prod.outlook.com (20.178.226.89) by DM6PR04MB4635.namprd04.prod.outlook.com (20.176.106.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Sun, 3 Nov 2019 07:55:35 +0000 Received: from DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70]) by DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::dd8a:a9c0:97c5:cd70%6]) with mapi id 15.20.2408.024; Sun, 3 Nov 2019 07:55:35 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v6 3/3] MAINTAINERS: Add maintainer entry for Goldfish RTC Thread-Topic: [PATCH v6 3/3] MAINTAINERS: Add maintainer entry for Goldfish RTC Thread-Index: AQHVkhwTNac9UOM2A0el+gnppmNvDg== Date: Sun, 3 Nov 2019 07:55:35 +0000 Message-ID: <20191103075353.86497-4-anup.patel@wdc.com> References: <20191103075353.86497-1-anup.patel@wdc.com> In-Reply-To: <20191103075353.86497-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::20) To DM6PR04MB6059.namprd04.prod.outlook.com (2603:10b6:5:129::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [106.51.18.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dbeee93a-2128-48dc-797c-08d760333554 x-ms-traffictypediagnostic: DM6PR04MB4635: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:651; x-forefront-prvs: 0210479ED8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(376002)(396003)(366004)(136003)(346002)(189003)(199004)(71200400001)(55236004)(4326008)(305945005)(66556008)(71190400001)(6116002)(76176011)(3846002)(14454004)(102836004)(36756003)(256004)(476003)(110136005)(8936002)(7736002)(99286004)(54906003)(81166006)(386003)(316002)(2616005)(11346002)(25786009)(26005)(6436002)(50226002)(66066001)(6506007)(1076003)(66476007)(478600001)(2171002)(81156014)(8676002)(9456002)(5660300002)(6512007)(64756008)(4744005)(446003)(52116002)(486006)(6486002)(66946007)(44832011)(2906002)(186003)(66446008)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR04MB4635; H:DM6PR04MB6059.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Mb2ENPgfe7L0N7ML5fsVfzQGhkkWWbudEFvATItGztnrry4tSBgk9eRS8LziNMV3U5xaqWml9P/J7aIC/fKjrQCygVJvHiXLLBSV7cHrhJnAaEoamAsQO9jgzPx/G9JQvfhxSY+OoBwt1l7ugd0CO1XETkgmiMbaXiJ28JtYAio9ZEO+aKY4FU9eX6IFg+w+6yHDIhc4GyHVrPUdZKyIH+nM7lsRaKoJoh5OHR9wDZBc01e82yktu27jprt9CCOy7Hp834mQ172MIpnWIu8DEB2BmpsgiiGCBXSKq937xGjPCptaH+k4ZAwv850IaPayOXO4JvY30wg458+vmcuISWbrRXxQdOOhER5eY05yKVIRRxyNsZnPfOLqW0B9KhXRX4U9AphNPNEU9hD8TT1vqTkgG0yLnCMS5bxJvELENAFnfWJm7JTYmTk78SCYzcwd Content-ID: <5000714358876C459B6F9DE0DE69F7CF@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbeee93a-2128-48dc-797c-08d760333554 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2019 07:55:35.5358 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ecLuNzfbBQMC3hJi/5IcoQXIlCZ6SSxcCgo1lyGnCucjN2ciXs1irxi3hnJ3CdHtG1wNSmpkcbO0YObKR1+JMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB4635 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 68.232.141.245 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , "qemu-riscv@nongnu.org" , "qemu-devel@nongnu.org" , Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add myself as Goldfish RTC maintainer until someone else is willing to maintain it. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c2a68555ae..f200e985da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -558,6 +558,13 @@ F: include/hw/arm/digic.h F: hw/*/digic* F: include/hw/*/digic* +Goldfish RTC +M: Anup Patel +L: qemu-riscv@nongnu.org +S: Maintained +F: hw/rtc/goldfish_rtc.c +F: include/hw/rtc/goldfish_rtc.h + Gumstix M: Peter Maydell R: Philippe Mathieu-Daud??