linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add STM32 SPI support on stm32mp157c
@ 2018-05-17 14:21 Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 1/3] ARM: dts: stm32: add " Amelie Delaunay
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Amelie Delaunay @ 2018-05-17 14:21 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

This patch adds STM32 SPI support on stm32mp157c SoC.
SPI1, available on GPIO expansion connector, is kept disabled, so these
pins can be used as GPIOs by default.

Amelie Delaunay (3):
  ARM: dts: stm32: add STM32 SPI support on stm32mp157c
  ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1
  ARM: multi_v7_defconfig: enable STM32 SPI

 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 16 +++++-
 arch/arm/boot/dts/stm32mp157c-ev1.dts     |  6 +++
 arch/arm/boot/dts/stm32mp157c.dtsi        | 84 +++++++++++++++++++++++++++++++
 arch/arm/configs/multi_v7_defconfig       |  1 +
 4 files changed, 106 insertions(+), 1 deletion(-)

-- 
2.7.4

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

* [PATCH 1/3] ARM: dts: stm32: add STM32 SPI support on stm32mp157c
  2018-05-17 14:21 [PATCH 0/3] Add STM32 SPI support on stm32mp157c Amelie Delaunay
@ 2018-05-17 14:21 ` Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 2/3] ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1 Amelie Delaunay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Amelie Delaunay @ 2018-05-17 14:21 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

This patch adds all STM32 SPI instances on stm32mp157c.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/boot/dts/stm32mp157c.dtsi | 84 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
index b66f673..49ce7f0 100644
--- a/arch/arm/boot/dts/stm32mp157c.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c.dtsi
@@ -311,6 +311,34 @@
 			};
 		};
 
+		spi2: spi@4000b000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x4000b000 0x400>;
+			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI2_K>;
+			resets = <&rcc SPI2_R>;
+			dmas = <&dmamux1 39 0x400 0x05>,
+			       <&dmamux1 40 0x400 0x05>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
+		spi3: spi@4000c000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x4000c000 0x400>;
+			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI3_K>;
+			resets = <&rcc SPI3_R>;
+			dmas = <&dmamux1 61 0x400 0x05>,
+			       <&dmamux1 62 0x400 0x05>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
 		usart2: serial@4000e000 {
 			compatible = "st,stm32h7-uart";
 			reg = <0x4000e000 0x400>;
@@ -494,6 +522,34 @@
 			status = "disabled";
 		};
 
+		spi1: spi@44004000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x44004000 0x400>;
+			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI1_K>;
+			resets = <&rcc SPI1_R>;
+			dmas = <&dmamux1 37 0x400 0x05>,
+			       <&dmamux1 38 0x400 0x05>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
+		spi4: spi@44005000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x44005000 0x400>;
+			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI4_K>;
+			resets = <&rcc SPI4_R>;
+			dmas = <&dmamux1 83 0x400 0x05>,
+			       <&dmamux1 84 0x400 0x05>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
 		timers15: timer@44006000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -556,6 +612,20 @@
 			};
 		};
 
+		spi5: spi@44009000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x44009000 0x400>;
+			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI5_K>;
+			resets = <&rcc SPI5_R>;
+			dmas = <&dmamux1 85 0x400 0x05>,
+			       <&dmamux1 86 0x400 0x05>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
 		dma1: dma@48000000 {
 			compatible = "st,stm32-dma";
 			reg = <0x48000000 0x400>;
@@ -805,6 +875,20 @@
 			status = "disabled";
 		};
 
+		spi6: spi@5c001000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "st,stm32h7-spi";
+			reg = <0x5c001000 0x400>;
+			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc SPI6_K>;
+			resets = <&rcc SPI6_R>;
+			dmas = <&mdma1 34 0x0 0x40008 0x0 0x0 0>,
+			       <&mdma1 35 0x0 0x40002 0x0 0x0 0>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
 		i2c4: i2c@5c002000 {
 			compatible = "st,stm32f7-i2c";
 			reg = <0x5c002000 0x400>;
-- 
2.7.4

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

* [PATCH 2/3] ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1
  2018-05-17 14:21 [PATCH 0/3] Add STM32 SPI support on stm32mp157c Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 1/3] ARM: dts: stm32: add " Amelie Delaunay
@ 2018-05-17 14:21 ` Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI Amelie Delaunay
  2018-06-26 13:01 ` [PATCH 0/3] Add STM32 SPI support on stm32mp157c Alexandre Torgue
  3 siblings, 0 replies; 8+ messages in thread
From: Amelie Delaunay @ 2018-05-17 14:21 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

This patch adds SPI1 support on stm32mp157c-ev1 board.
SPI1 is available on GPIO expansion connector but kept disabled
so these pins can be used as GPIOs by default.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 16 +++++++++++++++-
 arch/arm/boot/dts/stm32mp157c-ev1.dts     |  6 ++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
index 88e9133..b35f151 100644
--- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
@@ -277,7 +277,6 @@
 			compatible = "st,stm32mp157-z-pinctrl";
 			ranges = <0 0x54004000 0x400>;
 			pins-are-numbered;
-			status = "disabled";
 
 			gpioz: gpio@54004000 {
 				gpio-controller;
@@ -301,6 +300,21 @@
 					slew-rate = <0>;
 				};
 			};
+
+			spi1_pins_a: spi1-0 {
+				pins1 {
+					pinmux = <STM32_PINMUX('Z', 0, AF5)>, /* SPI1_SCK */
+						 <STM32_PINMUX('Z', 2, AF5)>; /* SPI1_MOSI */
+					bias-disable;
+					drive-push-pull;
+					slew-rate = <1>;
+				};
+
+				pins2 {
+					pinmux = <STM32_PINMUX('Z', 1, AF5)>; /* SPI1_MISO */
+					bias-disable;
+				};
+			};
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index 9382d80..7584e1f 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -67,6 +67,12 @@
 	};
 };
 
+&spi1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1_pins_a>;
+	status = "disabled";
+};
+
 &timers2 {
 	status = "disabled";
 	pwm {
-- 
2.7.4

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

* [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI
  2018-05-17 14:21 [PATCH 0/3] Add STM32 SPI support on stm32mp157c Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 1/3] ARM: dts: stm32: add " Amelie Delaunay
  2018-05-17 14:21 ` [PATCH 2/3] ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1 Amelie Delaunay
