[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] hw/mips_gictimer: provide API for retrieving fr
From: |
Paul Burton |
Subject: |
[Qemu-devel] [PATCH 2/7] hw/mips_gictimer: provide API for retrieving frequency |
Date: |
Fri, 19 Aug 2016 20:08:58 +0100 |
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 <address@hidden>
---
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.9.3
- [Qemu-devel] [PATCH 0/7] MIPS Boston board support, Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 1/7] hw/mips_cmgcr: allow GCR base to be moved, Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 2/7] hw/mips_gictimer: provide API for retrieving frequency,
Paul Burton <=
- [Qemu-devel] [PATCH 3/7] hw/mips_gic: Update pin state on mask changes, Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 4/7] target-mips: Provide function to test if a CPU supports an ISA, Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 5/7] loader: Support Flattened Image Trees (FIT images), Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 6/7] hw: xilinx-pcie: Add support for Xilinx AXI PCIe Controller, Paul Burton, 2016/08/19
- [Qemu-devel] [PATCH 7/7] hw/mips: MIPS Boston board support, Paul Burton, 2016/08/19
- Re: [Qemu-devel] [PATCH 0/7] MIPS Boston board support, no-reply, 2016/08/19