diff mbox series

[1/3] spis: mediatek: add bindings for Mediatek MT2712 soc platform

Message ID 1535437685-30230-2-git-send-email-leilk.liu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Add Mediatek SPI slave driver | expand

Commit Message

Leilk Liu Aug. 28, 2018, 6:28 a.m. UTC
This patch adds a DT binding documentation for the MT2712 soc.

Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
---
 .../devicetree/bindings/spi/spi-slave-mt27xx.txt   |   39 ++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt

Comments

Matthias Brugger Aug. 28, 2018, 3:44 p.m. UTC | #1
On 28/08/18 08:28, Leilk Liu wrote:
> This patch adds a DT binding documentation for the MT2712 soc.
> 
> Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
> ---
>  .../devicetree/bindings/spi/spi-slave-mt27xx.txt   |   39 ++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt

Do I understand correctly that mt6xxx, mt7xxx and mt8xxx SoCs have a totally
different architecture then mt27xx so they will need a totally different
binding. If not, then please rename the binding description file and the driver.

Regards,
Matthias

> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> new file mode 100644
> index 0000000..dcb8934
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> @@ -0,0 +1,39 @@
> +Binding for MTK SPI Slave controller
> +
> +Required properties:
> +- compatible: should be one of the following.
> +    - mediatek,mt2712-spi: for mt2712 platforms
> +
> +- reg: Address and length of the register set for the device
> +
> +- interrupts: Should contain spi interrupt
> +
> +- clocks: phandles to input clocks.
> +  The first should be one of the following. It's PLL.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ.
> +				      It's the default one.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ.
> +   -  <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
> +  The second should be <&topckgen CLK_TOP_SPISLV_SEL>. It's clock mux.
> +  The third is <&infracfg CLK_INFRA_AO_SPI1>. It's clock gate.
> +
> +- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
> +  muxes clock, and "spi-clk" for the clock gate.
> +
> +- spi-slave: Empty property indicating the SPI controller is used in slave mode.
> +
> +Example:
> +
> +- SoC Specific Portion:
> +spis: spi@10013000 {
> +	compatible = "mediatek,mt2712-spi-slave";
> +	reg = <0 0x10013000 0 0x100>;
> +	interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>;
> +	clocks = <&topckgen CLK_TOP_UNIVPLL1_D2>,
> +		<&topckgen CLK_TOP_SPISLV_SEL>,
> +		<&infracfg CLK_INFRA_AO_SPI1>;
> +	clock-names = "parent-clk", "sel-clk", "spi-clk";
> +	spi-slave;
> +	status = "disabled";
> +};
>
Leilk Liu Aug. 29, 2018, 1:43 a.m. UTC | #2
On Tue, 2018-08-28 at 17:44 +0200, Matthias Brugger wrote:
> 
> On 28/08/18 08:28, Leilk Liu wrote:
> > This patch adds a DT binding documentation for the MT2712 soc.
> > 
> > Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
> > ---
> >  .../devicetree/bindings/spi/spi-slave-mt27xx.txt   |   39 ++++++++++++++++++++
> >  1 file changed, 39 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> 
> Do I understand correctly that mt6xxx, mt7xxx and mt8xxx SoCs have a totally
> different architecture then mt27xx so they will need a totally different
> binding. If not, then please rename the binding description file and the driver.
> 
> Regards,
> Matthias
> 

This series are for spi slave, and mt27xx spi slave design has a
entirely different architecture with mt6xxx, mt7xxx and mt8xxx SoCs.

> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> > new file mode 100644
> > index 0000000..dcb8934
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> > @@ -0,0 +1,39 @@
> > +Binding for MTK SPI Slave controller
> > +
> > +Required properties:
> > +- compatible: should be one of the following.
> > +    - mediatek,mt2712-spi: for mt2712 platforms
> > +
> > +- reg: Address and length of the register set for the device
> > +
> > +- interrupts: Should contain spi interrupt
> > +
> > +- clocks: phandles to input clocks.
> > +  The first should be one of the following. It's PLL.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ.
> > +				      It's the default one.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ.
> > +   -  <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
> > +  The second should be <&topckgen CLK_TOP_SPISLV_SEL>. It's clock mux.
> > +  The third is <&infracfg CLK_INFRA_AO_SPI1>. It's clock gate.
> > +
> > +- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
> > +  muxes clock, and "spi-clk" for the clock gate.
> > +
> > +- spi-slave: Empty property indicating the SPI controller is used in slave mode.
> > +
> > +Example:
> > +
> > +- SoC Specific Portion:
> > +spis: spi@10013000 {
> > +	compatible = "mediatek,mt2712-spi-slave";
> > +	reg = <0 0x10013000 0 0x100>;
> > +	interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>;
> > +	clocks = <&topckgen CLK_TOP_UNIVPLL1_D2>,
> > +		<&topckgen CLK_TOP_SPISLV_SEL>,
> > +		<&infracfg CLK_INFRA_AO_SPI1>;
> > +	clock-names = "parent-clk", "sel-clk", "spi-clk";
> > +	spi-slave;
> > +	status = "disabled";
> > +};
> > 
> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
Rob Herring Sept. 4, 2018, 1:18 p.m. UTC | #3
On Tue, Aug 28, 2018 at 02:28:03PM +0800, Leilk Liu wrote:
> This patch adds a DT binding documentation for the MT2712 soc.
> 
> Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
> ---
>  .../devicetree/bindings/spi/spi-slave-mt27xx.txt   |   39 ++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> new file mode 100644
> index 0000000..dcb8934
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> @@ -0,0 +1,39 @@
> +Binding for MTK SPI Slave controller

Only does slave mode? If not, then the file name and doc should be just 
for the SPI controller (master and slave). The "spi-slave" property 
selects the mode. If it is only slave mode, then you don't need the 
spi-slave property.


> +
> +Required properties:
> +- compatible: should be one of the following.
> +    - mediatek,mt2712-spi: for mt2712 platforms
> +
> +- reg: Address and length of the register set for the device
> +
> +- interrupts: Should contain spi interrupt
> +
> +- clocks: phandles to input clocks.
> +  The first should be one of the following. It's PLL.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ.
> +				      It's the default one.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ.
> +   -  <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
> +   -  <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
> +  The second should be <&topckgen CLK_TOP_SPISLV_SEL>. It's clock mux.
> +  The third is <&infracfg CLK_INFRA_AO_SPI1>. It's clock gate.
> +
> +- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
> +  muxes clock, and "spi-clk" for the clock gate.

"-clk" is redundant.

Is the parent clock actually connected to the block? The assigned-clocks 
properties are used for constraints on parent clocks.

> +
> +- spi-slave: Empty property indicating the SPI controller is used in slave mode.
> +
> +Example:
> +
> +- SoC Specific Portion:
> +spis: spi@10013000 {
> +	compatible = "mediatek,mt2712-spi-slave";
> +	reg = <0 0x10013000 0 0x100>;
> +	interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>;
> +	clocks = <&topckgen CLK_TOP_UNIVPLL1_D2>,
> +		<&topckgen CLK_TOP_SPISLV_SEL>,
> +		<&infracfg CLK_INFRA_AO_SPI1>;
> +	clock-names = "parent-clk", "sel-clk", "spi-clk";
> +	spi-slave;
> +	status = "disabled";

Don't should status in examples.

> +};
> -- 
> 1.7.9.5
>
Leilk Liu Sept. 5, 2018, 3 a.m. UTC | #4
On Tue, 2018-09-04 at 08:18 -0500, Rob Herring wrote:
> On Tue, Aug 28, 2018 at 02:28:03PM +0800, Leilk Liu wrote:
> > This patch adds a DT binding documentation for the MT2712 soc.
> > 
> > Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
> > ---
> >  .../devicetree/bindings/spi/spi-slave-mt27xx.txt   |   39 ++++++++++++++++++++
> >  1 file changed, 39 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> > new file mode 100644
> > index 0000000..dcb8934
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
> > @@ -0,0 +1,39 @@
> > +Binding for MTK SPI Slave controller
> 
> Only does slave mode? If not, then the file name and doc should be just 
> for the SPI controller (master and slave). The "spi-slave" property 
> selects the mode. If it is only slave mode, then you don't need the 
> spi-slave property.
> 

