From patchwork Wed Nov 6 11:56:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11230121 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 BB65413BD for ; Wed, 6 Nov 2019 11:58:34 +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 7D8D02075C for ; Wed, 6 Nov 2019 11:58:34 +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="IUi7DUYM"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="ZErYw9Kh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D8D02075C 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]:56818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJxJ-0006hn-OO for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 06:58:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45752) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJvf-0004e5-Dn for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJvd-00062V-5r for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:51 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:54980) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSJvY-0005zm-Bi; Wed, 06 Nov 2019 06:56:44 -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=1573041404; x=1604577404; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KXbtW0yecdF2dj2yi8gwhpg+ewMI9AuRMIpxq//Ts3M=; b=IUi7DUYMjUVT9ew5dBALZ4GI9m6fPdQGDfwEl9goqrnuyAP+73GH1z9l 4Jdw0CRPvdjviqKzEYBDix0AqROFbzNhRKs6UEzf9xGWf/0aLkl8eF0Zw M1X0cJbQLUK2QeRgpj90qPzFEqdm+iNI6xXJf/pHT//GjperkIxbFmRoB 1ITXXvJslYdSZjmw5oovREEkfTfSlsaQLy42+CcyZ6Ttdr0CGnP+jhym6 SVwMBSHb1/A7k7WEQ8AGP439Zg/wo43d98azfXDibc5uDn66rFxvSqU3W 3ZIKFW/m+HfKAdfg2AxLj4TsH6L40IxcjzVlRWjBlvbslv35w8em+pVap w==; IronPort-SDR: k2AZR/1xv6Ec6cqBmkd1SE2zNq29Ns0zo4ANYEIIUVvL2WpAbubTcRHMflXuO9axGI9g+5P2dM YGiuZ3cMxLm9mF5psU6Na363C78UldHsGmOZIuOal6szVGjwmvXKsaZWOa9fFL8zYQldcSmnOw OjjMVqpHNBUQmQYNVsyNYB7fTYFaC8LtjfqT/n0SzR+e45idtWVsB1+ePLYNt3QXofPTmOtM6N T08+d3LN710hbFNPv98az0bdEsN3roS+FjSrU0mjqIdogFFzVG6anY1yp6jdySIE6Cwbifd5Ul s+g= X-IronPort-AV: E=Sophos;i="5.68,274,1569254400"; d="scan'208";a="123022214" Received: from mail-dm3nam05lp2057.outbound.protection.outlook.com (HELO NAM05-DM3-obe.outbound.protection.outlook.com) ([104.47.49.57]) by ob1.hgst.iphmx.com with ESMTP; 06 Nov 2019 19:56:38 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DE2EwPcr6nyUVbhdglKVUqD+m1cNN7JhLU4EhKnDOp19xRybnKqnPTFxv+krKgKh60f27xzNQhUsPvJ+H1bQyJ8fjUouWVrOaxbVq8yP0ka35wLwibEQgI89U8ekzGOCntyFRysDFNrHdOSoGlFIchcmRZ6v6VXVWy2lVkX1bMec7prwLCk6aecCl1Q0xh1UzW7wWrsZiW6pkW5nuad8RMvkdCQiOagH8pMBbgzRlDoBDueW4Zh9Sym6QM1rf/8w9MVjSSZ1aCVc9k1Dce8Ail1ldIQVX/d5Eglgcv6OQLroHlJEeJDcxo0En2xIWIUGZiTQNkc8PD5zSabBUrfX8Q== 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=UESNB/El9DkJebqr2gddAc6J5InjRa8rAD+Tl8z4gCU=; b=eBZ2SH7hZhQdCzybXKn18jWfxXMDClv15eYETwP3C3YKyldatnPoEvSVGDE/oK0ObNoB+EZ83SSq7Tld+tWFhJT5BnmkMRitlAXeDflQu0Cf9UxeWevyIF457OJj684rOFMumYnqZwS169HdD9khFjvWO+mC1zhft348pAM2b5RnHFlCvPc59vLPtxU2PdYky/VZpi3TPwT7ljPjh9lSYJZol2BGY2enxlbUsjoBUG+RsUpyqu/5z3q2kRpPIUc8QPhHrZ/bbxj9Lbi0chBQm350Metc2/UaCD3npGgEBhaWOfZMJe1/jcZagIn3tQdj99gllBZKLVbNaJXX5+27BA== 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=UESNB/El9DkJebqr2gddAc6J5InjRa8rAD+Tl8z4gCU=; b=ZErYw9Khzl4Zi+pQ14r0/JkucA1vX9K4xSVdBBEXUdXw6Bpzw+2rcse/MzJO9bnhbHPEPWNyeaMKZpEkpUs9H4JBOz91bad+TqTZUtAfXp3k0yJ99jHj8pmza/ZTSdtt+gBYptcm3iaJJgG2U2cg0XufZC0zXt7SLj93L/0XNHE= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6080.namprd04.prod.outlook.com (20.178.247.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Wed, 6 Nov 2019 11:56:37 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a%7]) with mapi id 15.20.2408.024; Wed, 6 Nov 2019 11:56:37 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v8 1/3] hw: rtc: Add Goldfish RTC device Thread-Topic: [PATCH v8 1/3] hw: rtc: Add Goldfish RTC device Thread-Index: AQHVlJk9wHTH22rvOkqBg2gcURUTgw== Date: Wed, 6 Nov 2019 11:56:36 +0000 Message-ID: <20191106115602.74299-2-anup.patel@wdc.com> References: <20191106115602.74299-1-anup.patel@wdc.com> In-Reply-To: <20191106115602.74299-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::11) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) 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.25.253] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bfcf289f-6e6d-42ae-7af7-08d762b06033 x-ms-traffictypediagnostic: MN2PR04MB6080: x-ms-exchange-purlcount: 3 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:257; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(199004)(189003)(9456002)(2616005)(6506007)(99286004)(52116002)(55236004)(102836004)(186003)(36756003)(76176011)(66556008)(81156014)(8676002)(26005)(8936002)(6116002)(50226002)(476003)(256004)(2171002)(14444005)(386003)(6512007)(4326008)(44832011)(71200400001)(71190400001)(6306002)(7736002)(30864003)(966005)(2906002)(5660300002)(14454004)(6486002)(1076003)(3846002)(446003)(486006)(11346002)(66946007)(66476007)(64756008)(110136005)(54906003)(81166006)(316002)(86362001)(66066001)(478600001)(25786009)(66446008)(6436002)(305945005)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6080; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fofFfq/IvSWAoeuAmMeda5eW3rjpA0vykwA9pp+/uRg9m56v7U5g37/DECGH8fBX2qD4qeavynN5ukOjygrTFu0hjNbJneM5ZoDCzpyrljT/aichb8f8Tf1gY8otq8qx1zbc2YsLbTEYp1efgN9Ws9igc8DTtosDfE8DGeeF3UfBnwf5YEqS6MHkD6xRAHi2ienvrR/eqccnwcOEizoKipaKra5k+6tRfACSBhaNLq/jO9akLfxSCR6Yb91ESHMNiQNCjD9EjtJOnryNADkEWNfohRmYx9sHgYYQeCrCpGEWz8dpqh7V2EC8GTUHmmilbiDQzkf7oU13+NRThynubic2NPoVGQ95r6AudHRwTtmj5alauDC/7QOhjfisntIXb8ww8c/KlAdWM5zjwYopPlIDEe+63a27yMMJLrR1CinJ2sRJemhyWXCd4KE5J85vgR+fVMVrN0sqb0W69DV4SG01OVESfgiTXoF5q7TgBc8= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfcf289f-6e6d-42ae-7af7-08d762b06033 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 11:56:36.7715 (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: 57BtXxFDo++JNwoHsCS7nl/EfNXWRov2JBo30kC535cZmCIhTI9SQppZmx5Jzld0LN7mpEnJZfnv1au1xTTVtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6080 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.153.144 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: "qemu-riscv@nongnu.org" , Anup Patel , Anup Patel , "qemu-devel@nongnu.org" , Atish Patra , Philippe Mathieu-Daude 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 | 285 ++++++++++++++++++++++++++++++++++ hw/rtc/trace-events | 4 + include/hw/rtc/goldfish_rtc.h | 46 ++++++ 5 files changed, 339 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..01e9d2b083 --- /dev/null +++ b/hw/rtc/goldfish_rtc.c @@ -0,0 +1,285 @@ +/* + * 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/+/refs/heads/emu-2.0-release/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/bitops.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: offset 0x%x is UNIMP.\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 = deposit64(current_tick, 0, 32, value); + s->tick_offset += new_tick - current_tick; + break; + case RTC_TIME_HIGH: + current_tick = goldfish_rtc_get_count(s); + new_tick = deposit64(current_tick, 32, 32, value); + s->tick_offset += new_tick - current_tick; + break; + case RTC_ALARM_LOW: + s->alarm_next = deposit64(s->alarm_next, 0, 32, value); + goldfish_rtc_set_alarm(s); + break; + case RTC_ALARM_HIGH: + s->alarm_next = deposit64(s->alarm_next, 32, 32, value); + 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: offset 0x%x is UNIMP.\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", 0x24); + 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..16f9f9e29d --- /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 Wed Nov 6 11:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11230131 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 2459A13BD for ; Wed, 6 Nov 2019 12:00:32 +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 EA4D32075C for ; Wed, 6 Nov 2019 12:00:31 +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="jHxhRGJO"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="arN0kWjl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA4D32075C 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]:56840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJzD-0008AC-0K for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 07:00:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45802) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJvi-0004kN-T4 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJvh-00064H-Md for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:54 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:54980) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSJvb-0005zm-59; Wed, 06 Nov 2019 06:56:47 -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=1573041407; x=1604577407; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Z/9D9OGXgTVv7J9Pqpy+//37V3BK1nIPYhs7KJBd2tk=; b=jHxhRGJOShMBz4Ff54wKY6koxhyJB3XAy8yWFeS1rYz50wb4jP0iuO8j xGl3Ffmm0AZitcDZ8phkRgmmTqOasK7jlYQmuyWikNBcOrY3iWqdZOjmW LHoLYsnASmqYSpxeU7KKizGG4FaKrErpoA4079FmhExV/CRCEQkVkYgx7 vylGTAiEM/Ll1QltJl7vudaxJHdIuM0YFv4UehHGEW1sdo+ExfmjozFLp gPucjQpNN9EbODjqKEd2bJDM3A6tcvDr3YZsCSILhx2OQzr0xrsoZtNSr aZhEJirVXbaHUX0q1vKcpm9EotuJ3OsO87r38Oe0HIAKB0IRBUBm7XaAf w==; IronPort-SDR: pmRdHA6uPI4FrojHpGysZc9gb+fUFNtFnW4vVIl6XWQhSNRxHvm7mN0L3PzsXBoViKSIGr0/1G sNKAmqehaHZC4Ns80wR9aBDbOLEBLir+rIdg2wjRlgk1hAjV6C0XtBlWXl/otab+eWPKRVVnxJ YR354XfdezhsNTY2MACBNqMCwmBmncwqOcCuqODx7oJiXhgFD9CUAbsO29FLuQ237U48x/KnyX 4SMhvCcI5a8VjXJh97NTwYmp8W4CrYhV4bx0fWrtWWO8J7CsbVy8QI7F1ZyDAHmGpYsB1nMOn4 CLs= X-IronPort-AV: E=Sophos;i="5.68,274,1569254400"; d="scan'208";a="123022224" Received: from mail-dm3nam05lp2050.outbound.protection.outlook.com (HELO NAM05-DM3-obe.outbound.protection.outlook.com) ([104.47.49.50]) by ob1.hgst.iphmx.com with ESMTP; 06 Nov 2019 19:56:45 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hn3Tw7BxvFFGdwzQG4/e16jm5sO5saDksC/VmNu+YSKixVAGdWx6fiRiIZudEu4NIUPF8ksLG2+PBJMCPaE7R+QVxDeOgoTSdrGryPRcV1KPSb+SSSQfQkJpIhbclcr4YoU/7zSE5TWEpXARuNWoaxJRvaIY5kY5eWandrZsQpooccFd1eUehOa690hkZzY8kFTrtkvz435Ct9a3YTw3xYwR+pLZmtNL+2dzyc2ZwIkjgJV/KeDvoBkNVHWG1kiylszbn+EJ+A6ViooGDHLoOVDTs0hbZzKIHzW/guee3U8eqX0/jNp764+N4Q+nycNVM7SQ6HMw2EEpGn/4mpwvOg== 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=9dHJ9znm+obj0+HDPGnmLvvFEpArXGNqNkCytI9TMAA=; b=NcZvbRosRfTT1osCqsSftCdMkd/pVjxW3ahiPpHyI0R/VKM9D2xjUxSKiqDa6hVzLBM0TTL9V993pa6AvESu/N7720hAp3YUQirf5htjDVT5KbiOmxxqzeTzCB4e+oWbaER0x36241aYxHfQQLL2j1pUPiZAKk41o9FewVc87Sbc9F8q/OtXagOYDoU/RjqhsmQGpl0ScRtWCH1451CxitBrpEY0l5LxFANn7FYLxgNM9qJEOGPlMQTituVCqSe9oXLPDW1LxXFW6lDsT+7mcXQnsSQDXyM2FquPkgHt4aOfQzN7+onLSdFmyAO6kmN03t7cEldxOJcac3jP6Y+naw== 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=9dHJ9znm+obj0+HDPGnmLvvFEpArXGNqNkCytI9TMAA=; b=arN0kWjljQ9CaTY+y4og1Dd40Ww1RIAVnj5JMhsNkUY3vsZwlNqovCUbKWyT9DAxADULP+SbzY0cmWBt9nBv/kS1Q/9bk/4ihC6sPzDcK5/CvueWaL0f1IGwwTZ7E/nycTRkbhigWzsrm2c4Ulqma1+YaeCV6uP+GC0KNlVgsEg= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6080.namprd04.prod.outlook.com (20.178.247.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Wed, 6 Nov 2019 11:56:43 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a%7]) with mapi id 15.20.2408.024; Wed, 6 Nov 2019 11:56:43 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v8 2/3] riscv: virt: Use Goldfish RTC device Thread-Topic: [PATCH v8 2/3] riscv: virt: Use Goldfish RTC device Thread-Index: AQHVlJlCtQKiqy5yhEGvdBIqO3FM1A== Date: Wed, 6 Nov 2019 11:56:43 +0000 Message-ID: <20191106115602.74299-3-anup.patel@wdc.com> References: <20191106115602.74299-1-anup.patel@wdc.com> In-Reply-To: <20191106115602.74299-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::11) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) 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.25.253] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2d214b19-8649-46b9-7ac7-08d762b0645b x-ms-traffictypediagnostic: MN2PR04MB6080: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:109; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(199004)(189003)(9456002)(2616005)(6506007)(99286004)(52116002)(55236004)(102836004)(186003)(36756003)(76176011)(66556008)(81156014)(8676002)(26005)(8936002)(6116002)(50226002)(476003)(256004)(2171002)(386003)(6512007)(4326008)(44832011)(71200400001)(71190400001)(7736002)(2906002)(5660300002)(14454004)(6486002)(1076003)(3846002)(446003)(486006)(11346002)(66946007)(66476007)(64756008)(110136005)(54906003)(81166006)(316002)(86362001)(66066001)(478600001)(25786009)(66446008)(6436002)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6080; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: T1j9wIX38PdoepaSr9WRJqvi2NBRABKPaG6tdhfk1rziVcGfVlE0RsFjseoQCfu8pnBJK01LhHfve/tMhEQhbWkEXBOPe6ZGcCPqUz0uHN3wBzXYucu+D89DKcinRSkxT4d4G2LG4FBnwNQbNfYu0dHKzy3YWZT9GXl6q4xml6Y7lULnwDmDvlmeGVOzYkvNkfWRfBFv1CohCDxVR6FnhFqSyBdaS5c67d70YeS3LypCNjgTQ3o1sCJDD719jLv/Dm+Ox0nV34Qm9EH7xl3qiwZd4bC8CfgvxHhjYPSL3s0lRsaL+LDiGW2KLaZ962cSYlYl0ZF79x/EahPbqiF6PQ8jEMZJvSEIMYX1i1Zc0YyZd04js7DNrIUCC2A5RXcGtEtQ3NJ3pZtts571WApru0WeKrVj1n2E+ohC2rse5LRs+PSmeS+8SWSZzq1C7LbN MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d214b19-8649-46b9-7ac7-08d762b0645b X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 11:56:43.6076 (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: FbWRojHeJyOHu2b4Zg3RGwGXvDO4DF+zPbPLWFKA7vAOP7kVjwpk0LJJDSio+AXglkxOlZPk3nInp0xCitZ+5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6080 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.153.144 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: "qemu-riscv@nongnu.org" , Anup Patel , Anup Patel , "qemu-devel@nongnu.org" , Atish Patra , Philippe Mathieu-Daude 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 | 16 ++++++++++++++++ include/hw/riscv/virt.h | 2 ++ 3 files changed, 19 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..d7c5d630eb 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 }, @@ -383,6 +384,18 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, } g_free(nodename); + 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); + g_free(nodename); + nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); qemu_fdt_add_subnode(s->fdt, nodename); qemu_fdt_setprop_string(s->fdt, nodename, "compatible", "cfi-flash"); @@ -579,6 +592,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 Wed Nov 6 11:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11230137 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 5E61413BD for ; Wed, 6 Nov 2019 12:02:09 +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 3046B217D7 for ; Wed, 6 Nov 2019 12:02:09 +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="knVK5TTR"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="WI7PJgJp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3046B217D7 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]:56858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSK0m-0000gS-97 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 07:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45836) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJvl-0004pa-Rj for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJvk-00065k-Nq for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:56:57 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:48677) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSJvi-00063q-9c; Wed, 06 Nov 2019 06:56:54 -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=1573041414; x=1604577414; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=+4DVSZF1OwyKe+oveoGbmdIZHMMAa7gf6OZSpH/u0Js=; b=knVK5TTROF0zyI+Neawt9RLi+ujfpA5wWqfthx2pEcfUFDl84hhh+4PU ECw2IH4jbbZZsggVXimhEMoVFTdBkFY7GYEVMwQ+i4XNFVhuYEoFS8p2c Rn3vbJcbl2ec8n6uEfritUXmJVoEFzdkLT5BdpTKUT+k3kq1pTEOx/dim Rk9sDheoszdqmw8yluudstkHoJdswBJ8sel3I8F1dTOoYlFKwcI7NYtot uafeohqD1C2aT4bLVfHVZ80TK2CcwnOr8wtX1kFlxe+FECq/gV+EBK6ek jpALm4RZORLzF2u8Ip+BdhIC/o8/En6Tm86aq7QCfEWxbv4V9iHKAK5UM w==; IronPort-SDR: VpgPLlZfsrN3t3e1SYOQdqLKCgKzNaU/BV04+pM9AoxnMdswKxiMTWdMVc1jhEKMGbm6NR/6Xr 9sBIGfdmeJ/Rh6Xp0ZbqMMkLzI6uVek3vv1d0hkkoVS/XQWKlnMwBhpDuNz42ZMxcOgzjtoRrj 5lYBdbE7XiJE0t2v6kxexQRi7xRRD75Wa8BwqMht4bKtI6v06pkFuBWdH3mkBX8Lk9sQzOE+IP dgl0athhG2GJYE2LIfNi7g0UVnuGMUb6y/tDjn/SQCN8FgbA+g8PzsUEalXByMDPOPnuCOCgpY Qf4= X-IronPort-AV: E=Sophos;i="5.68,274,1569254400"; d="scan'208";a="123881597" Received: from mail-dm3nam05lp2051.outbound.protection.outlook.com (HELO NAM05-DM3-obe.outbound.protection.outlook.com) ([104.47.49.51]) by ob1.hgst.iphmx.com with ESMTP; 06 Nov 2019 19:56:52 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1RBuRIM9mbsJDCCSh9r6cA6f1lk11WkADxLzhQlzB37DZZ2daIOlNe2st4LaucmJi67rdDRybGZ9FRbRa5H6zGrvW3qhm4nSaZ/5Gk07lPk5Np9+qdVlLKXtx3g5sIb/tdCynVnpvOqaHMnVz4M8/aFmAnX+LAJwUNQG6UaEAD6SoT77uLLeQ9jG8rNyKT8B8Lc9w9s+HP4Cn7jE7hHDGvjkCKu3l2KzirbECDD4um8M41l5u89RNfOj/C595q2UDGcc4fFRNRHj/Og+dMa+gv70zQhXWxWlbqs2vtc7jpuCAhubsXG4xB7qt5gBbh47QYzgiiQtVGfE5KIdMBZ6A== 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=+4DVSZF1OwyKe+oveoGbmdIZHMMAa7gf6OZSpH/u0Js=; b=jjXS6jAd3cHegA/ov9kuTN/1SpQA3gqAHY6x1Mdr9LZvM2rEGkfqALmX7dOGQLLZptgYW5G9wPt2SpXJ2GYYSBT4qmc+TMyFSzchKTiSOyGAPEg1+KYtpJZcE2r47Ztk0skqk//X1ABdm4XZNVD+DHyZSWsJFmgrRYq/eAku0aW+pSN7T0yF2hb+ODtjRaCnW2BzizsUPb48FmL+M508vclcrwzziOCJKd2amuGXOa0TJgw5wdukoWUBv12gWNeNrR61WUGYyh1sD8rtEoopCMkRBgj2nTGxp+yCd5LbGNssOlck1fFXIkNjw3hEdRU+x7QauP8pd74PL6/YhG1kYg== 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=+4DVSZF1OwyKe+oveoGbmdIZHMMAa7gf6OZSpH/u0Js=; b=WI7PJgJpohFq9XDZ7csqvXSnzB0MfikfYxTShFt3R8YusHu9xy9+ZkuasRCQNeroHNLuzo77zvMnZ/kODHiUXGnLzZ9lHvpg/ygxIQ0C21wRaGZSKGuh0OKswsZjWwHfwPWxYeuonYq39bVMxeW0CiuhMz2Lrq91hZlFN/44Le8= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6080.namprd04.prod.outlook.com (20.178.247.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Wed, 6 Nov 2019 11:56:50 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::b181:29c4:fcfb:7a0a%7]) with mapi id 15.20.2408.024; Wed, 6 Nov 2019 11:56:50 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann Subject: [PATCH v8 3/3] MAINTAINERS: Add maintainer entry for Goldfish RTC Thread-Topic: [PATCH v8 3/3] MAINTAINERS: Add maintainer entry for Goldfish RTC Thread-Index: AQHVlJlGSNz4s7KScUOMdkpk039ulQ== Date: Wed, 6 Nov 2019 11:56:50 +0000 Message-ID: <20191106115602.74299-4-anup.patel@wdc.com> References: <20191106115602.74299-1-anup.patel@wdc.com> In-Reply-To: <20191106115602.74299-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::11) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) 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.25.253] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 873afeba-f9c7-470d-d928-08d762b06850 x-ms-traffictypediagnostic: MN2PR04MB6080: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:651; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(199004)(189003)(9456002)(2616005)(6506007)(99286004)(52116002)(55236004)(102836004)(186003)(36756003)(76176011)(66556008)(81156014)(8676002)(26005)(8936002)(6116002)(50226002)(476003)(256004)(2171002)(386003)(6512007)(4326008)(44832011)(71200400001)(71190400001)(7736002)(2906002)(5660300002)(14454004)(6486002)(1076003)(3846002)(446003)(486006)(11346002)(66946007)(4744005)(66476007)(64756008)(110136005)(54906003)(81166006)(316002)(86362001)(66066001)(478600001)(25786009)(66446008)(6436002)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6080; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HksotSIY2XEnC/P0oUpqtnA0mu3rvDwxbSsgXUT5dad0b8ySQhXfPgC5fSX10Yn6wLF9C6PLo71PeCALgxI7hj/WWKazzf5/kHzXRNm0GPkLqrf0EzLo7woF2BTc9iUN+0BEdCNI8vi1WGKJmiF5jZlhQefcu+zl5iKctSCvpje59hv5U8oSrmkg+aOg4G4sJmU+K0DQc+KP8inKofe+39WkOQ/7nPbwsW0U0e2cAqXcBaLmORqop4wajQD9MX3yrCggddLPhtg/j4qT3ozh7h+mqpdpbMIj5vLFJtbpW3rLsELh4xsY4NLLP0N99K3GkuOwUXfiASEE2iTQUEYx/JaAwGvyCfCDeonxJWj2EY7ZGkzUGih3B4dPpf9LOp56gLMKYYroFgBS7/yqw4e9B77ckeTkRT4v0uBuKVKb+Mq5DcpuQublcL7gLc/PMvdA Content-ID: <9713CD3A72257F47A53DDA3342AB1B46@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 873afeba-f9c7-470d-d928-08d762b06850 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 11:56:50.5286 (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: +UmImUvGWZZV59UJQrqzghjcMcsDfMtD+qoVtLNeEWhqdcH8ksfPy568bC+QcaqU6EgxH3fUVO8PwxAOWm+1sQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6080 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.154.45 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: "qemu-riscv@nongnu.org" , Anup Patel , Anup Patel , "qemu-devel@nongnu.org" , Atish Patra , Philippe Mathieu-Daude 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c2a68555ae..492c0d1baa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -558,6 +558,14 @@ F: include/hw/arm/digic.h F: hw/*/digic* F: include/hw/*/digic* +Goldfish RTC +M: Anup Patel +M: Alistair Francis +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??