linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT.
@ 2014-10-08 19:27 tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx
       [not found] ` <1412796428-3255-1-git-send-email-tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx @ 2014-10-08 19:27 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx,
	tthayer.linux-Re5JQEeQqe8AvxtiuMwx3w,
	tthayer-EIB2kfCEclfQT0dZR+AlfA, axel.lin-8E1dMatC8ynQT0dZR+AlfA,
	baruch-NswTu9S1W3P6gbPvEgmw2w,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
	s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ

From: Thor Thayer <tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>

Add 2 SPI nodes to SOCFPGA device tree.

Signed-off-by: Thor Thayer <tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
---
v2: Remove extra files. Move SPIDEV into board specific file.
---
 arch/arm/boot/dts/socfpga.dtsi          |   24 ++++++++++++++++++++++++
 arch/arm/boot/dts/socfpga_cyclone5.dtsi |   10 ++++++++++
 2 files changed, 34 insertions(+)

diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index 4d77ad6..d81bc2d3 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -628,6 +628,30 @@
 			clock-names = "biu", "ciu";
 		};
 
+		spi0: spi@fff00000 {
+			compatible = "snps,dw-apb-ssi";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xfff00000 0x1000>;
+			interrupts = <0 154 4>;
+			num-cs = <4>;
+			bus-num = <0>;
+			clocks = <&spi_m_clk>;
+			status = "disabled";
+		};
+
+		spi1: spi@fff01000 {
+			compatible = "snps,dw-apb-ssi";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xfff01000 0x1000>;
+			interrupts = <0 156 4>;
+			num-cs = <4>;
+			bus-num = <1>;
+			clocks = <&spi_m_clk>;
+			status = "disabled";
+		};
+
 		/* Local timer */
 		timer@fffec600 {
 			compatible = "arm,cortex-a9-twd-timer";
diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dtsi b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
index bf51182..85c6b5c 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5.dtsi
+++ b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
@@ -48,5 +48,15 @@
 		sysmgr@ffd08000 {
 			cpu1-start-addr = <0xffd080c4>;
 		};
+
+		spi0: spi@fff00000 {
+			status = "okay";
+
+			spidev@0 {
+				compatible = "spidev";
+				reg = <0>;	/* chip select */
+				spi-max-frequency = <100000000>;
+			};
+		};
 	};
 };
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT.
       [not found] ` <1412796428-3255-1-git-send-email-tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
@ 2014-10-08 20:05   ` Mark Brown
       [not found]     ` <20141008200515.GK4609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2014-10-08 20:05 UTC (permalink / raw)
  To: tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	tthayer.linux-Re5JQEeQqe8AvxtiuMwx3w,
	tthayer-EIB2kfCEclfQT0dZR+AlfA, axel.lin-8E1dMatC8ynQT0dZR+AlfA,
	baruch-NswTu9S1W3P6gbPvEgmw2w,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
	s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

On Wed, Oct 08, 2014 at 02:27:08PM -0500, tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org wrote:

> +			spidev@0 {
> +				compatible = "spidev";
> +				reg = <0>;	/* chip select */
> +				spi-max-frequency = <100000000>;
> +			};

No, if you're putting spidev into the DT that's broken - describe the
hardware, not the software you're using to control it.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT.
       [not found]     ` <20141008200515.GK4609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-10-09 19:19       ` Thor Thayer
       [not found]         ` <5436DFAD.2010902-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thor Thayer @ 2014-10-09 19:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	tthayer.linux-Re5JQEeQqe8AvxtiuMwx3w,
	tthayer-EIB2kfCEclfQT0dZR+AlfA, axel.lin-8E1dMatC8ynQT0dZR+AlfA,
	baruch-NswTu9S1W3P6gbPvEgmw2w,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
	s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ


On 10/08/2014 03:05 PM, Mark Brown wrote:
> On Wed, Oct 08, 2014 at 02:27:08PM -0500, tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org wrote:
>
>> +			spidev@0 {
>> +				compatible = "spidev";
>> +				reg = <0>;	/* chip select */
>> +				spi-max-frequency = <100000000>;
>> +			};
> No, if you're putting spidev into the DT that's broken - describe the
> hardware, not the software you're using to control it.
Hi Mark,

There are quite a few instances of the spidev as a child of a spi node 
in the arch/arm/dts directory
- imx6qdl-tx6.dtsi
- imx53-tx53.dtsi
- tegra30-apalis-eval.dts
- spear1340-evb.dts

I believe the reason these are added to the device tree is that they are 
automatically probed.

If there is a different or better way to handle spidev, I'll be happy to 
do it. This seemed to be the cleanest way and had precedent.

Thanks for reviewing this and I appreciate your input.

Thor
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT.
       [not found]         ` <5436DFAD.2010902-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
@ 2014-10-09 23:05           ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-10-09 23:05 UTC (permalink / raw)
  To: Thor Thayer
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	tthayer.linux-Re5JQEeQqe8AvxtiuMwx3w,
	tthayer-EIB2kfCEclfQT0dZR+AlfA, axel.lin-8E1dMatC8ynQT0dZR+AlfA,
	baruch-NswTu9S1W3P6gbPvEgmw2w,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
	s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

On Thu, Oct 09, 2014 at 02:19:09PM -0500, Thor Thayer wrote:

> There are quite a few instances of the spidev as a child of a spi node in
> the arch/arm/dts directory
> - imx6qdl-tx6.dtsi
> - imx53-tx53.dtsi
> - tegra30-apalis-eval.dts
> - spear1340-evb.dts

> I believe the reason these are added to the device tree is that they are
> automatically probed.

These are all buggy - the DT is there to describe the hardware, not how
Linux currently implements it.  I see I need to add some code to spidev
to make it complain loudy if instantiated from DT.

> If there is a different or better way to handle spidev, I'll be happy to do
> it. This seemed to be the cleanest way and had precedent.

The DT should say what the physical device connected to the bus is using
whatever binding is appropriate for that device.  If that happens to be
spidev in current Linux then the appropriate ID should be added to spidev.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-09 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-08 19:27 [PATCHv2] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx
     [not found] ` <1412796428-3255-1-git-send-email-tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2014-10-08 20:05   ` Mark Brown
     [not found]     ` <20141008200515.GK4609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-09 19:19       ` Thor Thayer
     [not found]         ` <5436DFAD.2010902-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2014-10-09 23:05           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).