devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: tmaimon77@gmail.com, linus.walleij@linaro.org, nsekhar@ti.com,
	guoren@kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	heiko@sntech.de, linux-samsung-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org, khilman@baylibre.com,
	ludovic.desroches@microchip.com, linux-imx@nxp.com,
	u.kleine-koenig@pengutronix.de,
	uclinux-h8-devel@lists.sourceforge.jp, marc.zyngier@arm.com,
	s.hauer@pengutronix.de, linux-unisoc@lists.infradead.org,
	khalasa@piap.pl, tglx@linutronix.de, sbranden@broadcom.com,
	linux-kernel@vger.kernel.org, ralf@linux-mips.org,
	paul.burton@mips.com, kernel@pengutronix.de,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	mark.rutland@arm.com, jhogan@kernel.org, palmer@sifive.com,
	eric@anholt.net, thierry.reding@gmail.com,
	manivannan.sadhasivam@linaro.org, ysato@users.sourceforge.jp,
	zhang.lyra@gmail.com, daniel.lezcano@linaro.org,
	jonathanh@nvidia.com, bgolasze
Subject: Re: [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection
Date: Wed, 11 Sep 2019 11:14:58 +0200	[thread overview]
Message-ID: <20190911091458.GD21254@piout.net> (raw)
In-Reply-To: <81da473f-54d7-2a00-61ec-9351cdfcaaf3@baylibre.com>

On 11/09/2019 09:34:27+0200, Neil Armstrong wrote:
> Hi,
> 
> On 10/09/2019 15:47, Claudiu Beznea wrote:
> > From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > 
> > Some timer drivers may behave either as clocksource or clockevent
> > or both. Until now, in case of platforms with multiple hardware
> > resources of the same type, the drivers were chosing the first
> > registered hardware resource as clocksource/clockevent and the
> > next one as clockevent/clocksource. Other were using different
> > compatibles (one for each functionality, although its about the
> > same hardware). Add DT bindings to be able to choose the
> > functionality of a timer.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> > ---
> >  Documentation/devicetree/bindings/chosen.txt | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/chosen.txt b/Documentation/devicetree/bindings/chosen.txt
> > index 45e79172a646..aad3034cdbdf 100644
> > --- a/Documentation/devicetree/bindings/chosen.txt
> > +++ b/Documentation/devicetree/bindings/chosen.txt
> > @@ -135,3 +135,23 @@ e.g.
> >  		linux,initrd-end = <0x82800000>;
> >  	};
> >  };
> > +
> > +linux,clocksource and linux,clockevent
> > +--------------------------------------
> > +
> > +Those nodes have a timer property. This property is a phandle to the timer to be
> > +chosen as the clocksource or clockevent. This is only useful when the platform
> > +has multiple identical timers and it is not possible to let linux make the
> > +correct choice.
> > +
> > +/ {
> > +	chosen {
> > +		linux,clocksource {
> > +			timer = <&timer0>;
> > +		};
> > +
> > +		linux,clockevent {
> > +			timer = <&timer1>;
> > +		};
> > +	};
> > +};
> > 
> 
> Why not in aliases ?
> 
> aliases {
>     clocksource0 = &timer0;
>     clockevent0 = &timer1;
> };
> 
> since we can have multiple of each, we should not limit ourselves to 1 clkevent
> and 1 clksource.
> 
> In the aliases case, each driver would expose both capabilities, and the core would select
> what to enable.
> 

For extendability, you need nodes for that because at some point, you
may need to also be able to select the timer frequency. You can't do
that with an alias.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-09-11  9:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 13:47 [PATCH 0/7] add support for clocksource/clockevent DT selection Claudiu Beznea
2019-09-10 13:47 ` [PATCH 1/7] clocksource/drivers/c-sky: request timer_of_init only for probing CPU Claudiu Beznea
2019-09-10 13:47 ` [PATCH 2/7] clocksource: change timer registration macros Claudiu Beznea
2019-09-10 14:49   ` Marc Zyngier
2019-09-10 14:57     ` Claudiu.Beznea
2019-09-10 13:47 ` [PATCH 3/7] clocksource/timer_of: use BIT() macro Claudiu Beznea
2019-09-10 13:47 ` [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection Claudiu Beznea
2019-09-10 14:32   ` Sudeep Holla
2019-09-10 14:51     ` Claudiu.Beznea
2019-09-10 15:08       ` Sudeep Holla
2019-09-10 15:10         ` Alexandre Belloni
2019-09-11  0:03           ` Linus Walleij
2019-09-11  7:18             ` Claudiu.Beznea
2019-09-12 14:18               ` Linus Walleij
2019-09-30 14:32               ` Rob Herring
2019-10-02 13:32                 ` Claudiu.Beznea
2019-09-11  7:34   ` Neil Armstrong
2019-09-11  9:14     ` Alexandre Belloni [this message]
2019-09-10 13:47 ` [PATCH 5/7] clocksource/drivers/timer-of: add support support for timer's functionalities Claudiu Beznea
2019-09-10 13:47 ` [PATCH 6/7] drivers/clocksource/timer-of: keep declaration on one line Claudiu Beznea
2019-09-10 13:47 ` [PATCH 7/7] clocksource/drivers/integrator-ap: parse the chosen node Claudiu Beznea
2019-09-10 23:48   ` Linus Walleij
2019-09-11  7:14     ` Claudiu.Beznea
2019-09-10 16:05 ` [PATCH 0/7] add support for clocksource/clockevent DT selection John Stultz
2019-09-11  6:52   ` Claudiu.Beznea
2019-09-11 16:06     ` John Stultz
2019-09-25 17:19 ` Daniel Lezcano
2019-09-26  8:42   ` Claudiu.Beznea
2019-10-02 13:35     ` Claudiu.Beznea
2019-10-03 10:43       ` Claudiu.Beznea
2019-10-13 18:16         ` Daniel Lezcano
2019-10-15  9:23           ` Claudiu.Beznea
2019-10-18 20:24             ` Daniel Lezcano
2019-10-21  8:58               ` Claudiu.Beznea
2019-10-21 14:17                 ` Daniel Lezcano

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=20190911091458.GD21254@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=eric@anholt.net \
    --cc=guoren@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jhogan@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=khalasa@piap.pl \
    --cc=khilman@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-unisoc@lists.infradead.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=narmstrong@baylibre.com \
    --cc=nsekhar@ti.com \
    --cc=palmer@sifive.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sbranden@broadcom.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=uclinux-h8-devel@lists.sourceforge.jp \
    --cc=ysato@users.sourceforge.jp \
    --cc=zhang.lyra@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).