From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 5/5] xen/arm: Add OMAP5 architected timer initialization codes. Date: Thu, 08 Aug 2013 11:12:39 +0100 Message-ID: <52036F17.5070006@linaro.org> References: <1375885131-32743-1-git-send-email-baozich@gmail.com> <1375885131-32743-6-git-send-email-baozich@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chen Baozi Cc: Ian Campbell , Andrii Anisov , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 08/08/2013 09:58 AM, Chen Baozi wrote: > > On Aug 8, 2013, at 4:31 PM, Andrii Anisov wrote: > >> diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c >> index 4ed7882..104aefc 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); >> >> I would suggest to extract this into a separate patch. This chunk is a generic improvement to add support of dt specified clock freq, while all the rest is a platform specific. > > I'm OK with it. What's your opinion, Julien? I'm OK with Andrii. It's better to have only one functionality per patch. Cheers, -- Julien Grall