All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
@ 2018-02-28 13:10 ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: Maxime Coquelin, arnd, robh+dt, mark.rutland, linux,
	patrice.chotard, lee.jones
  Cc: devicetree, vladimir.murzin, Alexandre Torgue, linux-arm-kernel

This series enable DMA on several STM32 MCU based on cortex-M7.
To make it possible, a dedicated dma pool memory area has to be
created. This patchset activate also ARM_MPU flag which will configure 
MPU (Memory Protection Unit) according to devicetree information (mem
and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able 
memory region.


v2:
-select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
-Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
to be aligned on 1MB. It is currently not the case. I had choice to either
modify current XIP start address to be aligned on 1MB or to remove global
configuration. I make choice to remove XIP configuration. Indeed, SD card
support has been recently added for most of STM32 MCU boards (except for
stm32f429-disco). As kernel is growing up for stm32 it will be more and more
difficult to flash it in embeded flash (max size: 2MB).
-fix typo in commit message

Regards
Alex

Alexandre Torgue (4):
  ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
  ARM: configs: stm32: remove XIP configuration
  ARM: stm32: Select ARM_MPU for cortex-M7 machines
  ARM: dts: stm32: enable dma on MCU which embed a cortex-M7

 arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
 arch/arm/configs/stm32_defconfig       |  2 --
 arch/arm/mach-stm32/Kconfig            |  3 +++
 6 files changed, 87 insertions(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
@ 2018-02-28 13:10 ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

This series enable DMA on several STM32 MCU based on cortex-M7.
To make it possible, a dedicated dma pool memory area has to be
created. This patchset activate also ARM_MPU flag which will configure 
MPU (Memory Protection Unit) according to devicetree information (mem
and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able 
memory region.


v2:
-select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
-Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
to be aligned on 1MB. It is currently not the case. I had choice to either
modify current XIP start address to be aligned on 1MB or to remove global
configuration. I make choice to remove XIP configuration. Indeed, SD card
support has been recently added for most of STM32 MCU boards (except for
stm32f429-disco). As kernel is growing up for stm32 it will be more and more
difficult to flash it in embeded flash (max size: 2MB).
-fix typo in commit message

Regards
Alex

Alexandre Torgue (4):
  ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
  ARM: configs: stm32: remove XIP configuration
  ARM: stm32: Select ARM_MPU for cortex-M7 machines
  ARM: dts: stm32: enable dma on MCU which embed a cortex-M7

 arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
 arch/arm/configs/stm32_defconfig       |  2 --
 arch/arm/mach-stm32/Kconfig            |  3 +++
 6 files changed, 87 insertions(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH v2 1/4] ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
  2018-02-28 13:10 ` Alexandre Torgue
@ 2018-02-28 13:10   ` Alexandre Torgue
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: Maxime Coquelin, arnd, robh+dt, mark.rutland, linux,
	patrice.chotard, lee.jones
  Cc: devicetree, vladimir.murzin, Alexandre Torgue, linux-arm-kernel

On cortex-M7 MCU, DMA have to use a non cache-able memory area. For this
reason a dedicated memory pool is created for DMA.
This patch creates a DMA memory pool of 1MB of each STM32 MCU which
embeds a cortex-M7 except stm32f746-disco. Indeed, as stm32f746-disco has
only a 8MB SDRAM and it's tricky to reduce memory used by Kernel.

Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index e3f5a83..92651c3 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -58,6 +58,19 @@
 		reg = <0xc0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index d712260..c526853 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -59,6 +59,19 @@
 		reg = <0xC0000000 0x1000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc0f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 45e088c..3689e70 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart2;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index c7187e1..b9af696 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
-- 
2.7.4

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

* [PATCH v2 1/4] ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
@ 2018-02-28 13:10   ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

On cortex-M7 MCU, DMA have to use a non cache-able memory area. For this
reason a dedicated memory pool is created for DMA.
This patch creates a DMA memory pool of 1MB of each STM32 MCU which
embeds a cortex-M7 except stm32f746-disco. Indeed, as stm32f746-disco has
only a 8MB SDRAM and it's tricky to reduce memory used by Kernel.

Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index e3f5a83..92651c3 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -58,6 +58,19 @@
 		reg = <0xc0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index d712260..c526853 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -59,6 +59,19 @@
 		reg = <0xC0000000 0x1000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc0f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 45e088c..3689e70 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart2;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index c7187e1..b9af696 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
-- 
2.7.4

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

* [PATCH v2 2/4] ARM: configs: stm32: remove XIP configuration
  2018-02-28 13:10 ` Alexandre Torgue
@ 2018-02-28 13:10   ` Alexandre Torgue
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: Maxime Coquelin, arnd, robh+dt, mark.rutland, linux,
	patrice.chotard, lee.jones
  Cc: devicetree, vladimir.murzin, Alexandre Torgue, linux-arm-kernel

Embedded flash becomes too small to be used as XIP support. SD card is now
available on most of stm32 boards and could be used as boot support.
Furthermore, ARM_MPU flags will be used by default and it imposes that XIP
image to be aligned on 1MB (which is not the case). For all those reasons
I prefer to remove XIP configuration from default stm32 config and let
user configure it if needed.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index ba805b7..b162b8d 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -28,8 +28,6 @@ CONFIG_PREEMPT=y
 # CONFIG_ATAGS is not set
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_XIP_KERNEL=y
-CONFIG_XIP_PHYS_ADDR=0x08008000
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_SHARED_FLAT=y
 # CONFIG_COREDUMP is not set
-- 
2.7.4

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

* [PATCH v2 2/4] ARM: configs: stm32: remove XIP configuration
@ 2018-02-28 13:10   ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

Embedded flash becomes too small to be used as XIP support. SD card is now
available on most of stm32 boards and could be used as boot support.
Furthermore, ARM_MPU flags will be used by default and it imposes that XIP
image to be aligned on 1MB (which is not the case). For all those reasons
I prefer to remove XIP configuration from default stm32 config and let
user configure it if needed.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index ba805b7..b162b8d 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -28,8 +28,6 @@ CONFIG_PREEMPT=y
 # CONFIG_ATAGS is not set
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_XIP_KERNEL=y
-CONFIG_XIP_PHYS_ADDR=0x08008000
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_SHARED_FLAT=y
 # CONFIG_COREDUMP is not set
-- 
2.7.4

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

* [PATCH v2 3/4] ARM: stm32: Select ARM_MPU for cortex-M7 machines
  2018-02-28 13:10 ` Alexandre Torgue
@ 2018-02-28 13:10   ` Alexandre Torgue
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: Maxime Coquelin, arnd, robh+dt, mark.rutland, linux,
	patrice.chotard, lee.jones
  Cc: devicetree, vladimir.murzin, Alexandre Torgue, linux-arm-kernel

STM32 MCUs embed a Memory Protection Unit. Enabling ARM_MPU flag will
allow the Kernel to configure the MPU according to the devicetree.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 713c068..c2ad8e9 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -29,15 +29,18 @@ config MACH_STM32F469
 config MACH_STM32F746
 	bool "STMicroelectronics STM32F746"
 	select ARM_AMBA
+	select ARM_MPU
 	default y
 
 config MACH_STM32F769
 	bool "STMicroelectronics STM32F769"
 	select ARM_AMBA
+	select ARM_MPU
 	default y
 
 config MACH_STM32H743
 	bool "STMicroelectronics STM32H743"
+	select ARM_MPU
 	default y
 
 endif # ARMv7-M
-- 
2.7.4

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

* [PATCH v2 3/4] ARM: stm32: Select ARM_MPU for cortex-M7 machines
@ 2018-02-28 13:10   ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

STM32 MCUs embed a Memory Protection Unit. Enabling ARM_MPU flag will
allow the Kernel to configure the MPU according to the devicetree.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 713c068..c2ad8e9 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -29,15 +29,18 @@ config MACH_STM32F469
 config MACH_STM32F746
 	bool "STMicroelectronics STM32F746"
 	select ARM_AMBA
+	select ARM_MPU
 	default y
 
 config MACH_STM32F769
 	bool "STMicroelectronics STM32F769"
 	select ARM_AMBA
+	select ARM_MPU
 	default y
 
 config MACH_STM32H743
 	bool "STMicroelectronics STM32H743"
+	select ARM_MPU
 	default y
 
 endif # ARMv7-M
-- 
2.7.4

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

* [PATCH v2 4/4] ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
  2018-02-28 13:10 ` Alexandre Torgue
@ 2018-02-28 13:10   ` Alexandre Torgue
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: Maxime Coquelin, arnd, robh+dt, mark.rutland, linux,
	patrice.chotard, lee.jones
  Cc: devicetree, vladimir.murzin, Alexandre Torgue, linux-arm-kernel

Enable dma1 and dma2 on:
-stm32746g-eval board
-stm32f769-disco board
-stm32h743i-disco board
-stm32h743i-eval board

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index 92651c3..c87e289 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -114,6 +114,14 @@
 	status = "okay";
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-0 = <&i2c1_pins_b>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index c526853..3985c6d 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -117,6 +117,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &rtc {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 3689e70..e1623e3 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -79,6 +79,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &usart2 {
 	pinctrl-0 = <&usart2_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index b9af696..3a1f471 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -105,6 +105,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &rtc {
 	status = "okay";
 };
-- 
2.7.4

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

* [PATCH v2 4/4] ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
@ 2018-02-28 13:10   ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

Enable dma1 and dma2 on:
-stm32746g-eval board
-stm32f769-disco board
-stm32h743i-disco board
-stm32h743i-eval board

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index 92651c3..c87e289 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -114,6 +114,14 @@
 	status = "okay";
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-0 = <&i2c1_pins_b>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index c526853..3985c6d 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -117,6 +117,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &rtc {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 3689e70..e1623e3 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -79,6 +79,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &usart2 {
 	pinctrl-0 = <&usart2_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index b9af696..3a1f471 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -105,6 +105,14 @@
 	clock-frequency = <25000000>;
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
 &rtc {
 	status = "okay";
 };
-- 
2.7.4

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

* Re: [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
  2018-02-28 13:10 ` Alexandre Torgue
@ 2018-02-28 13:22   ` Vladimir Murzin
  -1 siblings, 0 replies; 14+ messages in thread
From: Vladimir Murzin @ 2018-02-28 13:22 UTC (permalink / raw)
  To: Alexandre Torgue, Maxime Coquelin, arnd, robh+dt, mark.rutland,
	linux, patrice.chotard, lee.jones
  Cc: devicetree, linux-arm-kernel

On 28/02/18 13:10, Alexandre Torgue wrote:
> This series enable DMA on several STM32 MCU based on cortex-M7.
> To make it possible, a dedicated dma pool memory area has to be
> created. This patchset activate also ARM_MPU flag which will configure 
> MPU (Memory Protection Unit) according to devicetree information (mem
> and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able 
> memory region.
> 
> 
> v2:
> -select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
> -Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
> to be aligned on 1MB. It is currently not the case. I had choice to either
> modify current XIP start address to be aligned on 1MB or to remove global
> configuration. I make choice to remove XIP configuration. Indeed, SD card
> support has been recently added for most of STM32 MCU boards (except for
> stm32f429-disco). As kernel is growing up for stm32 it will be more and more
> difficult to flash it in embeded flash (max size: 2MB).

It is sad we are loosing XIP configuration - it used to uncover some bugs
in a past. Probably, you might consider to have stm32 tiny (+xip) defconfig
for those who do not want/need all-in-one kernel.

Cheers
Vladimir

> -fix typo in commit message
> 
> Regards
> Alex
> 
> Alexandre Torgue (4):
>   ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
>   ARM: configs: stm32: remove XIP configuration
>   ARM: stm32: Select ARM_MPU for cortex-M7 machines
>   ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
> 
>  arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
>  arch/arm/configs/stm32_defconfig       |  2 --
>  arch/arm/mach-stm32/Kconfig            |  3 +++
>  6 files changed, 87 insertions(+), 2 deletions(-)
> 

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

* [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
@ 2018-02-28 13:22   ` Vladimir Murzin
  0 siblings, 0 replies; 14+ messages in thread
From: Vladimir Murzin @ 2018-02-28 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/02/18 13:10, Alexandre Torgue wrote:
> This series enable DMA on several STM32 MCU based on cortex-M7.
> To make it possible, a dedicated dma pool memory area has to be
> created. This patchset activate also ARM_MPU flag which will configure 
> MPU (Memory Protection Unit) according to devicetree information (mem
> and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able 
> memory region.
> 
> 
> v2:
> -select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
> -Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
> to be aligned on 1MB. It is currently not the case. I had choice to either
> modify current XIP start address to be aligned on 1MB or to remove global
> configuration. I make choice to remove XIP configuration. Indeed, SD card
> support has been recently added for most of STM32 MCU boards (except for
> stm32f429-disco). As kernel is growing up for stm32 it will be more and more
> difficult to flash it in embeded flash (max size: 2MB).

It is sad we are loosing XIP configuration - it used to uncover some bugs
in a past. Probably, you might consider to have stm32 tiny (+xip) defconfig
for those who do not want/need all-in-one kernel.

Cheers
Vladimir

> -fix typo in commit message
> 
> Regards
> Alex
> 
> Alexandre Torgue (4):
>   ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
>   ARM: configs: stm32: remove XIP configuration
>   ARM: stm32: Select ARM_MPU for cortex-M7 machines
>   ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
> 
>  arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
>  arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
>  arch/arm/configs/stm32_defconfig       |  2 --
>  arch/arm/mach-stm32/Kconfig            |  3 +++
>  6 files changed, 87 insertions(+), 2 deletions(-)
> 

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

* Re: [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
  2018-02-28 13:22   ` Vladimir Murzin
@ 2018-02-28 13:42     ` Alexandre Torgue
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:42 UTC (permalink / raw)
  To: Vladimir Murzin, Maxime Coquelin, arnd, robh+dt, mark.rutland,
	linux, patrice.chotard, lee.jones
  Cc: devicetree, linux-arm-kernel

Hi Vlad

On 02/28/2018 02:22 PM, Vladimir Murzin wrote:
> On 28/02/18 13:10, Alexandre Torgue wrote:
>> This series enable DMA on several STM32 MCU based on cortex-M7.
>> To make it possible, a dedicated dma pool memory area has to be
>> created. This patchset activate also ARM_MPU flag which will configure
>> MPU (Memory Protection Unit) according to devicetree information (mem
>> and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able
>> memory region.
>>
>>
>> v2:
>> -select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
>> -Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
>> to be aligned on 1MB. It is currently not the case. I had choice to either
>> modify current XIP start address to be aligned on 1MB or to remove global
>> configuration. I make choice to remove XIP configuration. Indeed, SD card
>> support has been recently added for most of STM32 MCU boards (except for
>> stm32f429-disco). As kernel is growing up for stm32 it will be more and more
>> difficult to flash it in embeded flash (max size: 2MB).
> 
> It is sad we are loosing XIP configuration - it used to uncover some bugs
> in a past. Probably, you might consider to have stm32 tiny (+xip) defconfig
> for those who do not want/need all-in-one kernel.

I agree and I don't want to loose XIP configuration. I just want that 
default stm32_defconfig covers the main MCU boards and the maximum 
IPs/driver for those boards. SD cards will be the boot support that will 
be supported in buildroot (except for stm32f429-disco).

But I agree, I could maybe use a frag to have a tiny configuration for 
stm32 to be able to flash xip in embeded flash and provide a "basic" 
support (kernel boot + console).


Regards
Alex
> 
> Cheers
> Vladimir
> 
>> -fix typo in commit message
>>
>> Regards
>> Alex
>>
>> Alexandre Torgue (4):
>>    ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
>>    ARM: configs: stm32: remove XIP configuration
>>    ARM: stm32: Select ARM_MPU for cortex-M7 machines
>>    ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
>>
>>   arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
>>   arch/arm/configs/stm32_defconfig       |  2 --
>>   arch/arm/mach-stm32/Kconfig            |  3 +++
>>   6 files changed, 87 insertions(+), 2 deletions(-)
>>
> 

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

* [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7
@ 2018-02-28 13:42     ` Alexandre Torgue
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Torgue @ 2018-02-28 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vlad

On 02/28/2018 02:22 PM, Vladimir Murzin wrote:
> On 28/02/18 13:10, Alexandre Torgue wrote:
>> This series enable DMA on several STM32 MCU based on cortex-M7.
>> To make it possible, a dedicated dma pool memory area has to be
>> created. This patchset activate also ARM_MPU flag which will configure
>> MPU (Memory Protection Unit) according to devicetree information (mem
>> and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able
>> memory region.
>>
>>
>> v2:
>> -select ARM_MPU in mach-stm32 Kconfig instead of add it in stm32 defconfig
>> -Remove XIP configuration from stm32_defconfig: ARM_MPU flag imposes XIP image
>> to be aligned on 1MB. It is currently not the case. I had choice to either
>> modify current XIP start address to be aligned on 1MB or to remove global
>> configuration. I make choice to remove XIP configuration. Indeed, SD card
>> support has been recently added for most of STM32 MCU boards (except for
>> stm32f429-disco). As kernel is growing up for stm32 it will be more and more
>> difficult to flash it in embeded flash (max size: 2MB).
> 
> It is sad we are loosing XIP configuration - it used to uncover some bugs
> in a past. Probably, you might consider to have stm32 tiny (+xip) defconfig
> for those who do not want/need all-in-one kernel.

I agree and I don't want to loose XIP configuration. I just want that 
default stm32_defconfig covers the main MCU boards and the maximum 
IPs/driver for those boards. SD cards will be the boot support that will 
be supported in buildroot (except for stm32f429-disco).

But I agree, I could maybe use a frag to have a tiny configuration for 
stm32 to be able to flash xip in embeded flash and provide a "basic" 
support (kernel boot + console).


Regards
Alex
> 
> Cheers
> Vladimir
> 
>> -fix typo in commit message
>>
>> Regards
>> Alex
>>
>> Alexandre Torgue (4):
>>    ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
>>    ARM: configs: stm32: remove XIP configuration
>>    ARM: stm32: Select ARM_MPU for cortex-M7 machines
>>    ARM: dts: stm32: enable dma on MCU which embed a cortex-M7
>>
>>   arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
>>   arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
>>   arch/arm/configs/stm32_defconfig       |  2 --
>>   arch/arm/mach-stm32/Kconfig            |  3 +++
>>   6 files changed, 87 insertions(+), 2 deletions(-)
>>
> 

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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 13:10 [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7 Alexandre Torgue
2018-02-28 13:10 ` Alexandre Torgue
2018-02-28 13:10 ` [PATCH v2 1/4] ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7 Alexandre Torgue
2018-02-28 13:10   ` Alexandre Torgue
2018-02-28 13:10 ` [PATCH v2 2/4] ARM: configs: stm32: remove XIP configuration Alexandre Torgue
2018-02-28 13:10   ` Alexandre Torgue
2018-02-28 13:10 ` [PATCH v2 3/4] ARM: stm32: Select ARM_MPU for cortex-M7 machines Alexandre Torgue
2018-02-28 13:10   ` Alexandre Torgue
2018-02-28 13:10 ` [PATCH v2 4/4] ARM: dts: stm32: enable dma on MCU which embed a cortex-M7 Alexandre Torgue
2018-02-28 13:10   ` Alexandre Torgue
2018-02-28 13:22 ` [PATCH v2 0/4] Enable DMA on STM32 MCU based on cortex-M7 Vladimir Murzin
2018-02-28 13:22   ` Vladimir Murzin
2018-02-28 13:42   ` Alexandre Torgue
2018-02-28 13:42     ` Alexandre Torgue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.