linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lubomir Rintel <lkundrak@v3.sk>
To: Rob Herring <robh+dt@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	devicetree@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mark Rutland <mark.rutland@arm.com>,
	Eric Miao <eric.y.miao@gmail.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH 1/4] dt-bindings: mrvl,mmp-timer: add clock
Date: Tue, 11 Sep 2018 15:19:30 +0200	[thread overview]
Message-ID: <3ab50e5f4c647229b575bc5de5e80f9ed80ac938.camel@v3.sk> (raw)
In-Reply-To: <CAL_JsqKgJFZnpuv7rW6ovxMKi4Q2AngWxKa=CMR_Y+xD5Oh3GA@mail.gmail.com>

On Mon, 2018-09-10 at 10:21 -0500, Rob Herring wrote:
> On Mon, Sep 10, 2018 at 6:30 AM Lubomir Rintel <lkundrak@v3.sk>
> wrote:
> > 
> > The timer needs the timer clock to be enabled, otherwise it stops
> > ticking.
> > 
> > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > ---
> >  Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/timer/mrvl,mmp-
> > timer.txt b/Documentation/devicetree/bindings/timer/mrvl,mmp-
> > timer.txt
> > index 9a6e251462e7..a2ede0bd12ca 100644
> > --- a/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
> > +++ b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
> > @@ -4,10 +4,12 @@ Required properties:
> >  - compatible : Should be "mrvl,mmp-timer".
> >  - reg : Address and length of the register set of timer
> > controller.
> >  - interrupts : Should be the interrupt number.
> > +- clocks : Should contain a single entry describing the clock
> > input.
> 
> So now pxa910 and pxa168 dts files have errors because they are
> missing a required clock.

Ah, right. Sorry. Will make it optional then.

A brief look at 16x datasheet suggests that the "fast clock" source
circuitry needs to be enabled in the PMU, whereas the internal "32.768"
might not be. Perhaps the timer clk is always enabled in PMU, or the
slow clock is used on those platforms? No idea.

> Plus somehow other MMP2 platforms either
> worked without a clock or have been broken.

I don't have a MMP2 datasheet, but if things work the same as on a 16x,
then mach-mmp/time.c indeed chooses the fast timer.

The DT MMP2 platform certainly is certainly broken*. Not sure about the
BSP-based platforms.

* in other ways too: even when the missing clock is worked around with
  "clk_ignore_unused" the wrong rate gets chosen and the timer runs too
  slow. (Fix posted recently.)

> You can't add new required properties to a binding. That breaks
> backward compatibility.

Should I make an effort to make the driver look up and enable the clock
on MMP2 even if it doesn't find the clock property in DT?

It won't work otherwise, which is why I thought I can't break it
further (I didn't notice that the same binding and driver are used on
PXA168 and PXA910).

> Rob

Thank you,
Lubo

> > 
> >  Example:
> >         timer0: timer@d4014000 {
> >                 compatible = "mrvl,mmp-timer";
> >                 reg = <0xd4014000 0x100>;
> >                 interrupts = <13>;
> > +               clocks = <&coreclk 2>;
> >         };
> > --
> > 2.17.1
> > 


  reply	other threads:[~2018-09-11 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 11:30 [PATCH 0/4] Enable the timer clock on DT MMP2 Lubomir Rintel
2018-09-10 11:30 ` [PATCH 1/4] dt-bindings: mrvl,mmp-timer: add clock Lubomir Rintel
2018-09-10 15:21   ` Rob Herring
2018-09-11 13:19     ` Lubomir Rintel [this message]
2018-09-10 11:30 ` [PATCH 2/4] DT: marvell,mmp2: add clock to the timer Lubomir Rintel
2018-09-10 11:30 ` [PATCH 3/4] ARM: mmp2: initialize clocks before " Lubomir Rintel
2018-09-10 11:30 ` [PATCH 4/4] ARM: mmp/mmp2: dt: enable the clock Lubomir Rintel

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=3ab50e5f4c647229b575bc5de5e80f9ed80ac938.camel@v3.sk \
    --to=lkundrak@v3.sk \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /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).