From nobody Thu Nov 6 20:33:29 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487723532726154.75703175370631; Tue, 21 Feb 2017 16:32:12 -0800 (PST) Received: from localhost ([::1]:49234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgKqp-0007hD-Fp for importer@patchew.org; Tue, 21 Feb 2017 19:32:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgKiF-0000Vj-4Q for qemu-devel@nongnu.org; Tue, 21 Feb 2017 19:23:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgKiE-0002cU-BV for qemu-devel@nongnu.org; Tue, 21 Feb 2017 19:23:19 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:41042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgKiE-0002VT-57 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 19:23:18 -0500 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 03F1C745A81AA for ; Wed, 22 Feb 2017 00:23:05 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 22 Feb 2017 00:23:09 +0000 From: Yongbok Kim To: Date: Wed, 22 Feb 2017 00:21:02 +0000 Message-ID: <1487722868-9111-3-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1487722868-9111-1-git-send-email-yongbok.kim@imgtec.com> References: <1487722868-9111-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL v2 2/8] hw/mips_gictimer: provide API for retrieving frequency 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Paul Burton Provide a new function mips_gictimer_get_freq() which returns the frequency at which a GIC timer will count. This will be useful for boards which perform setup based upon this frequency. Signed-off-by: Paul Burton Reviewed-by: Leon Alrae Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Yongbok Kim --- hw/timer/mips_gictimer.c | 5 +++++ include/hw/timer/mips_gictimer.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/timer/mips_gictimer.c b/hw/timer/mips_gictimer.c index 3698889..f5c5806 100644 --- a/hw/timer/mips_gictimer.c +++ b/hw/timer/mips_gictimer.c @@ -14,6 +14,11 @@ =20 #define TIMER_PERIOD 10 /* 10 ns period for 100 Mhz frequency */ =20 +uint32_t mips_gictimer_get_freq(MIPSGICTimerState *gic) +{ + return NANOSECONDS_PER_SECOND / TIMER_PERIOD; +} + static void gic_vptimer_update(MIPSGICTimerState *gictimer, uint32_t vp_index, uint64_t now) { diff --git a/include/hw/timer/mips_gictimer.h b/include/hw/timer/mips_gicti= mer.h index c8bc5d2..c7ca6c8 100644 --- a/include/hw/timer/mips_gictimer.h +++ b/include/hw/timer/mips_gictimer.h @@ -31,6 +31,7 @@ struct MIPSGICTimerState { MIPSGICTimerCB *cb; }; =20 +uint32_t mips_gictimer_get_freq(MIPSGICTimerState *gic); uint32_t mips_gictimer_get_sh_count(MIPSGICTimerState *gic); void mips_gictimer_store_sh_count(MIPSGICTimerState *gic, uint64_t count); uint32_t mips_gictimer_get_vp_compare(MIPSGICTimerState *gictimer, --=20 2.7.4