All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yongbok Kim <yongbok.kim@imgtec.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL v2 2/8] hw/mips_gictimer: provide API for retrieving frequency
Date: Wed, 22 Feb 2017 00:21:02 +0000	[thread overview]
Message-ID: <1487722868-9111-3-git-send-email-yongbok.kim@imgtec.com> (raw)
In-Reply-To: <1487722868-9111-1-git-send-email-yongbok.kim@imgtec.com>

From: Paul Burton <paul.burton@imgtec.com>

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 <paul.burton@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
---
 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 @@
 
 #define TIMER_PERIOD 10 /* 10 ns period for 100 Mhz frequency */
 
+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_gictimer.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;
 };
 
+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,
-- 
2.7.4

  parent reply	other threads:[~2017-02-22  0:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22  0:21 [Qemu-devel] [PULL v2 0/8] target-mips queue Yongbok Kim
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 1/8] hw/mips_cmgcr: allow GCR base to be moved Yongbok Kim
2017-02-22  0:21 ` Yongbok Kim [this message]
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 3/8] hw/mips_gic: Update pin state on mask changes Yongbok Kim
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 4/8] target-mips: Provide function to test if a CPU supports an ISA Yongbok Kim
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 5/8] dtc: Update requirement to v1.4.2 Yongbok Kim
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 6/8] loader: Support Flattened Image Trees (FIT images) Yongbok Kim
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 7/8] hw: xilinx-pcie: Add support for Xilinx AXI PCIe Controller Yongbok Kim
2018-06-04 10:29   ` Peter Maydell
2018-06-06 20:23     ` Paul Burton
2018-06-06 21:58       ` Peter Maydell
2017-02-22  0:21 ` [Qemu-devel] [PULL v2 8/8] hw/mips: MIPS Boston board support Yongbok Kim
2017-02-23 18:09   ` Peter Maydell
2017-02-24  0:25     ` Yongbok Kim
2017-02-24 10:13       ` Peter Maydell
2017-02-23 12:46 ` [Qemu-devel] [PULL v2 0/8] target-mips queue Peter Maydell
2017-03-16 15:03   ` Peter Maydell
2017-03-16 16:25     ` Yongbok Kim
2017-03-16 16:28       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487722868-9111-3-git-send-email-yongbok.kim@imgtec.com \
    --to=yongbok.kim@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.