yes, this is only for slave mode, and I'll remove spi-slave property,
thanks.

> 
> > +
> > +Required properties:
> > +- compatible: should be one of the following.
> > +    - mediatek,mt2712-spi: for mt2712 platforms
> > +
> > +- reg: Address and length of the register set for the device
> > +
> > +- interrupts: Should contain spi interrupt
> > +
> > +- clocks: phandles to input clocks.
> > +  The first should be one of the following. It's PLL.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ.
> > +				      It's the default one.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ.
> > +   -  <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
> > +   -  <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
> > +  The second should be <&topckgen CLK_TOP_SPISLV_SEL>. It's clock mux.
> > +  The third is <&infracfg CLK_INFRA_AO_SPI1>. It's clock gate.
> > +
> > +- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
> > +  muxes clock, and "spi-clk" for the clock gate.
> 
> "-clk" is redundant.
> 

ok, I'll fix it, thanks.

> Is the parent clock actually connected to the block? The assigned-clocks 
> properties are used for constraints on parent clocks.
> 

Thanks for your comment.
The parent and sel clk can select the source clk of spi module.
And I already use assigned-clocks and assigned-clocks-parents to set
them in patch v2.

> > +
> > +- spi-slave: Empty property indicating the SPI controller is used in slave mode.
> > +
> > +Example:
> > +
> > +- SoC Specific Portion:
> > +spis: spi@10013000 {
> > +	compatible = "mediatek,mt2712-spi-slave";
> > +	reg = <0 0x10013000 0 0x100>;
> > +	interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>;
> > +	clocks = <&topckgen CLK_TOP_UNIVPLL1_D2>,
> > +		<&topckgen CLK_TOP_SPISLV_SEL>,
> > +		<&infracfg CLK_INFRA_AO_SPI1>;
> > +	clock-names = "parent-clk", "sel-clk", "spi-clk";
> > +	spi-slave;
> > +	status = "disabled";
> 
> Don't should status in examples.
> 

ok, I'll fix it, thanks

> > +};
> > -- 
> > 1.7.9.5
> > 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
new file mode 100644
index 0000000..dcb8934
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
@@ -0,0 +1,39 @@ 
+Binding for MTK SPI Slave controller
+
+Required properties:
+- compatible: should be one of the following.
+    - mediatek,mt2712-spi: for mt2712 platforms
+
+- reg: Address and length of the register set for the device
+
+- interrupts: Should contain spi interrupt
+
+- clocks: phandles to input clocks.
+  The first should be one of the following. It's PLL.
+   -  <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ.
+				      It's the default one.
+   -  <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ.
+   -  <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
+   -  <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
+  The second should be <&topckgen CLK_TOP_SPISLV_SEL>. It's clock mux.
+  The third is <&infracfg CLK_INFRA_AO_SPI1>. It's clock gate.
+
+- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
+  muxes clock, and "spi-clk" for the clock gate.
+
+- spi-slave: Empty property indicating the SPI controller is used in slave mode.
+
+Example:
+
+- SoC Specific Portion:
+spis: spi@10013000 {
+	compatible = "mediatek,mt2712-spi-slave";
+	reg = <0 0x10013000 0 0x100>;
+	interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>;
+	clocks = <&topckgen CLK_TOP_UNIVPLL1_D2>,
+		<&topckgen CLK_TOP_SPISLV_SEL>,
+		<&infracfg CLK_INFRA_AO_SPI1>;
+	clock-names = "parent-clk", "sel-clk", "spi-clk";
+	spi-slave;
+	status = "disabled";
+};