diff mbox

[PATCHv3] arm: dts: socfpga: Add SPI nodes to SOCFPGA DT.

Message ID 1413497251-21954-2-git-send-email-tthayer@opensource.altera.com (mailing list archive)
State New, archived
Headers show

Commit Message

tthayer@opensource.altera.com Oct. 16, 2014, 10:07 p.m. UTC
From: Thor Thayer <tthayer@opensource.altera.com>

Add 2 SPI nodes to SOCFPGA device tree.

Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
---
v2: Remove extra files. Move SPIDEV into board specific file.

v3: Remove dts file since SPIDEV is not allowed.
---
 arch/arm/boot/dts/socfpga.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Steffen Trumtrar Oct. 17, 2014, 6:52 a.m. UTC | #1
Hi!

On Thu, Oct 16, 2014 at 05:07:31PM -0500, tthayer@opensource.altera.com wrote:
> From: Thor Thayer <tthayer@opensource.altera.com>
> 
> Add 2 SPI nodes to SOCFPGA device tree.
> 
> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
> ---
> v2: Remove extra files. Move SPIDEV into board specific file.
> 
> v3: Remove dts file since SPIDEV is not allowed.
> ---
>  arch/arm/boot/dts/socfpga.dtsi |   24 ++++++++++++++++++++++++
>  1 file changed, 24 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>;
			^^^^^^^^^^^^^^

I think you can/should get rid of this property. It is only used/documented for
fsl-dspi as far as I can see.

> +			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";

The rest looks good IMO.

Regards,
Steffen
Mark Brown Oct. 17, 2014, 11:13 a.m. UTC | #2
On Fri, Oct 17, 2014 at 08:52:33AM +0200, Steffen Trumtrar wrote:
> On Thu, Oct 16, 2014 at 05:07:31PM -0500, tthayer@opensource.altera.com wrote:

> > +			bus-num = <0>;
> 			^^^^^^^^^^^^^^

> I think you can/should get rid of this property. It is only used/documented for
> fsl-dspi as far as I can see.

Yes, and it shouldn't be there either.
tthayer@opensource.altera.com Oct. 17, 2014, 1:55 p.m. UTC | #3
On 10/17/2014 01:52 AM, Steffen Trumtrar wrote:
> Hi!
>
> On Thu, Oct 16, 2014 at 05:07:31PM -0500, tthayer@opensource.altera.com wrote:
>> From: Thor Thayer <tthayer@opensource.altera.com>
>>
>> Add 2 SPI nodes to SOCFPGA device tree.
>>
>> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
>> ---
>> v2: Remove extra files. Move SPIDEV into board specific file.
>>
>> v3: Remove dts file since SPIDEV is not allowed.
>> ---
>>   arch/arm/boot/dts/socfpga.dtsi |   24 ++++++++++++++++++++++++
>>   1 file changed, 24 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>;
> 			^^^^^^^^^^^^^^
>
> I think you can/should get rid of this property. It is only used/documented for
> fsl-dspi as far as I can see.
Hi Steffen!

You are right, I will remove this.

I didn't see it documented in the dw-spi bindings but I did see a 
reference to .bus_num in the static structure (spi_board_info) shown in 
spi-summary.txt. If the bus-num isn't defined or used, the bus ends up 
as 32766 (0x7FE). However, the main point is that this isn't used in the 
code so I should remove it.

Thanks for your input and for reviewing!

Thor
>> +			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";
> The rest looks good IMO.
>
> Regards,
> Steffen
>

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Oct. 17, 2014, 2:27 p.m. UTC | #4
On Fri, Oct 17, 2014 at 08:55:21AM -0500, Thor Thayer wrote:

> I didn't see it documented in the dw-spi bindings but I did see a reference
> to .bus_num in the static structure (spi_board_info) shown in
> spi-summary.txt. If the bus-num isn't defined or used, the bus ends up as
> 32766 (0x7FE). However, the main point is that this isn't used in the code
> so I should remove it.

Defining the bus number is important for use in board files to allow
devices to be referenced but should never have any practical effect for
DT systems.
tthayer@opensource.altera.com Oct. 17, 2014, 3:05 p.m. UTC | #5
On 10/17/2014 09:27 AM, Mark Brown wrote:
> On Fri, Oct 17, 2014 at 08:55:21AM -0500, Thor Thayer wrote:
>
>> I didn't see it documented in the dw-spi bindings but I did see a reference
>> to .bus_num in the static structure (spi_board_info) shown in
>> spi-summary.txt. If the bus-num isn't defined or used, the bus ends up as
>> 32766 (0x7FE). However, the main point is that this isn't used in the code
>> so I should remove it.
> Defining the bus number is important for use in board files to allow
> devices to be referenced but should never have any practical effect for
> DT systems.
Thank you for the explanation, Mark. I'll make the change and resubmit.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" 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/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";