Re: [RESEND PATCH 1/2 v6] clk/axs10x: Add I2S PLL clock driver

2016-05-03 Thread Rob Herring
On Mon, May 02, 2016 at 10:39:05AM +0100, Jose Abreu wrote:
> The ARC SDP I2S clock can be programmed using a
> specific PLL.
> 
> This patch has the goal of adding a clock driver
> that programs this PLL.
> 
> At this moment the rate values are hardcoded in
> a table but in the future it would be ideal to
> use a function which determines the PLL values
> given the desired rate.
> 
> Signed-off-by: Jose Abreu <joab...@synopsys.com>
> ---
> 
> Changes v5 -> v6:
> * Use parent clock to determine PLL input rate instead of using hardcoded 
> values
> * Documentation update (added 'clocks' field)
> 
> Changes v4 -> v5:
> * Documentation update (as suggested by Alexey Brodkin)
> * Changed compatible string to "snps,axs10x-i2s-pll-clock" (as suggested by 
> Alexey Brodkin)
> 
> Changes v3 -> v4:
> * Added binding document (as suggested by Stephen Boyd)
> * Minor code style fixes (as suggested by Stephen Boyd)
> * Use ioremap (as suggested by Stephen Boyd)
> * Implement round_rate (as suggested by Stephen Boyd)
> * Change to platform driver (as suggested by Stephen Boyd)
> * Use {readl/writel}_relaxed (as suggested by Vineet Gupta)
> 
> Changes v2 -> v3:
> * Implemented recalc_rate
> 
> Changes v1 -> v2:
> * Renamed folder to axs10x (as suggested by Alexey Brodkin)
> * Added more supported rates
> 
> Cc: Carlos Palminha <palmi...@synopsys.com>
> Cc: Rob Herring <r...@kernel.org>
> Cc: Pawel Moll <pawel.m...@arm.com>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Ian Campbell <ijc+devicet...@hellion.org.uk>
> Cc: Kumar Gala <ga...@codeaurora.org>
> Cc: Michael Turquette <mturque...@baylibre.com>
> Cc: Stephen Boyd <sb...@codeaurora.org>
> Cc: Alexey Brodkin <abrod...@synopsys.com>
> Cc: Vineet Gupta <vgu...@synopsys.com>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: devicet...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-...@vger.kernel.org
> 
>  .../bindings/clock/axs10x-i2s-pll-clock.txt|  25 +++

Acked-by: Rob Herring <r...@kernel.org>

>  drivers/clk/Makefile   |   1 +
>  drivers/clk/axs10x/Makefile|   1 +
>  drivers/clk/axs10x/i2s_pll_clock.c | 228 
> +
>  4 files changed, 255 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/clock/axs10x-i2s-pll-clock.txt
>  create mode 100644 drivers/clk/axs10x/Makefile
>  create mode 100644 drivers/clk/axs10x/i2s_pll_clock.c

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2 v5] clk/axs10x: Add I2S PLL clock driver

2016-04-13 Thread Rob Herring
On Tue, Apr 12, 2016 at 10:14:22AM +0100, Jose Abreu wrote:
> The ARC SDP I2S clock can be programmed using a
> specific PLL.
> 
> This patch has the goal of adding a clock driver
> that programs this PLL.
> 
> At this moment the rate values are hardcoded in
> a table but in the future it would be ideal to
> use a function which determines the PLL values
> given the desired rate.
> 
> Signed-off-by: Jose Abreu <joab...@synopsys.com>
> ---
> 
> Changes v4 -> v5:
> * Documentation update (as suggested by Alexey Brodkin)
> * Changed compatible string to "snps,axs10x-i2s-pll-clock" (as suggested by 
> Alexey Brodkin)
> 
> Changes v3 -> v4:
> * Added binding document (as suggested by Stephen Boyd)
> * Minor code style fixes (as suggested by Stephen Boyd)
> * Use ioremap (as suggested by Stephen Boyd)
> * Implement round_rate (as suggested by Stephen Boyd)
> * Change to platform driver (as suggested by Stephen Boyd)
> * Use {readl/writel}_relaxed (as suggested by Vineet Gupta)
> 
> Changes v2 -> v3:
> * Implemented recalc_rate
> 
> Changes v1 -> v2:
> * Renamed folder to axs10x (as suggested by Alexey Brodkin)
> * Added more supported rates
> 
>  .../bindings/clock/axs10x-i2s-pll-clock.txt|  17 ++

Acked-by: Rob Herring <r...@kernel.org>

>  drivers/clk/Makefile   |   1 +
>  drivers/clk/axs10x/Makefile|   1 +
>  drivers/clk/axs10x/i2s_pll_clock.c | 217 
> +
>  4 files changed, 236 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/clock/axs10x-i2s-pll-clock.txt
>  create mode 100644 drivers/clk/axs10x/Makefile
>  create mode 100644 drivers/clk/axs10x/i2s_pll_clock.c

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/5 v4] drm: Add DT bindings documentation for ARC PGU display controller

