From: Chen Baozi <baozich@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
Julien Grall <julien.grall@linaro.org>,
Andrii Anisov <andrii.anisov@globallogic.com>
Cc: Chen Baozi <baozich@gmail.com>,
Xen Developer List <xen-devel@lists.xen.org>
Subject: [PATCH v5 4/5] xen/arm: Add support for device tree specified arch_timer clock frequency.
Date: Thu, 8 Aug 2013 18:52:24 +0800 [thread overview]
Message-ID: <1375959145-13709-5-git-send-email-baozich@gmail.com> (raw)
In-Reply-To: <1375959145-13709-1-git-send-email-baozich@gmail.com>
Signed-off-by: Chen Baozi <baozich@gmail.com>
---
xen/arch/arm/time.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 4ed7882..9a1b080 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;
+ u32 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;
+ res = dt_property_read_u32(dev, "clock-frequency", &rate);
+ if ( res )
+ cpu_khz = rate / 1000;
+ else
+ cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
boot_count = READ_SYSREG64(CNTPCT_EL0);
printk("Using generic timer at %lu KHz\n", cpu_khz);
--
1.8.1.4
next prev parent reply other threads:[~2013-08-08 10:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-08 10:52 [PATCH v5 0/5] Add UART support and arch timer initialization for OMAP5 Chen Baozi
2013-08-08 10:52 ` [PATCH v5 1/5] xen: rename ns16550-uart.h to 8250-uart.h and fix some typos Chen Baozi
2013-08-08 10:52 ` [PATCH v5 2/5] xen/arm: add 8250 compatible UART support for early_printk Chen Baozi
2013-08-08 11:34 ` Ian Campbell
2013-08-08 11:36 ` Ian Campbell
2013-08-08 12:04 ` Chen Baozi
2013-08-08 12:06 ` Julien Grall
2013-08-08 12:17 ` Chen Baozi
2013-08-08 12:32 ` Chen Baozi
2013-08-08 12:54 ` Ian Campbell
2013-08-08 10:52 ` [PATCH v5 3/5] xen/arm: Add the new OMAP UART driver Chen Baozi
2013-08-08 11:41 ` Ian Campbell
2013-08-08 11:58 ` Chen Baozi
2013-08-08 12:03 ` Ian Campbell
2013-08-08 10:52 ` Chen Baozi [this message]
2013-08-08 12:18 ` [PATCH v5 4/5] xen/arm: Add support for device tree specified arch_timer clock frequency Ian Campbell
2013-08-08 12:41 ` Julien Grall
2013-08-08 12:45 ` Ian Campbell
2013-08-08 10:52 ` [PATCH v5 5/5] xen/arm: Platform recognition and initialize arch_timer for the OMAP5 Chen Baozi
2013-08-08 12:18 ` Ian Campbell
2013-08-08 12:23 ` Chen Baozi
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=1375959145-13709-5-git-send-email-baozich@gmail.com \
--to=baozich@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=andrii.anisov@globallogic.com \
--cc=julien.grall@linaro.org \
--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).