From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Armstrong Subject: Re: [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection Date: Wed, 11 Sep 2019 09:34:27 +0200 Message-ID: <81da473f-54d7-2a00-61ec-9351cdfcaaf3@baylibre.com> References: <1568123236-767-1-git-send-email-claudiu.beznea@microchip.com> <1568123236-767-5-git-send-email-claudiu.beznea@microchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1568123236-767-5-git-send-email-claudiu.beznea@microchip.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Claudiu Beznea , daniel.lezcano@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, nsekhar@ti.com, bgolaszewski@baylibre.com, monstr@monstr.eu, john@phrozen.org, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, lftan@altera.com, tglx@linutronix.de, vgupta@synopsys.com, marc.zyngier@arm.com, patrice.chotard@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, eric@anholt.net, wahrenst@gmx.net, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linus.walleij@linaro.org, shc_work@mail.ru, kgene@kernel.org, krzk@kernel.org, ysato@users.sourceforge.jp, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, s.hauer@pen Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-snps-arc@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-amlogic@lists.infradead.org, openbmc@lists.ozlabs.org, linux-oxnas@groups.io, linux-arm-msm@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-riscv@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org List-Id: devicetree@vger.kernel.org Hi, On 10/09/2019 15:47, Claudiu Beznea wrote: > From: Alexandre Belloni > > 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 > Signed-off-by: Claudiu Beznea > --- > 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. Neil