@ 2018-05-17 14:21 ` Amelie Delaunay
  2018-06-26  8:44   ` Alexandre Torgue
  2018-06-26 13:01 ` [PATCH 0/3] Add STM32 SPI support on stm32mp157c Alexandre Torgue
  3 siblings, 1 reply; 8+ messages in thread
From: Amelie Delaunay @ 2018-05-17 14:21 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

Enable the STM32 SPI driver, implemented on STM32MP1 SoC.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 89167cd..f990335 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -411,6 +411,7 @@ CONFIG_SPI_S3C64XX=m
 CONFIG_SPI_SH_MSIOF=m
 CONFIG_SPI_SH_HSPI=y
 CONFIG_SPI_SIRF=y
+CONFIG_SPI_STM32=y
 CONFIG_SPI_SUN4I=y
 CONFIG_SPI_SUN6I=y
 CONFIG_SPI_TEGRA114=y
-- 
2.7.4

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

* Re: [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI
  2018-05-17 14:21 ` [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI Amelie Delaunay
@ 2018-06-26  8:44   ` Alexandre Torgue
  2018-06-26 11:47     ` Amelie DELAUNAY
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Torgue @ 2018-06-26  8:44 UTC (permalink / raw)
  To: Amelie Delaunay, Maxime Coquelin, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel

Hi Amélie

On 05/17/2018 04:21 PM, Amelie Delaunay wrote:
> Enable the STM32 SPI driver, implemented on STM32MP1 SoC.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
> ---
>   arch/arm/configs/multi_v7_defconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
> index 89167cd..f990335 100644
> --- a/arch/arm/configs/multi_v7_defconfig
> +++ b/arch/arm/configs/multi_v7_defconfig
> @@ -411,6 +411,7 @@ CONFIG_SPI_S3C64XX=m
>   CONFIG_SPI_SH_MSIOF=m
>   CONFIG_SPI_SH_HSPI=y
>   CONFIG_SPI_SIRF=y
> +CONFIG_SPI_STM32=y
>   CONFIG_SPI_SUN4I=y
>   CONFIG_SPI_SUN6I=y
>   CONFIG_SPI_TEGRA114=y
> 

Driver which are are not "vital" to boot STM32 platform should be 
defined as module. It's the case for this one. Isn't ?

Regards
Alex

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

* Re: [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI
  2018-06-26  8:44   ` Alexandre Torgue
@ 2018-06-26 11:47     ` Amelie DELAUNAY
  2018-06-26 12:13       ` Alexandre Torgue
  0 siblings, 1 reply; 8+ messages in thread
From: Amelie DELAUNAY @ 2018-06-26 11:47 UTC (permalink / raw)
  To: Alexandre TORGUE, Maxime Coquelin, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel

Hi Alex

On 06/26/2018 10:44 AM, Alexandre Torgue wrote:
> Hi Amélie
> 
> On 05/17/2018 04:21 PM, Amelie Delaunay wrote:
>> Enable the STM32 SPI driver, implemented on STM32MP1 SoC.
>>
>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>> ---
>>   arch/arm/configs/multi_v7_defconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm/configs/multi_v7_defconfig 
>> b/arch/arm/configs/multi_v7_defconfig
>> index 89167cd..f990335 100644
>> --- a/arch/arm/configs/multi_v7_defconfig
>> +++ b/arch/arm/configs/multi_v7_defconfig
>> @@ -411,6 +411,7 @@ CONFIG_SPI_S3C64XX=m
>>   CONFIG_SPI_SH_MSIOF=m
>>   CONFIG_SPI_SH_HSPI=y
>>   CONFIG_SPI_SIRF=y
>> +CONFIG_SPI_STM32=y
>>   CONFIG_SPI_SUN4I=y
>>   CONFIG_SPI_SUN6I=y
>>   CONFIG_SPI_TEGRA114=y
>>
> 
> Driver which are are not "vital" to boot STM32 platform should be 
> defined as module. It's the case for this one. Isn't ?
> 

You're right. I'll send v2 with CONFIG_SPI_STM32=m ASAP. Should I resend 
the whole patchset (with DT), or just this patch and you take the DT 
patches as they are ?

Regards,
Amelie

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

* Re: [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI
  2018-06-26 11:47     ` Amelie DELAUNAY
@ 2018-06-26 12:13       ` Alexandre Torgue
  0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Torgue @ 2018-06-26 12:13 UTC (permalink / raw)
  To: Amelie DELAUNAY, Maxime Coquelin, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel



On 06/26/2018 01:47 PM, Amelie DELAUNAY wrote:
> Hi Alex
> 
> On 06/26/2018 10:44 AM, Alexandre Torgue wrote:
>> Hi Amélie
>> 
>> On 05/17/2018 04:21 PM, Amelie Delaunay wrote:
>>> Enable the STM32 SPI driver, implemented on STM32MP1 SoC.
>>>
>>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>>> ---
>>>   arch/arm/configs/multi_v7_defconfig | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/arm/configs/multi_v7_defconfig 
>>> b/arch/arm/configs/multi_v7_defconfig
>>> index 89167cd..f990335 100644
>>> --- a/arch/arm/configs/multi_v7_defconfig
>>> +++ b/arch/arm/configs/multi_v7_defconfig
>>> @@ -411,6 +411,7 @@ CONFIG_SPI_S3C64XX=m
>>>   CONFIG_SPI_SH_MSIOF=m
>>>   CONFIG_SPI_SH_HSPI=y
>>>   CONFIG_SPI_SIRF=y
>>> +CONFIG_SPI_STM32=y
>>>   CONFIG_SPI_SUN4I=y
>>>   CONFIG_SPI_SUN6I=y
>>>   CONFIG_SPI_TEGRA114=y
>>>
>> 
>> Driver which are are not "vital" to boot STM32 platform should be 
>> defined as module. It's the case for this one. Isn't ?
>> 
> 
> You're right. I'll send v2 with CONFIG_SPI_STM32=m ASAP. Should I resend
> the whole patchset (with DT), or just this patch and you take the DT
> patches as they are ?
> 

No, you can just resend this one. I will take DT part from this version.

Regards
Alex

> Regards,
> Amelie

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

* Re: [PATCH 0/3] Add STM32 SPI support on stm32mp157c
  2018-05-17 14:21 [PATCH 0/3] Add STM32 SPI support on stm32mp157c Amelie Delaunay
                   ` (2 preceding siblings ...)
  2018-05-17 14:21 ` [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI Amelie Delaunay
@ 2018-06-26 13:01 ` Alexandre Torgue
  3 siblings, 0 replies; 8+ messages in thread
From: Alexandre Torgue @ 2018-06-26 13:01 UTC (permalink / raw)
  To: Amelie Delaunay, Maxime Coquelin, Rob Herring, Mark Rutland,
	Russell King, Arnd Bergmann
  Cc: linux-arm-kernel, devicetree, linux-kernel

Hi Amélie,

On 05/17/2018 04:21 PM, Amelie Delaunay wrote:
> This patch adds STM32 SPI support on stm32mp157c SoC.
> SPI1, available on GPIO expansion connector, is kept disabled, so these
> pins can be used as GPIOs by default.
> 
> Amelie Delaunay (3):
>    ARM: dts: stm32: add STM32 SPI support on stm32mp157c
>    ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1
>    ARM: multi_v7_defconfig: enable STM32 SPI
> 
>   arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 16 +++++-
>   arch/arm/boot/dts/stm32mp157c-ev1.dts     |  6 +++
>   arch/arm/boot/dts/stm32mp157c.dtsi        | 84 +++++++++++++++++++++++++++++++
>   arch/arm/configs/multi_v7_defconfig       |  1 +
>   4 files changed, 106 insertions(+), 1 deletion(-)
> 

DT patches applied on stm32-next.

Thanks
Alex

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

end of thread, other threads:[~2018-06-26 13:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 14:21 [PATCH 0/3] Add STM32 SPI support on stm32mp157c Amelie Delaunay
2018-05-17 14:21 ` [PATCH 1/3] ARM: dts: stm32: add " Amelie Delaunay
2018-05-17 14:21 ` [PATCH 2/3] ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1 Amelie Delaunay
2018-05-17 14:21 ` [PATCH 3/3] ARM: multi_v7_defconfig: enable STM32 SPI Amelie Delaunay
2018-06-26  8:44   ` Alexandre Torgue
2018-06-26 11:47     ` Amelie DELAUNAY
2018-06-26 12:13       ` Alexandre Torgue
2018-06-26 13:01 ` [PATCH 0/3] Add STM32 SPI support on stm32mp157c Alexandre Torgue

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).