From: Evgeny Voevodin <e.voevodin@samsung.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Bill Carson <bill4carson@gmail.com>,
Dmitry Solodkiy <d.solodkiy@samsung.com>,
qemu-devel@nongnu.org, patches@linaro.org
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 [thread overview]
Message-ID: <4F0FDABF.4070303@samsung.com> (raw)
In-Reply-To: <1323103220-1636-2-git-send-email-peter.maydell@linaro.org>
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: e.voevodin@samsung.com
next prev parent reply other threads:[~2012-01-13 7:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-05 16:40 [Qemu-devel] [PATCH 0/7] ARM: clean up mpcore.c and separate out A9 Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 1/7] hw/arm_mptimer.c: Turn ARM MPcore private timers into qdev devices Peter Maydell
2012-01-13 7:18 ` Evgeny Voevodin [this message]
2011-12-05 16:40 ` [Qemu-devel] [PATCH 2/7] hw/arm_gic: Expose GIC CPU interfaces as sysbus memory regions Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 3/7] hw/mpcore.c: Use the GIC memory regions for the CPU interface Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 4/7] hw/realview_gic: Use GIC memory region " Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 5/7] hw/mpcore: Clean up mpcore_priv_read/write as they are now SCU only Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 6/7] hw/a9mpcore.c: Implement A9MP peripherals rather than 11MPcore ones Peter Maydell
2011-12-05 16:40 ` [Qemu-devel] [PATCH 7/7] hw/mpcore.c: Merge with hw/arm11mpcore.c 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=4F0FDABF.4070303@samsung.com \
--to=e.voevodin@samsung.com \
--cc=bill4carson@gmail.com \
--cc=d.solodkiy@samsung.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--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.