Re: [PATCH 6/9] sunxi-cedrus: Add device tree binding document

2018-04-19 Thread Paul Kocialkowski
Hi,

On Sun, 2018-03-18 at 07:48 -0500, Rob Herring wrote:
> On Fri, Mar 09, 2018 at 11:14:42AM +0100, Paul Kocialkowski wrote:
> > From: Florent Revest 
> 
> "device tree binding document" can all be summarized with the subject 
> prefix "dt-bindings: media: ".

Will do in v2, thanks.

> Also, email should be updated to @bootlin.com?

I will keep the address @free-electrons.com (since there is no matching
@bootlin.com address). Although that address was broken at the time of
sending v1, it should be a valid redirect nowadays.

> > 
> > Device Tree bindings for the Allwinner's video engine
> > 
> > Signed-off-by: Florent Revest 
> > ---
> >  .../devicetree/bindings/media/sunxi-cedrus.txt | 44
> > ++
> >  1 file changed, 44 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt b/Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt
> > new file mode 100644
> > index ..138581113c49
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> > @@ -0,0 +1,44 @@
> > +Device-Tree bindings for SUNXI video engine found in sunXi SoC
> > family
> > +
> > +Required properties:
> > +- compatible   : "allwinner,sun4i-a10-video-engine";
> > +- memory-region : DMA pool for buffers allocation;
> 
> Why do you need this linkage? Many drivers use CMA and don't need
> this.

The VPU can only access the first 256 MiB of DRAM, that are DMA-mapped
starting from the DRAM base. This requires specific memory allocation
and handling. I'll add the information in v2.

> > +- clocks   : list of clock specifiers, corresponding to
> > + entries in clock-names property;
> > +- clock-names  : should contain "ahb", "mod" and "ram"
> > entries;
> > +- resets   : phandle for reset;
> > +- interrupts   : should contain VE interrupt number;
> > +- reg  : should contain register base and length
> > of VE.
> > +
> > +Example:
> > +
> > +reserved-memory {
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   ranges;
> > +
> > +   ve_reserved: cma {
> > +   compatible = "shared-dma-pool";
> > +   reg = <0x43d0 0x900>;
> > +   no-map;
> > +   linux,cma-default;
> > +   };
> > +};
> > +
> > +video-engine {
> > +   compatible = "allwinner,sun4i-a10-video-engine";
> > +   memory-region = <_reserved>;
> > +
> > +   clocks = <_gates 32>, < CLK_VE>,
> > +<_gates 0>;
> > +   clock-names = "ahb", "mod", "ram";
> > +
> > +   assigned-clocks = < CLK_VE>;
> > +   assigned-clock-rates = <32000>;
> 
> Not documented.

Will do in v2.

-- 
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com

signature.asc
Description: This is a digitally signed message part


Re: [PATCH 6/9] sunxi-cedrus: Add device tree binding document

2018-03-18 Thread Rob Herring
On Fri, Mar 09, 2018 at 11:14:42AM +0100, Paul Kocialkowski wrote:
> From: Florent Revest 

"device tree binding document" can all be summarized with the subject 
prefix "dt-bindings: media: ".

Also, email should be updated to @bootlin.com?

> 
> Device Tree bindings for the Allwinner's video engine
> 
> Signed-off-by: Florent Revest 
> ---
>  .../devicetree/bindings/media/sunxi-cedrus.txt | 44 
> ++
>  1 file changed, 44 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/sunxi-cedrus.txt 
> b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> new file mode 100644
> index ..138581113c49
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> @@ -0,0 +1,44 @@
> +Device-Tree bindings for SUNXI video engine found in sunXi SoC family
> +
> +Required properties:
> +- compatible : "allwinner,sun4i-a10-video-engine";
> +- memory-region : DMA pool for buffers allocation;

Why do you need this linkage? Many drivers use CMA and don't need this.

> +- clocks : list of clock specifiers, corresponding to
> +   entries in clock-names property;
> +- clock-names: should contain "ahb", "mod" and "ram" entries;
> +- resets : phandle for reset;
> +- interrupts : should contain VE interrupt number;
> +- reg: should contain register base and length of VE.
> +
> +Example:
> +
> +reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + ve_reserved: cma {
> + compatible = "shared-dma-pool";
> + reg = <0x43d0 0x900>;
> + no-map;
> + linux,cma-default;
> + };
> +};
> +
> +video-engine {
> + compatible = "allwinner,sun4i-a10-video-engine";
> + memory-region = <_reserved>;
> +
> + clocks = <_gates 32>, < CLK_VE>,
> +  <_gates 0>;
> + clock-names = "ahb", "mod", "ram";
> +
> + assigned-clocks = < CLK_VE>;
> + assigned-clock-rates = <32000>;

Not documented.

> +
> + resets = < RST_VE>;
> +
> + interrupts = <53>;
> +
> + reg = <0x01c0e000 4096>;
> +};
> -- 
> 2.16.2
> 
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


