diff options
author | Chen Baozi <baozich@gmail.com> | 2013-08-08 18:52:24 +0800 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-08-08 12:43:19 +0100 |
commit | dd11cc89c5ba53ae8d969037eda8b8c70d20ffa6 (patch) | |
tree | cc3949932d75b2a9996ebb8458d2c158c9d157cd /xen | |
parent | 1242b63dd1a4321acd2b02051f210a3488265709 (diff) | |
download | xen-dd11cc89c5ba53ae8d969037eda8b8c70d20ffa6.tar.gz xen-dd11cc89c5ba53ae8d969037eda8b8c70d20ffa6.tar.bz2 xen-dd11cc89c5ba53ae8d969037eda8b8c70d20ffa6.zip |
xen/arm: Add support for device tree specified arch_timer clock frequency.
Signed-off-by: Chen Baozi <baozich@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/arch/arm/time.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c index 4ed7882722..9a1b080489 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); |