From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Figa Subject: Re: [PATCH v2 1/2] clk/zynq/clkc: Add 'fclk-enable' feature Date: Mon, 28 Oct 2013 23:17:42 +0100 Message-ID: <2028580.HhySWWnU2A@flatron> References: <1381425018-5653-1-git-send-email-soren.brinkmann@xilinx.com> <1592656.1ojHcSlzVh@flatron> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: =?ISO-8859-1?Q?S=F6ren?= Brinkmann Cc: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Rob Landley , Russell King , Mike Turquette , Michal Simek , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org List-Id: devicetree@vger.kernel.org On Monday 28 of October 2013 14:43:35 S=F6ren Brinkmann wrote: > On Mon, Oct 28, 2013 at 10:13:28PM +0100, Tomasz Figa wrote: > > Hi Soren, > >=20 > > On Thursday 10 of October 2013 10:10:17 Soren Brinkmann wrote: > > > In some use cases Zynq's FPGA clocks are used as static clock > > > generators for IP in the FPGA part of the SOC for which no Linux > > > driver > > > exists and would control those clocks. To avoid automatic > > > gating of these clocks in such cases a new property - fclk-enable= - > > > is > > > added to the clock controller's DT description to accomodate such > > > use > > > cases. It's value is a bitmask, where a set bit results in enabli= ng > > > the corresponding FCLK through the clkc. > > >=20 > > > FPGA clocks are handled following the rules below: > > >=20 > > > If an FCLK is not enabled by bootloaders, that FCLK will be disab= led > > > in > > > Linux. Drivers can enable and control it through the CCF as usual= =2E > > >=20 > > > If an FCLK is enabled by bootloaders AND the corresponding bit in > > > the > > > 'fclk-enable' DT property is set, that FCLK will be enabled by th= e > > > clkc, resulting in an off by one reference count for that clock. > > > Ensuring it will always be running. > > >=20 > > > Signed-off-by: Soren Brinkmann > > > --- > > >=20 > > > v2: > > > - change default value for fclk-enable to '0' > > >=20 > > > --- > > >=20 > > > Documentation/devicetree/bindings/clock/zynq-7000.txt | 4 ++++ > > > drivers/clk/zynq/clkc.c | 18 > > >=20 > > > +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions= (-) > > >=20 > > > diff --git a/Documentation/devicetree/bindings/clock/zynq-7000.tx= t > > > b/Documentation/devicetree/bindings/clock/zynq-7000.txt index > > > d99af878f5d7..11fdd146ec83 100644 > > > --- a/Documentation/devicetree/bindings/clock/zynq-7000.txt > > > +++ b/Documentation/devicetree/bindings/clock/zynq-7000.txt > > >=20 > > > @@ -22,6 +22,10 @@ Required properties: > > > Optional properties: > > > - clocks : as described in the clock bindings > > > - clock-names : as described in the clock bindings > > >=20 > > > + - fclk-enable : Bit mask to enable FCLKs in cases no proper CCF > >=20 > > Since it's a vendor specific property, it should include vendor > > prefix. >=20 > The whole driver is vendor specific. Should there really be another > prefix for that property? Yes. If a property is introduced just for use by this particular driver= =20 then it must be prepended by a vendor prefix. That's a general rule. > > Also CCF is a Linux-specific implementation detail, which DT bindin= gs > > should not be involved into. If you really need to implement this > > using > > this way, then at least property description should say something l= ike > > this: > >=20 > > xlnx,fclk-enable : Bit mask of bits of fclk enable register that mu= st > > be statically enabled at boot-up time. >=20 > Fair enough. I'll change the description >=20 > > However, I wonder why you can't simply define an FPGA block using a > > single node, which would be a consumer to all the fclk clocks you > > need to enable and then make a driver for it that would simply enab= le > > all clocks specified in clocks property. >=20 > Well, then we'd have a dummy driver that wouldn't fit into any subsys= tem > and wouldn't do anything but enabling clocks. Seems much easier to > handle it in this driver. Especially, since I hope that this is just = a > workaround and that the majority of use cases involves drivers for > their soft-IP that simply uses the CCF. Hmm, I'm not really convinced, but well, let's say that I'm fine with y= our=20 proposed solution, unless someone else complains. Best regards, Tomasz