Re: [linux-sunxi] [PATCH 6/9] sunxi-cedrus: Add device tree binding document

2018-03-09 Thread Priit Laes
On Fri, Mar 09, 2018 at 11:14:42AM +0100, Paul Kocialkowski wrote:
> From: Florent Revest 
> 
> Device Tree bindings for the Allwinner's video engine
> 
> Signed-off-by: Florent Revest 
> ---
>  .../devicetree/bindings/media/sunxi-cedrus.txt | 44 
> ++
>  1 file changed, 44 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/sunxi-cedrus.txt 
> b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> new file mode 100644
> index ..138581113c49
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> @@ -0,0 +1,44 @@
> +Device-Tree bindings for SUNXI video engine found in sunXi SoC family
> +
> +Required properties:
> +- compatible : "allwinner,sun4i-a10-video-engine";
> +- memory-region : DMA pool for buffers allocation;
> +- clocks : list of clock specifiers, corresponding to
> +   entries in clock-names property;
> +- clock-names: should contain "ahb", "mod" and "ram" entries;
> +- resets : phandle for reset;
> +- interrupts : should contain VE interrupt number;
> +- reg: should contain register base and length of VE.
> +
> +Example:
> +
> +reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + ve_reserved: cma {
> + compatible = "shared-dma-pool";
> + reg = <0x43d0 0x900>;
> + no-map;
> + linux,cma-default;
> + };
> +};
> +
> +video-engine {
> + compatible = "allwinner,sun4i-a10-video-engine";
> + memory-region = <_reserved>;
> +
> + clocks = <_gates 32>, < CLK_VE>,
> +  <_gates 0>;

This should be updated to sunxi-ng clocks:

clocks = < CLK_BUS_VE>, < CLK_VE>, < CLK_DRAM_VE>;

> + clock-names = "ahb", "mod", "ram";
> +
> + assigned-clocks = < CLK_VE>;
> + assigned-clock-rates = <32000>;
> +
> + resets = < RST_VE>;
> +
> + interrupts = <53>;
> +
> + reg = <0x01c0e000 4096>;
> +};
> -- 
> 2.16.2
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH 6/9] sunxi-cedrus: Add device tree binding document

2018-03-09 Thread Paul Kocialkowski
Hi,

Thanks for the review!

