qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/7] hw/arm_mptimer.c: Turn ARM MPcore private t


From: Evgeny Voevodin
Subject: Re: [Qemu-devel] [PATCH 1/7] hw/arm_mptimer.c: Turn ARM MPcore private timers into qdev devices
Date: Fri, 13 Jan 2012 11:18:23 +0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16

On 12/05/2011 08:40 PM, Peter Maydell wrote:
-/* Return conversion factor from mpcore timer ticks to qemu timer ticks.  */
-static inline uint32_t mpcore_timer_scale(mpcore_timer_state *s)
-{
-    return (((s->control>>  8)&  0xff) + 1) * 10;
-}

Dear Peter, could you please explain why such a conversion used to gain qemu ticks from mpcore timer ticks, actually why to multiply by 10? AFAIK by default to get timer ticks QEMU uses host's time. Also cortex documentation says that mpcore timer tick interval should be calculated in this way: ((prescaler + 1) * (load + 1))/freq
Later mpcore_timer_reload uses this code to update QEMU ticks:

-    s->tick += (int64_t)s->count * mpcore_timer_scale(s);

I see that equation has transformed to: (prescaler * load) * 10
As I understand, this means that arm core internal timer is working at frequency 10 times less (in ideal) then host.

--
Kind regards,
Evgeny Voevodin,
Leading Software Engineer,
ASWG, Moscow R&D center, Samsung Electronics
e-mail: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]