2016-03-25 Thread Rob Herring
On Thu, Mar 24, 2016 at 07:48:33PM +0300, Alexey Brodkin wrote:
> This add DT bindings documentation for ARC PGU display controller.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> Cc: Rob Herring <robh...@kernel.org>
> Cc: Pawel Moll <pawel.m...@arm.com>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Ian Campbell <ijc+devicet...@hellion.org.uk>
> Cc: Kumar Gala <ga...@codeaurora.org>
> Cc: devicet...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> ---
> 
> Changes v3 -> v4: (addressing Rob's comments)
>  * Removed "encoder-slave" from required properties
>  * Removed "0x" from node names
> 
> Changes v2 -> v3:
>  * Reverted back to initial larger version of example
>with minor fixes (thanks Rob for spotting those).
> 
> Changes v1 -> v2:
>  * Removed everything except PGU node itself.
> 
>  .../devicetree/bindings/display/snps,arcpgu.txt| 71 
> ++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt 
> b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> new file mode 100644
> index 000..b126577
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> @@ -0,0 +1,71 @@
> +ARC PGU
> +
> +This is a display controller found on several development boards produced
> +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
> +framebuffer and sends it to a single digital encoder (usually HDMI).
> +
> +Required properties:
> +  - compatible: "snps,arcpgu"
> +  - reg: Physical base address and length of the controller's registers.
> +  - clocks: A list of phandle + clock-specifier pairs, one for each
> +entry in 'clock-names'.
> +  - clock-names: A list of clock names. For ARC PGU it should contain:
> +  - "pxlclk" for the clock feeding the output PLL of the controller.
> +
> +Required sub-nodes:
> +  - port: The PGU connection to an encoder chip.
> +
> +Example:
> +
> +/ {
> + ...
> +
> + pgu@XXXXXXXX {
> + compatible = "snps,arcpgu";
> + reg = <0x 0x400>;
> + clocks = <_node>;
> + clock-names = "pxlclk";
> + encoder-slave = <_node>;

Still in the example...

Otherwise,

Acked-by: Rob Herring <r...@kernel.org>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/4] drm: Add DT bindings documentation for ARC PGU display controller

2016-03-18 Thread Rob Herring
On Thu, Mar 3, 2016 at 7:58 AM, Alexey Brodkin
<alexey.brod...@synopsys.com> wrote:
> Hi Rob,
>
> On Tue, 2016-02-23 at 14:38 -0600, Rob Herring wrote:
>> On Fri, Feb 19, 2016 at 04:03:52PM +0300, Alexey Brodkin wrote:
>> >
>> > This add DT bindings documentation for ARC PGU display controller.
>> >
>> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
>> > Cc: Rob Herring <robh...@kernel.org>
>> > Cc: Pawel Moll <pawel.m...@arm.com>
>> > Cc: Mark Rutland <mark.rutl...@arm.com>
>> > Cc: Ian Campbell <ijc+devicet...@hellion.org.uk>
>> > Cc: Kumar Gala <ga...@codeaurora.org>
>> > Cc: devicet...@vger.kernel.org
>> > Cc: linux-snps-arc@lists.infradead.org
>> > ---
>> >  .../devicetree/bindings/display/snps,arcpgu.txt| 74 
>> > ++
>> >  1 file changed, 74 insertions(+)
>> >  create mode 100644 
>> > Documentation/devicetree/bindings/display/snps,arcpgu.txt
>> >
>> > diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt
>> > b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
>> > new file mode 100644
>> > index 000..c8382fb
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
>> > @@ -0,0 +1,74 @@
>> > +ARC PGU
>> > +
>> > +This is a display controller found on several development boards produced
>> > +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
>> > +framebuffer and sends it to a single digital encoder (usually HDMI).
>> > +
>> > +Required properties:
>> > +  - compatible: "snps,arcpgu"
>> Seems like this should be more specific. Is there some sort or
>> versioning with ARC blocks?
>
> Well as of today there's only one and only version of PGU.
> So is there a real need for "snps,arcpgu-1.0"?
>
>> >
>> > +  - reg: Physical base address and length of the controller's registers.
>> > +  - clocks: A list of phandle + clock-specifier pairs, one for each
>> > +entry in 'clock-names'.
>> > +  - clock-names: A list of clock names. For ARC PGU it should contain:
>> > +  - "pxlclk" for the clock feeding the output PLL of the controller.
>> > +  - encoder-slave: Phandle of encoder chip.
>> This is unnecessary with the OF graph.
>
> Do you mean I may drop "encoder-slave" from bindings description?

Yes, you should drop it.

> I actually thought about that because in case of simulation platform where
> this device is also used there's no encoder as well as no connector - we're
> dealing with memory area which is read by host and then displayed on host's
> display.
>

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/4 v2] drm: Add DT bindings documentation for ARC PGU display controller

2016-03-04 Thread Rob Herring
On Thu, Mar 03, 2016 at 05:39:14PM +0300, Alexey Brodkin wrote:
> This add DT bindings documentation for ARC PGU display controller.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> Cc: Rob Herring <robh...@kernel.org>
> Cc: Pawel Moll <pawel.m...@arm.com>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Ian Campbell <ijc+devicet...@hellion.org.uk>
> Cc: Kumar Gala <ga...@codeaurora.org>
> Cc: devicet...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> ---
> 
> Changes v1 -> v2:
>  * Clean-up

Not really useful. What we like to see is what changed. Maintainers have 
short memories and don't remember what they said previously (unless 
comments are ignored).

