diff mbox

[v2,3/3] ARM: shmobile: gose: Add QSPI device to DT

Message ID 1447291763-27527-4-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State Accepted
Commit 6380d62a1b1ca498f2187c9702f1dec00ad527e0
Delegated to: Simon Horman
Headers show

Commit Message

Simon Horman Nov. 12, 2015, 1:29 a.m. UTC
Enable the QSPI controller in the gose device tree.

Based similar work for the silk board by by Vladimir Barinov and
Sergei Shtylyov.

Cc: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s

v2
* Move partitions into partitions subnode
  as suggested by Geert Uytterhoeven.
---
 arch/arm/boot/dts/r8a7793-gose.dts | 43 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Geert Uytterhoeven Nov. 12, 2015, 10:44 a.m. UTC | #1
Hi Simon,

On Thu, Nov 12, 2015 at 2:29 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Enable the QSPI controller in the gose device tree.
>
> Based similar work for the silk board by by Vladimir Barinov and
> Sergei Shtylyov.
>
> Cc: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---
> Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s

That's slow: I get 6.7 MB/s on koelsch (69.9 Mbps for Quad Read according
to my in-kernel QSPI debug code). Is this with SYS-DMAC enabled?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Nov. 12, 2015, 11:51 a.m. UTC | #2
On 11/12/2015 4:29 AM, Simon Horman wrote:

> Enable the QSPI controller in the gose device tree.
>
> Based similar work for the silk board by by Vladimir Barinov and
> Sergei Shtylyov.
>
> Cc: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> ---
> Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s
>
> v2
> * Move partitions into partitions subnode
>    as suggested by Geert Uytterhoeven.
> ---
>   arch/arm/boot/dts/r8a7793-gose.dts | 43 ++++++++++++++++++++++++++++++++++++++
>   1 file changed, 43 insertions(+)
>
> diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
> index 1575ef759047..79be514d3a1c 100644
> --- a/arch/arm/boot/dts/r8a7793-gose.dts
> +++ b/arch/arm/boot/dts/r8a7793-gose.dts
[...]
> @@ -92,3 +97,41 @@
>
>   	status = "okay";
>   };
> +
> +&qspi {
> +	pinctrl-0 = <&qspi_pins>;
> +	pinctrl-names = "default";
> +
> +	status = "okay";
> +
> +	flash@0 {
> +		compatible = "spansion,s25fl512s", "jedec,spi-nor";
> +		reg = <0>;
> +		spi-max-frequency = <30000000>;
> +		spi-tx-bus-width = <4>;
> +		spi-rx-bus-width = <4>;
> +		spi-cpol;
> +		spi-cpha;
> +		m25p,fast-read;
> +
> +		partitions{

    Need space before {.

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Nov. 13, 2015, 12:51 a.m. UTC | #3
On Thu, Nov 12, 2015 at 11:44:15AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Thu, Nov 12, 2015 at 2:29 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Enable the QSPI controller in the gose device tree.
> >
> > Based similar work for the silk board by by Vladimir Barinov and
> > Sergei Shtylyov.
> >
> > Cc: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> > Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > ---
> > Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s
> 
> That's slow: I get 6.7 MB/s on koelsch (69.9 Mbps for Quad Read according
> to my in-kernel QSPI debug code). Is this with SYS-DMAC enabled?

Yes it does seem very small.

I think that the problem is that /dev/mtd0 is very small, only 262kB.
And I do not see any interrupts for dma-controllers when reading from hit.

/dev/mdt1 is much later, 4.2MB.
dd reads that at ~7MB/s using 512kB blocks.
In that test I see interrupts for one of the dma-controllers.

I plan to go ahead and apply this series.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Nov. 13, 2015, 1:11 a.m. UTC | #4
On Thu, Nov 12, 2015 at 02:51:37PM +0300, Sergei Shtylyov wrote:
> On 11/12/2015 4:29 AM, Simon Horman wrote:
> 
> >Enable the QSPI controller in the gose device tree.
> >
> >Based similar work for the silk board by by Vladimir Barinov and
> >Sergei Shtylyov.
> >
> >Cc: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> >Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >
> >---
> >Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s
> >
> >v2
> >* Move partitions into partitions subnode
> >   as suggested by Geert Uytterhoeven.
> >---
> >  arch/arm/boot/dts/r8a7793-gose.dts | 43 ++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 43 insertions(+)
> >
> >diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
> >index 1575ef759047..79be514d3a1c 100644
> >--- a/arch/arm/boot/dts/r8a7793-gose.dts
> >+++ b/arch/arm/boot/dts/r8a7793-gose.dts
> [...]
> >@@ -92,3 +97,41 @@
> >
> >  	status = "okay";
> >  };
> >+
> >+&qspi {
> >+	pinctrl-0 = <&qspi_pins>;
> >+	pinctrl-names = "default";
> >+
> >+	status = "okay";
> >+
> >+	flash@0 {
> >+		compatible = "spansion,s25fl512s", "jedec,spi-nor";
> >+		reg = <0>;
> >+		spi-max-frequency = <30000000>;
> >+		spi-tx-bus-width = <4>;
> >+		spi-rx-bus-width = <4>;
> >+		spi-cpol;
> >+		spi-cpha;
> >+		m25p,fast-read;
> >+
> >+		partitions{
> 
>    Need space before {.

Thanks, I have corrected that and queued this up for v4.5.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 13, 2015, 7:52 a.m. UTC | #5
Hi Simon,

On Fri, Nov 13, 2015 at 1:51 AM, Simon Horman <horms@verge.net.au> wrote:
>> > Tested: Read /dev/mtd0 with 512K blocks at 1.7MB/s
>>
>> That's slow: I get 6.7 MB/s on koelsch (69.9 Mbps for Quad Read according
>> to my in-kernel QSPI debug code). Is this with SYS-DMAC enabled?
>
> Yes it does seem very small.
>
> I think that the problem is that /dev/mtd0 is very small, only 262kB.
> And I do not see any interrupts for dma-controllers when reading from hit.

Performance suffers badly from using small block sizes, so that explains it.

> /dev/mdt1 is much later, 4.2MB.
> dd reads that at ~7MB/s using 512kB blocks.

That's better.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
index 1575ef759047..79be514d3a1c 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -57,6 +57,11 @@ 
 		renesas,groups = "intc_irq0";
 		renesas,function = "intc";
 	};
+
+	qspi_pins: spi0 {
+		renesas,groups = "qspi_ctrl", "qspi_data4";
+		renesas,function = "qspi";
+	};
 };
 
 &ether {
@@ -92,3 +97,41 @@ 
 
 	status = "okay";
 };
+
+&qspi {
+	pinctrl-0 = <&qspi_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	flash@0 {
+		compatible = "spansion,s25fl512s", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <30000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+		spi-cpol;
+		spi-cpha;
+		m25p,fast-read;
+
+		partitions{
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "loader";
+				reg = <0x00000000 0x00040000>;
+				read-only;
+			};
+			partition@40000 {
+				label = "user";
+				reg = <0x00040000 0x00400000>;
+				read-only;
+			};
+			partition@440000 {
+				label = "flash";
+				reg = <0x00440000 0x03bc0000>;
+			};
+		};
+	};
+};