From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbcBPIr3 (ORCPT ); Tue, 16 Feb 2016 03:47:29 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:51036 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbcBPIr1 (ORCPT ); Tue, 16 Feb 2016 03:47:27 -0500 Subject: Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings To: Rob Herring References: <1454410739-24444-1-git-send-email-vgupta@synopsys.com> <1454410739-24444-3-git-send-email-vgupta@synopsys.com> <20160202220353.GA10273@rob-hp-laptop> CC: arcml , Alexey Brodkin , Noam Camus , lkml , Daniel Lezcano , "devicetree@vger.kernel.org" From: Vineet Gupta Message-ID: <56C2E164.8020004@synopsys.com> Date: Tue, 16 Feb 2016 14:14:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.197.208] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 03 February 2016 09:09 PM, Rob Herring wrote: > On Wed, Feb 3, 2016 at 2:04 AM, Vineet Gupta wrote: >> Hi Rob, >> >> On Wednesday 03 February 2016 03:33 AM, Rob Herring wrote: >>> On Tue, Feb 02, 2016 at 04:28:52PM +0530, Vineet Gupta wrote: >>>> +Required properties: >>>> + >>>> +- compatible : should be "snps,arc-timer0" >>> >>> timer0 and timer1 are different h/w blocks, not just different >>> instances? >> >> Functionality wise they are identical (only the address of aux regs used to >> program them are different). Either can be configured to interrupt-on-limit or >> free-run-and-wrap-around. So we can indeed consider them 2 instances. ARC Linux >> uses timer0 for tick handling, timer1 for gtod. >> >> Do you prefer they not be differentiated as timer0 and timer1 ? >> >> So we have >> >> CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer0", arc_clockevent_setup); >> CLOCKSOURCE_OF_DECLARE(arc_timer1, "snps,arc-timer1", arc_cs_setup_timer1); >> >> I don't know how to achieve above, by keeping the DT names the same. > > You just need a single CLOCKSOURCE_OF_DECLARE which will be called > twice. On the first call, setup one timer and on the 2nd call setup > the other one. IIRC the sp804 timer has something similar. > > You'll need a unit address in the node name to distinguish them. So this is just to distinguish them in DT, but the callback uses a static counter to do 1st vs. 2nd (and this unit address is not really exposed to code) - correct ? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Date: Tue, 16 Feb 2016 14:14:20 +0530 Message-ID: <56C2E164.8020004@synopsys.com> References: <1454410739-24444-1-git-send-email-vgupta@synopsys.com> <1454410739-24444-3-git-send-email-vgupta@synopsys.com> <20160202220353.GA10273@rob-hp-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Herring Cc: arcml , Alexey Brodkin , Noam Camus , lkml , Daniel Lezcano , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org On Wednesday 03 February 2016 09:09 PM, Rob Herring wrote: > On Wed, Feb 3, 2016 at 2:04 AM, Vineet Gupta wrote: >> Hi Rob, >> >> On Wednesday 03 February 2016 03:33 AM, Rob Herring wrote: >>> On Tue, Feb 02, 2016 at 04:28:52PM +0530, Vineet Gupta wrote: >>>> +Required properties: >>>> + >>>> +- compatible : should be "snps,arc-timer0" >>> >>> timer0 and timer1 are different h/w blocks, not just different >>> instances? >> >> Functionality wise they are identical (only the address of aux regs used to >> program them are different). Either can be configured to interrupt-on-limit or >> free-run-and-wrap-around. So we can indeed consider them 2 instances. ARC Linux >> uses timer0 for tick handling, timer1 for gtod. >> >> Do you prefer they not be differentiated as timer0 and timer1 ? >> >> So we have >> >> CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer0", arc_clockevent_setup); >> CLOCKSOURCE_OF_DECLARE(arc_timer1, "snps,arc-timer1", arc_cs_setup_timer1); >> >> I don't know how to achieve above, by keeping the DT names the same. > > You just need a single CLOCKSOURCE_OF_DECLARE which will be called > twice. On the first call, setup one timer and on the 2nd call setup > the other one. IIRC the sp804 timer has something similar. > > You'll need a unit address in the node name to distinguish them. So this is just to distinguish them in DT, but the callback uses a static counter to do 1st vs. 2nd (and this unit address is not really exposed to code) - correct ? -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet.Gupta1@synopsys.com (Vineet Gupta) Date: Tue, 16 Feb 2016 14:14:20 +0530 Subject: [PATCH 2/9] ARC: [dts] Introduce Timer bindings In-Reply-To: References: <1454410739-24444-1-git-send-email-vgupta@synopsys.com> <1454410739-24444-3-git-send-email-vgupta@synopsys.com> <20160202220353.GA10273@rob-hp-laptop> List-ID: Message-ID: <56C2E164.8020004@synopsys.com> To: linux-snps-arc@lists.infradead.org On Wednesday 03 February 2016 09:09 PM, Rob Herring wrote: > On Wed, Feb 3, 2016@2:04 AM, Vineet Gupta wrote: >> Hi Rob, >> >> On Wednesday 03 February 2016 03:33 AM, Rob Herring wrote: >>> On Tue, Feb 02, 2016@04:28:52PM +0530, Vineet Gupta wrote: >>>> +Required properties: >>>> + >>>> +- compatible : should be "snps,arc-timer0" >>> >>> timer0 and timer1 are different h/w blocks, not just different >>> instances? >> >> Functionality wise they are identical (only the address of aux regs used to >> program them are different). Either can be configured to interrupt-on-limit or >> free-run-and-wrap-around. So we can indeed consider them 2 instances. ARC Linux >> uses timer0 for tick handling, timer1 for gtod. >> >> Do you prefer they not be differentiated as timer0 and timer1 ? >> >> So we have >> >> CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer0", arc_clockevent_setup); >> CLOCKSOURCE_OF_DECLARE(arc_timer1, "snps,arc-timer1", arc_cs_setup_timer1); >> >> I don't know how to achieve above, by keeping the DT names the same. > > You just need a single CLOCKSOURCE_OF_DECLARE which will be called > twice. On the first call, setup one timer and on the 2nd call setup > the other one. IIRC the sp804 timer has something similar. > > You'll need a unit address in the node name to distinguish them. So this is just to distinguish them in DT, but the callback uses a static counter to do 1st vs. 2nd (and this unit address is not really exposed to code) - correct ?