> 
>  .../devicetree/bindings/display/snps,arcpgu.txt| 33 
> ++
>  1 file changed, 33 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt 
> b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> new file mode 100644
> index 000..57f3bc8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> @@ -0,0 +1,33 @@
> +ARC PGU
> +
> +This is a display controller found on several development boards produced
> +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
> +framebuffer and sends it to a single digital encoder (usually HDMI).
> +
> +Required properties:
> +  - compatible: "snps,arcpgu"
> +  - reg: Physical base address and length of the controller's registers.
> +  - clocks: A list of phandle + clock-specifier pairs, one for each
> +entry in 'clock-names'.
> +  - clock-names: A list of clock names. For ARC PGU it should contain:
> +  - "pxlclk" for the clock feeding the output PLL of the controller.
> +
> +Required sub-nodes:
> +  - port: The PGU connection to an encoder chip. The connection is modelled
> +using the OF graph bindings specified in
> +Documentation/devicetree/bindings/graph.txt.
> +
> +Example:
> +
> +/ {
> + ...
> +
> + pgu@ {
> + compatible = "snps,arcpgu";
> + reg = <0x 0x400>;
> + clocks = <_node>;
> + clock-names = "pxlclk";

Where's the port? Didn't you previously say it was optional?

> + };
> +
> + ...
> +};
> -- 
> 2.5.0
> 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/4] drm: Add DT bindings documentation for ARC PGU display controller

2016-02-23 Thread Rob Herring
On Fri, Feb 19, 2016 at 04:03:52PM +0300, Alexey Brodkin wrote:
> This add DT bindings documentation for ARC PGU display controller.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> Cc: Rob Herring <robh...@kernel.org>
> Cc: Pawel Moll <pawel.m...@arm.com>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Ian Campbell <ijc+devicet...@hellion.org.uk>
> Cc: Kumar Gala <ga...@codeaurora.org>
> Cc: devicet...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> ---
>  .../devicetree/bindings/display/snps,arcpgu.txt| 74 
> ++
>  1 file changed, 74 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt 
> b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> new file mode 100644
> index 000..c8382fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
> @@ -0,0 +1,74 @@
> +ARC PGU
> +
> +This is a display controller found on several development boards produced
> +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
> +framebuffer and sends it to a single digital encoder (usually HDMI).
> +
> +Required properties:
> +  - compatible: "snps,arcpgu"

Seems like this should be more specific. Is there some sort or 
versioning with ARC blocks?

> +  - reg: Physical base address and length of the controller's registers.
> +  - clocks: A list of phandle + clock-specifier pairs, one for each
> +entry in 'clock-names'.
> +  - clock-names: A list of clock names. For ARC PGU it should contain:
> +  - "pxlclk" for the clock feeding the output PLL of the controller.
> +  - encoder-slave: Phandle of encoder chip.

This is unnecessary with the OF graph.

