diff mbox

[v2] ARM: shmobile: alt: Add QSPI device to DT

Message ID 1451903819-19218-1-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State Accepted
Commit 67fdb9d6536c2fbbbbf416aa8d8016bfe55f0975
Delegated to: Simon Horman
Headers show

Commit Message

Simon Horman Jan. 4, 2016, 10:36 a.m. UTC
Enable the QSPI controller in the alt 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>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v2
* Added compatible = "fixed-partitions";
* Update partitioning scheme to reflect
  ALT_MiniMonitor_Manual(SPI_Boot)_Rev0.01_e.pdf
* Tested on top of renesas-devel-20151228-v4.4-rc7
  Read /dev/mtd0 with 512K blocks at 6.5Mb/s
---
 arch/arm/boot/dts/r8a7794-alt.dts | 46 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

Comments

Geert Uytterhoeven Jan. 4, 2016, 11:15 a.m. UTC | #1
On Mon, Jan 4, 2016 at 11:36 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Enable the QSPI controller in the alt 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>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

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

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
Simon Horman Jan. 4, 2016, 8:31 p.m. UTC | #2
On Mon, Jan 04, 2016 at 12:15:10PM +0100, Geert Uytterhoeven wrote:
> On Mon, Jan 4, 2016 at 11:36 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Enable the QSPI controller in the alt 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>
> > Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, I have queued this up for v4.6.

Should we document "spansion,s25fl512s" for the benefit of checkpatch.pl?
--
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 Jan. 4, 2016, 8:42 p.m. UTC | #3
Hi Simon,

On Mon, Jan 4, 2016 at 9:31 PM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Jan 04, 2016 at 12:15:10PM +0100, Geert Uytterhoeven wrote:
>> On Mon, Jan 4, 2016 at 11:36 AM, Simon Horman
>> <horms+renesas@verge.net.au> wrote:
>> > Enable the QSPI controller in the alt 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>
>> > Cc: Geert Uytterhoeven <geert@linux-m68k.org>
>> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>>
>> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Thanks, I have queued this up for v4.6.
>
> Should we document "spansion,s25fl512s" for the benefit of checkpatch.pl?

Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt used to point to
drivers/mtd/devices/m25p80.c for the list of supported chips.

That seems to have been changed lately. Now jedec,spi-nor.txt includes the
list, but lacks the manufacturers' names, so checkpatch.pl is still not happpy.

Brian: Shouldn't the manufacturers's names be added?

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
Brian Norris Jan. 4, 2016, 9:25 p.m. UTC | #4
On Mon, Jan 04, 2016 at 09:42:59PM +0100, Geert Uytterhoeven wrote:
> On Mon, Jan 4, 2016 at 9:31 PM, Simon Horman <horms@verge.net.au> wrote:
> > Should we document "spansion,s25fl512s" for the benefit of checkpatch.pl?
> 
> Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt used to point to
> drivers/mtd/devices/m25p80.c for the list of supported chips.
> 
> That seems to have been changed lately. Now jedec,spi-nor.txt includes the
> list, but lacks the manufacturers' names, so checkpatch.pl is still not happpy.
> 
> Brian: Shouldn't the manufacturers's names be added?

We've had some of this discussion recently:

http://lkml.kernel.org/g/20151118194340.GF140057@google.com

I don't think we can reasonably determine a good list of complete
strings, due to historical failures (IMO) in the SPI subsystem. We could
add a separate list of possible manufacturers, so people can do the MxN
pairing themselves.

checkpatch.pl has enough false positives that its author doesn't care to
fix that I'm not personally worried about yet another class of them. But
if you have good reasons and good patches for the documentation, I'm all
ears.

Regards,
Brian
--
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/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
index 2394e4883786..773f304d1142 100644
--- a/arch/arm/boot/dts/r8a7794-alt.dts
+++ b/arch/arm/boot/dts/r8a7794-alt.dts
@@ -138,6 +138,13 @@ 
 	status = "okay";
 };
 
+&pfc {
+	qspi_pins: spi0 {
+		renesas,groups = "qspi_ctrl", "qspi_data4";
+		renesas,function = "qspi";
+	};
+};
+
 &ether {
 	pinctrl-0 = <&ether_pins &phy1_pins>;
 	pinctrl-names = "default";
@@ -197,3 +204,42 @@ 
 
 	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 {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "loader";
+				reg = <0x00000000 0x00040000>;
+				read-only;
+			};
+			partition@40000 {
+				label = "system";
+				reg = <0x00040000 0x00040000>;
+				read-only;
+			};
+			partition@80000 {
+				label = "user";
+				reg = <0x00080000 0x03f80000>;
+			};
+		};
+	};
+};