On Fri, 2018-03-09 at 15:38 +0200, Priit Laes wrote:
> On Fri, Mar 09, 2018 at 11:14:42AM +0100, Paul Kocialkowski wrote:
> > From: Florent Revest 
> > 
> > Device Tree bindings for the Allwinner's video engine
> > 
> > Signed-off-by: Florent Revest 
> > ---
> >  .../devicetree/bindings/media/sunxi-cedrus.txt | 44
> > ++
> >  1 file changed, 44 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt b/Documentation/devicetree/bindings/media/sunxi-
> > cedrus.txt
> > new file mode 100644
> > index ..138581113c49
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
> > @@ -0,0 +1,44 @@
> > +Device-Tree bindings for SUNXI video engine found in sunXi SoC
> > family
> > +
> > +Required properties:
> > +- compatible   : "allwinner,sun4i-a10-video-engine";
> > +- memory-region : DMA pool for buffers allocation;
> > +- clocks   : list of clock specifiers, corresponding to
> > + entries in clock-names property;
> > +- clock-names  : should contain "ahb", "mod" and "ram"
> > entries;
> > +- resets   : phandle for reset;
> > +- interrupts   : should contain VE interrupt number;
> > +- reg  : should contain register base and length
> > of VE.
> > +
> > +Example:
> > +
> > +reserved-memory {
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   ranges;
> > +
> > +   ve_reserved: cma {
> > +   compatible = "shared-dma-pool";
> > +   reg = <0x43d0 0x900>;
> > +   no-map;
> > +   linux,cma-default;
> > +   };
> > +};
> > +
> > +video-engine {
> > +   compatible = "allwinner,sun4i-a10-video-engine";
> > +   memory-region = <_reserved>;
> > +
> > +   clocks = <_gates 32>, < CLK_VE>,
> > +<_gates 0>;
> 
> This should be updated to sunxi-ng clocks:
> 
> clocks = < CLK_BUS_VE>, < CLK_VE>, < CLK_DRAM_VE>;

I will definitely keep that in mind and make the change for the next
revision, thanks!

> > +   clock-names = "ahb", "mod", "ram";
> > +
> > +   assigned-clocks = < CLK_VE>;
> > +   assigned-clock-rates = <32000>;
> > +
> > +   resets = < RST_VE>;
> > +
> > +   interrupts = <53>;
> > +
> > +   reg = <0x01c0e000 4096>;
> > +};
> > -- 
> > 2.16.2
> > 
> > -- 
> > You received this message because you are subscribed to the Google
> > Groups "linux-sunxi" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to linux-sunxi+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
-- 
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com

signature.asc
Description: This is a digitally signed message part


[PATCH 6/9] sunxi-cedrus: Add device tree binding document

2018-03-09 Thread Paul Kocialkowski
From: Florent Revest 

Device Tree bindings for the Allwinner's video engine

Signed-off-by: Florent Revest 
---
 .../devicetree/bindings/media/sunxi-cedrus.txt | 44 ++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/sunxi-cedrus.txt

diff --git a/Documentation/devicetree/bindings/media/sunxi-cedrus.txt 
b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
new file mode 100644
index ..138581113c49
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/sunxi-cedrus.txt
@@ -0,0 +1,44 @@
+Device-Tree bindings for SUNXI video engine found in sunXi SoC family
+
+Required properties:
+- compatible   : "allwinner,sun4i-a10-video-engine";
+- memory-region : DMA pool for buffers allocation;
+- clocks   : list of clock specifiers, corresponding to
+ entries in clock-names property;
+- clock-names  : should contain "ahb", "mod" and "ram" entries;
+- resets   : phandle for reset;
+- interrupts   : should contain VE interrupt number;
+- reg  : should contain register base and length of VE.
+
+Example:
+
+reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   ve_reserved: cma {
+   compatible = "shared-dma-pool";
+   reg = <0x43d0 0x900>;
+   no-map;
+   linux,cma-default;
+   };
+};
+
+video-engine {
+   compatible = "allwinner,sun4i-a10-video-engine";
+   memory-region = <_reserved>;
+
+   clocks = <_gates 32>, < CLK_VE>,
+<_gates 0>;
+   clock-names = "ahb", "mod", "ram";
+
+   assigned-clocks = < CLK_VE>;
+   assigned-clock-rates = <32000>;
+
+   resets = < RST_VE>;
+
+   interrupts = <53>;
+
+   reg = <0x01c0e000 4096>;
+};
-- 
2.16.2