From: Julien Grall <julien.grall@linaro.org>
To: Andrii Anisov <andrii.anisov@globallogic.com>
Cc: Chen Baozi <baozich@gmail.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 5/5] xen/arm: Add OMAP5 architected timer initialization codes.
Date: Wed, 07 Aug 2013 12:37:10 +0100 [thread overview]
Message-ID: <52023166.20002@linaro.org> (raw)
In-Reply-To: <CAGQvs6gdK0qKybNf0Kq3P9VUmSB6CKvb4zwgrWuXz36-AEVdbQ@mail.gmail.com>
On 08/07/2013 11:25 AM, Andrii Anisov wrote:
>
> >> diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
> >> index 4ed7882..6ca030a 100644
> >> --- a/xen/arch/arm/time.c
> >> +++ b/xen/arch/arm/time.c
> >> @@ -104,6 +104,7 @@ int __init init_xen_time(void)
> >> struct dt_device_node *dev;
> >> int res;
> >> unsigned int i;
> >> + const __be32 *rate;
> >>
> >> dev = dt_find_compatible_node(NULL, NULL, "arm,armv7-timer");
> >> if ( !dev )
> >> @@ -134,7 +135,11 @@ int __init init_xen_time(void)
> >> if ( !cpu_has_gentimer )
> >> panic("CPU does not support the Generic Timer v1
> interface.\n");
> >>
> >> - cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
> >> + rate = dt_get_property(dev, "clock-frequency", NULL);
> >
> > You need to check if the length match the size of rate.
> > Perhaps, you can add an helper dt_property_read_u32 (see
> > linux/include/linux/of.h).
>
> OK.
>
>
> I would propose another approach here: just let cpu_khz be set up by
> architecture code.
Linux uses the same approach as Chen.
>From linux/Documentation/devicetree/bindings/arm/arch_timer.txt:
** Timer node properties:
- clock-frequency : The frequency of the main counter, in Hz. Optional.
As Xen uses the arch timer, which is common for all ARMv7 platform, why
does the platform code need to set up cpu_khz?
--
Julien
next prev parent reply other threads:[~2013-08-07 11:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 11:49 [PATCH 0/5] Add UART support and arch timer initialization for OMAP5 Chen Baozi
2013-08-05 11:49 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 1/5] xen: rename ns16550-uart.h to 8250-uart.h and fix some typos Chen Baozi
2013-08-05 11:49 ` [PATCH 2/5] xen/arm: add OMAP5432 UART support for early_printk Chen Baozi
2013-08-06 21:50 ` Julien Grall
2013-08-07 3:22 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 3/5] xen/arm: Add the new OMAP UART driver Chen Baozi
2013-08-06 19:14 ` Julien Grall
2013-08-07 3:14 ` Chen Baozi
2013-08-07 8:46 ` Ian Campbell
2013-08-07 11:08 ` Chen Baozi
2013-08-05 11:49 ` [PATCH 4/5] xen/arm: Introduce platform recognition codes for the OMAP5 Chen Baozi
2013-08-06 22:00 ` Julien Grall
2013-08-07 3:24 ` Chen Baozi
2013-08-07 11:21 ` Julien Grall
2013-08-05 11:49 ` [PATCH 5/5] xen/arm: Add OMAP5 architected timer initialization codes Chen Baozi
2013-08-06 22:14 ` Julien Grall
2013-08-07 3:28 ` Chen Baozi
2013-08-07 10:25 ` Andrii Anisov
2013-08-07 10:32 ` Andrii Anisov
2013-08-07 11:37 ` Julien Grall [this message]
2013-08-07 11:58 ` Andrii Anisov
2013-08-07 12:04 ` Andrii Anisov
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=52023166.20002@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=andrii.anisov@globallogic.com \
--cc=baozich@gmail.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).