From: Mark Rutland <mark.rutland@arm.com>
To: Chao Xie <chao.xie@marvell.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"xiechao.mail@gmail.com" <xiechao.mail@gmail.com>,
"haojian.zhuang@gmail.com" <haojian.zhuang@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/4] clocksource: mmp: add mmp timer driver
Date: Wed, 26 Mar 2014 10:41:37 +0000 [thread overview]
Message-ID: <20140326104137.GQ10341@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1395809563-31872-2-git-send-email-chao.xie@marvell.com>
On Wed, Mar 26, 2014 at 04:52:40AM +0000, Chao Xie wrote:
> From: Chao Xie <chao.xie@marvell.com>
>
> MMP timer is attached to APB bus, It has the following
> limitation.
> 1. When get count of timer counter, it need some delay
> to get a stable count.
> 2. When set match register, it need disable the counter
> first, and enable it after set the match register.
> The disabling need wait for 2 clock cycle to take
> effect.
>
> To improve above #1, shadow register for count is added.
> To improve above #2, CRSR register is added for quick updating.
>
> So there are three types of timer.
> timer1: old timer.
> timer2: old timer with shadow register.
> timer3: old timer with shadow and CRSR register.
>
> This timer driver will be used for many SOCes.
> 1. pxa168, pxa910, pxa988 pxa1088 have only timer1.
> 2. pxa1L88, pxa1U88 have timer1 and timer3.
> 3. pxa1928 has timer 2.
>
> The driver supports DT and non-DT initialization.
> The driver supports UP/SMP SOCes and 64 bit core.
>
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
> ---
> .../devicetree/bindings/arm/mrvl/timer.txt | 73 +-
> drivers/clocksource/Makefile | 1 +
> drivers/clocksource/timer-mmp.c | 866 +++++++++++++++++++++
> 3 files changed, 934 insertions(+), 6 deletions(-)
> create mode 100644 drivers/clocksource/timer-mmp.c
>
> diff --git a/Documentation/devicetree/bindings/arm/mrvl/timer.txt b/Documentation/devicetree/bindings/arm/mrvl/timer.txt
> index 9a6e251..b9af4bf 100644
> --- a/Documentation/devicetree/bindings/arm/mrvl/timer.txt
> +++ b/Documentation/devicetree/bindings/arm/mrvl/timer.txt
> @@ -1,13 +1,74 @@
> * Marvell MMP Timer controller
>
> +Each timer have multiple counters, so the timer DT need include counter's
> +description.
> +
> +1. Timer
> +
> Required properties:
> -- compatible : Should be "mrvl,mmp-timer".
> +- compatible : Should be "marvell,mmp-timer".
> - reg : Address and length of the register set of timer controller.
> -- interrupts : Should be the interrupt number.
> +- marvell,timer-id : The index of the timer. The timer controller may
> + include several timers.
Is this a single entry or a list?
> +- marvell,timer-fastclk-frequency : The fast clock frequency of the timer.
> + Timer will have several clock inputs: fast clock, 32KHZ, 1KHZ. For all
> + SOCes use this timer controller, fast clock may not be same.
> +- marvell,timer-apb-frequency : The fequency of the apb bus that the timer
> + attached to. This frequency and "marvell,timer-fastclk-frequency" are used
> + to calculated delay loops for clock operations.
Wouldn't these be better described as clock inputs?
> +
> +Optional properties:
> +- marvell,timer-has-crsr : This timer has CRSR register.
> +- marvell,timer-has-shadow : This timer has shadow register.
> +
> +2. Counter
> +
> +Required properties:
> +- compatible : It can be
> + "marvell,timer-counter-clkevt" : The counter is used for clock event
> + device.
> + "marvell,timer-counter-clksrc" : The counter is used for clock source.
> + "marvell,timer-counter-delay" : The counter is used for delay timer.
These are _not_ hardware properties. Why can the driver not choose how
to use each of the counter sub-blocks?
How would blocks with each of these strings actually differ?
> +- marvell,timer-counter-id : The counter index in this timer.
Perhaps use a reg for this?
>
> -Example:
> - timer0: timer@d4014000 {
> - compatible = "mrvl,mmp-timer";
> - reg = <0xd4014000 0x100>;
> +Optional properties:
> +- interrupts : The counters may have different IRQs or share same IRQs.
> + Only valid for "marvell,timer-counter-clkevt".
Describe what the interrupt is logically.
What is the interrupt logically?
> +- marvell,timer-counter-cpu : which CPU the counter is bound. Only valid for
> + "marvell,timer-counter-clkevt".
How is the counter bound to a particular CPU? Is there really a
relationship in hardware between a given CPU and counter?
> +- "marvell,timer-counter-rating" : The rating when register clock event device
> + or clock source. Only valid for "marvell,timer-counter-clkevt" and
> + "marvell,timer-counter-clksrc".
What does this mean? This seems like another leak of Linux internals.
> +- marvell,timer-counter-broadcast : When this counter acts as clock event
> + device. It is broadcast clock event device.
> + Only valid for "marvell,timer-counter-clkevt".
This does not seem like a hardware property. Why can Linux not decide
which counter (if any) to use as the broadcast source?
> +- marvell,timer-counter-nodynirq : When this counter acts as broadcast clock
> + event device, it cannot switch the IRQ of broadcast clock event to any CPU.
> + Only valid for "marvell,timer-counter-clkevt".
Likewise this does not sound like a hardware property.
Mark.
next prev parent reply other threads:[~2014-03-26 10:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 4:52 [PATCH 0/4] arm: mmp: timer driver Chao Xie
2014-03-26 4:52 ` [PATCH 1/4] clocksource: mmp: add mmp " Chao Xie
2014-03-26 10:41 ` Mark Rutland [this message]
[not found] ` <20140326104137.GQ10341-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-03-27 1:27 ` Chao Xie
2014-03-27 9:59 ` Mark Rutland
[not found] ` <20140327095925.GA13071-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-03-27 12:13 ` Chao Xie
[not found] ` <CADApbeidd5Kg9dhewfoCYy0PxGhR7C2C=2icmofEaaZz2ZLbNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-28 1:55 ` Chao Xie
[not found] ` <1395809563-31872-1-git-send-email-chao.xie-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
2014-03-26 4:52 ` [PATCH 2/4] arm: mmp: make SOCes without DT use new " Chao Xie
2014-03-26 4:52 ` [PATCH 3/4] arm: mmp: make SOCes with " Chao Xie
2014-03-26 4:52 ` [PATCH 4/4] arm: mmp: remove the old " Chao Xie
-- strict thread matches above, loose matches on Subject: below --
2015-02-02 8:31 [PATCH 0/4] drivers: clocksource: add mmp " Chao Xie
2015-02-02 8:31 ` [PATCH 1/4] clocksource: mmp: " Chao Xie
2015-02-02 10:34 ` Mark Rutland
[not found] <AAD1C6EB06EE3649B35B7E026785068D340D60B6DE@SC-VEXCH2.marvell.com>
[not found] ` <AAD1C6EB06EE3649B35B7E026785068D340D60B6DE-r8ILAu4/owtq65YQV0AP9hL4W9x8LtSr@public.gmane.org>
2015-02-03 1:25 ` Chao Xie
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=20140326104137.GQ10341@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=chao.xie@marvell.com \
--cc=devicetree@vger.kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=xiechao.mail@gmail.com \
/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).