> +
> +Required sub-nodes:
> +  - port: The PGU connection to an encoder chip. The connection is modelled
> +using the OF graph bindings specified in
> +Documentation/devicetree/bindings/graph.txt.
> +
> +Example:
> +
> +/ {
> + ...
> +
> + pgu@0x {

Unit address should not have '0x'

> + compatible = "snps,arcpgu";
> + reg = <0x 0x400>;
> + clocks = <_node>;
> + clock-names = "pxlclk";
> + encoder-slave = <_node>;
> +
> + port {
> + pgu_output: endpoint {
> + remote-endpoint = <_enc_input>;
> + };
> + };
> + };
> +
> + /* HDMI encoder on I2C bus */
> + i2c@0x {
> + compatible = "...";
> +
> + encoder_node:encoder_node@0x{

I2C addresses would be 8-bit only.

> + compatible="...";
> +
> + ports {
> + port@0 {
> + reg = <0>;
> + hdmi_enc_input:endpoint {
> + remote-endpoint = <_output>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + hdmi_enc_output:endpoint {
> + remote-endpoint = 
> <_connector_in>;
> + };
> + };
> + };
> + };
> + }
> +
> + hdmi0: connector {
> + compatible = "hdmi-connector";
> +
> + port {
> + hdmi_connector_in: endpoint {
> + remote-endpoint = <_enc_output>;
> + };
> + };
> + };
> +};
> -- 
> 2.5.0
> 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings

2016-02-03 Thread Rob Herring
On Wed, Feb 3, 2016 at 2:04 AM, Vineet Gupta <vineet.gup...@synopsys.com> wrote:
> Hi Rob,
>
> On Wednesday 03 February 2016 03:33 AM, Rob Herring wrote:
>> On Tue, Feb 02, 2016 at 04:28:52PM +0530, Vineet Gupta wrote:
>>> +Required properties:
>>> +
>>> +- compatible : should be "snps,arc-timer0"
>>
>> timer0 and timer1 are different h/w blocks, not just different
>> instances?
>
> Functionality wise they are identical (only the address of aux regs used to
> program them are different). Either can be configured to interrupt-on-limit or
> free-run-and-wrap-around. So we can indeed consider them 2 instances. ARC 
> Linux
> uses timer0 for tick handling, timer1 for gtod.
>
> Do you prefer they not be differentiated as timer0 and timer1 ?
>
> So we have
>
> CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer0", arc_clockevent_setup);
> CLOCKSOURCE_OF_DECLARE(arc_timer1, "snps,arc-timer1", arc_cs_setup_timer1);
>
> I don't know how to achieve above, by keeping the DT names the same.

You just need a single CLOCKSOURCE_OF_DECLARE which will be called
twice. On the first call, setup one timer and on the 2nd call setup
the other one. IIRC the sp804 timer has something similar.

You'll need a unit address in the node name to distinguish them.

>
>>
>>> +- interrupts : single Interrupt going into parent intc
>>> +   (16 for ARCHS cores, 3 for ARC700 cores)
>>> +- clocks : phandle to the source clock
>>> +
>>> +Optional properties:
>>> +
>>> +- interrupt-parent : phandle to parent intc
>>> +
>>> +Example:
>>> +
>>> +timer0: timer_clkevt {
>>
>> just "timer" for node name. clkevt is a Linuxism.
>
> OK. So to document that this is for clockevent, change the label ?

That shouldn't be documented in the DT at all.

>
> timer_clkevent: timer {
>
>>
>>> +compatible = "snps,arc-timer0";
>>> +interrupts = <3>;
>>> +interrupt-parent = <_intc>;
>>> +clocks = <_clk>;
>>> +};
>>> diff --git a/Documentation/devicetree/bindings/timer/snps,arc-timer1.txt 
>>> b/Documentation/devicetree/bindings/timer/snps,arc-timer1.txt
>>> new file mode 100644
>>> index ..4886192ce2f2
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/timer/snps,arc-timer1.txt
>>> @@ -0,0 +1,17 @@
>>> +Synopsys ARC Free Running Local 32-bit Timer
>>> +- Found on all ARC CPUs (ARC700/ARCHS)
>>> +- Mandatory clocksource provider on ARC700
>>> +- Optional clocksource provider on UP ARC HS CPUs
>>> +  (and if better timer archs-rtc not available in SoC)
>>> +
>>> +Required properties:
>>> +
>>> +- compatible : should be "snps,arc-timer1"
>>> +- clocks : phandle to the source clock
>>
>> No interrupt because it doesn't have one or you use this as a
>> clocksource and don't need it?
>
> Latter !

Then you should have the interrupt in the DT anyway.

Rob

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 07/15] dmaengine: dw: revisit data_width property

2016-01-26 Thread Rob Herring
On Sun, Jan 24, 2016 at 07:21:54PM +, Mans Rullgard wrote:
> From: Andy Shevchenko 
> 
> There are several changes are done here:
> 
>  - Convert the property to be in bytes
> 
>Much more convenient than keeping encoded value.
> 
>  - Use one value for all AHB masters for now
> 
>It seems in practice we have no controllers where masters have different
>data bus width, we still might return to distinct values when there is a 
> use
>case.
> 
>  - Rename data_width to data-width in the device tree bindings.
> 
>  - While here, replace dwc_fast_ffs() by __ffs().
> 
> Signed-off-by: Andy Shevchenko 
> Signed-off-by: Mans Rullgard 
> ---
> This patch changes the DT binding, so it should probably be amended for
> compatibility with old device trees.  I've included it as is since I think
> the change as such is good.

Just because you update the dts files, it doesn't make the change okay. 
I'm fine with the DT change, but the driver would have to support both 
old and new property names. Doesn't really seem worth doing to me.

Rob

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


<    1   2