diff options
author | Paul Burton | 2016-09-08 16:51:52 +0200 |
---|---|---|
committer | Yongbok Kim | 2017-02-21 23:24:58 +0100 |
commit | eb90ab9437ebb2dea77ebdf6c96488841ddbdd85 (patch) | |
tree | bf55c239770cffee9c3e7bf1412482468b5bbb1a /hw/timer | |
parent | hw/mips_cmgcr: allow GCR base to be moved (diff) | |
download | qemu-eb90ab9437ebb2dea77ebdf6c96488841ddbdd85.tar.gz qemu-eb90ab9437ebb2dea77ebdf6c96488841ddbdd85.tar.xz qemu-eb90ab9437ebb2dea77ebdf6c96488841ddbdd85.zip |
hw/mips_gictimer: provide API for retrieving frequency
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>
Diffstat (limited to 'hw/timer')
-rw-r--r-- | hw/timer/mips_gictimer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/timer/mips_gictimer.c b/hw/timer/mips_gictimer.c index 3698889475..f5c5806724 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) { |