Skip to contentSkip to conversation

Add rt-thread art-pi board support

PATCH Superseded dillon.minfei at gmail.com 2 participants 9 messages Mar 26, 2021 – Mar 27, 2021

Subsystems (6)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add rt-thread art-pi board support

From: dillon min <[email protected]>

These patches aim to adds u-boot support on art-pi board.

the board resources:
- stm32h750xbh6 128k flash, 1024k sram
- 32MiB sdram
- 16MiB spi flash
- 8MiB qspi flash
- onboard wifi, bt, fm

the detail board information can be found at:
https://art-pi.gitee.io/website/

---

changes in v2:
- fix wrong author/date in previous submit
- sync with kernel device tree files
- add st,stm32h750-pinctrl in doc and pinctrl driver

dillon min (6):
ARM: dts: stm32: split sdram pin & timing parameter into specific
board dts
ARM: dts: stm32: Add RT-Thread art-pi board support
board: Add rt-thread art-pi board support
ram: stm32: fix strsep failed on read only memory
dt-bindings: pinctrl: stm32: Add st,stm32h750-pinctrl for stm32h750
soc
pinctrl: stm32: Add st,stm32h750-pinctrl compatible string

 arch/arm/dts/Makefile                              |   3 +-
 arch/arm/dts/stm32h7-pinctrl.dtsi                  | 340 +++++++++++++++++++++
 arch/arm/dts/stm32h7-u-boot.dtsi                   | 100 +-----
 arch/arm/dts/stm32h743-pinctrl.dtsi                | 307 +------------------
 arch/arm/dts/stm32h743.dtsi                        | 168 +++++++++-
 arch/arm/dts/stm32h743i-disco-u-boot.dtsi          |  98 ++++++
 arch/arm/dts/stm32h743i-eval-u-boot.dtsi           |  98 ++++++
 arch/arm/dts/stm32h750-pinctrl.dtsi                |  11 +
 arch/arm/dts/stm32h750.dtsi                        |   5 +
 arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi         |  81 +++++
 arch/arm/dts/stm32h750i-art-pi.dts                 | 188 ++++++++++++
 arch/arm/mach-stm32/stm32h7/Kconfig                |   4 +
 board/st/stm32h750-art-pi/Kconfig                  |  19 ++
 board/st/stm32h750-art-pi/MAINTAINERS              |   7 +
 board/st/stm32h750-art-pi/Makefile                 |   6 +
 board/st/stm32h750-art-pi/stm32h750-art-pi.c       |  58 ++++
 configs/stm32h750-art-pi_defconfig                 |  51 ++++
 .../pinctrl/st,stm32-pinctrl.txt                   |   1 +
 drivers/pinctrl/pinctrl_stm32.c                    |   1 +
 drivers/ram/stm32_sdram.c                          |   3 +
 include/configs/stm32h750-art-pi.h                 |  48 +++
 include/dt-bindings/memory/stm32-sdram.h           |   2 +
 22 files changed, 1198 insertions(+), 401 deletions(-)
 create mode 100644 arch/arm/dts/stm32h7-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32h750-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32h750.dtsi
 create mode 100644 arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi
 create mode 100644 arch/arm/dts/stm32h750i-art-pi.dts
 create mode 100644 board/st/stm32h750-art-pi/Kconfig
 create mode 100644 board/st/stm32h750-art-pi/MAINTAINERS
 create mode 100644 board/st/stm32h750-art-pi/Makefile
 create mode 100644 board/st/stm32h750-art-pi/stm32h750-art-pi.c
 create mode 100644 configs/stm32h750-art-pi_defconfig
 create mode 100644 include/configs/stm32h750-art-pi.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/6 ARM: dts: stm32: split sdram pin & timing parameter into specific board dts

From: dillon min <[email protected]>

As different boards has their own sdram hw connection, mount different sdram modules, so move sdram timing parameter and pin configuration to their board device tree.

---

v2: add 'pinctrl0 = &pinctrl;' for configure fmc pins (after move gpio(a..k) register defines to stm32h743.dtsi, need add this)

 arch/arm/dts/stm32h7-u-boot.dtsi          | 100 ++----------------------------
 arch/arm/dts/stm32h743i-disco-u-boot.dtsi |  98 +++++++++++++++++++++++++++++
 arch/arm/dts/stm32h743i-eval-u-boot.dtsi  |  98 +++++++++++++++++++++++++++++
 3 files changed, 201 insertions(+), 95 deletions(-)
arch/arm/dts/stm32h7-u-boot.dtsi +5 -95
index 54dd406..84dc765 100644
@@ -20,6 +20,7 @@
 		gpio9 = &gpioj;
 		gpio10 = &gpiok;
 		mmc0 = &sdmmc1;
+		pinctrl0 = &pinctrl;
 	};
 
 	soc {
@@ -36,30 +37,6 @@
 			pinctrl-0 = <&fmc_pins>;
 			pinctrl-names = "default";
 			status = "okay";
-
-			/*
-			 * Memory configuration from sdram datasheet IS42S32800G-6BLI
-			 * first bank is bank at 0
-			 * second bank is bank at 1
-			 */
-			bank1: bank at 1 {
-				st,sdram-control = /bits/ 8 <NO_COL_9
-							     NO_ROW_12
-							     MWIDTH_32
-							     BANKS_4
-							     CAS_2
-							     SDCLK_3
-							     RD_BURST_EN
-							     RD_PIPE_DL_0>;
-				st,sdram-timing = /bits/ 8 <TMRD_1
-							    TXSR_1
-							    TRAS_1
-							    TRC_6
-							    TRP_2
-							    TWR_1
-							    TRCD_1>;
-				st,sdram-refcount = <1539>;
-			};
 		};
 	};
 };
@@ -136,77 +113,6 @@
 	compatible = "st,stm32-gpio";
 };
 
-&pinctrl {
-	fmc_pins: fmc at 0 {
-		pins {
-			pinmux = <STM32_PINMUX('D', 0, AF12)>,
-				 <STM32_PINMUX('D', 1, AF12)>,
-				 <STM32_PINMUX('D', 8, AF12)>,
-				 <STM32_PINMUX('D', 9, AF12)>,
-				 <STM32_PINMUX('D',10, AF12)>,
-				 <STM32_PINMUX('D',14, AF12)>,
-				 <STM32_PINMUX('D',15, AF12)>,
-
-				 <STM32_PINMUX('E', 0, AF12)>,
-				 <STM32_PINMUX('E', 1, AF12)>,
-				 <STM32_PINMUX('E', 7, AF12)>,
-				 <STM32_PINMUX('E', 8, AF12)>,
-				 <STM32_PINMUX('E', 9, AF12)>,
-				 <STM32_PINMUX('E',10, AF12)>,
-				 <STM32_PINMUX('E',11, AF12)>,
-				 <STM32_PINMUX('E',12, AF12)>,
-				 <STM32_PINMUX('E',13, AF12)>,
-				 <STM32_PINMUX('E',14, AF12)>,
-				 <STM32_PINMUX('E',15, AF12)>,
-
-				 <STM32_PINMUX('F', 0, AF12)>,
-				 <STM32_PINMUX('F', 1, AF12)>,
-				 <STM32_PINMUX('F', 2, AF12)>,
-				 <STM32_PINMUX('F', 3, AF12)>,
-				 <STM32_PINMUX('F', 4, AF12)>,
-				 <STM32_PINMUX('F', 5, AF12)>,
-				 <STM32_PINMUX('F',11, AF12)>,
-				 <STM32_PINMUX('F',12, AF12)>,
-				 <STM32_PINMUX('F',13, AF12)>,
-				 <STM32_PINMUX('F',14, AF12)>,
-				 <STM32_PINMUX('F',15, AF12)>,
-
-				 <STM32_PINMUX('G', 0, AF12)>,
-				 <STM32_PINMUX('G', 1, AF12)>,
-				 <STM32_PINMUX('G', 2, AF12)>,
-				 <STM32_PINMUX('G', 4, AF12)>,
-				 <STM32_PINMUX('G', 5, AF12)>,
-				 <STM32_PINMUX('G', 8, AF12)>,
-				 <STM32_PINMUX('G',15, AF12)>,
-
-				 <STM32_PINMUX('H', 5, AF12)>,
-				 <STM32_PINMUX('H', 6, AF12)>,
-				 <STM32_PINMUX('H', 7, AF12)>,
-				 <STM32_PINMUX('H', 8, AF12)>,
-				 <STM32_PINMUX('H', 9, AF12)>,
-				 <STM32_PINMUX('H',10, AF12)>,
-				 <STM32_PINMUX('H',11, AF12)>,
-				 <STM32_PINMUX('H',12, AF12)>,
-				 <STM32_PINMUX('H',13, AF12)>,
-				 <STM32_PINMUX('H',14, AF12)>,
-				 <STM32_PINMUX('H',15, AF12)>,
-
-				 <STM32_PINMUX('I', 0, AF12)>,
-				 <STM32_PINMUX('I', 1, AF12)>,
-				 <STM32_PINMUX('I', 2, AF12)>,
-				 <STM32_PINMUX('I', 3, AF12)>,
-				 <STM32_PINMUX('I', 4, AF12)>,
-				 <STM32_PINMUX('I', 5, AF12)>,
-				 <STM32_PINMUX('I', 6, AF12)>,
-				 <STM32_PINMUX('I', 7, AF12)>,
-				 <STM32_PINMUX('I', 9, AF12)>,
-				 <STM32_PINMUX('I',10, AF12)>;
-
-			slew-rate = <3>;
-		};
-	};
-};
-
 &pwrcfg {
 	u-boot,dm-pre-reloc;
 };
@@ -222,3 +128,7 @@
 &timer5 {
 	u-boot,dm-pre-reloc;
 };
+
+&pinctrl {
+	u-boot,dm-pre-reloc;
+};
arch/arm/dts/stm32h743i-disco-u-boot.dtsi +98 -0

101 lines not on this page · raw message

arch/arm/dts/stm32h743i-eval-u-boot.dtsi +98 -0

101 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/6 ARM: dts: stm32: Add RT-Thread art-pi board support

In reply to dillon.minfei at gmail.com

From: dillon min <[email protected]>

All these files are add for support rt-thread art-pi board

the detail board information can be found at:
https://art-pi.gitee.io/website/

board resources:
- stm32h750xbh6 128k flash, 1024k sram
- 32MiB sdram
- 16MiB spi flash
- 8MiB qspi flash
- onboard wifi, bt, fm

Add following changes to sync with kernel device tree files:
- add stm32h7-pinctrl.dtsi to include pin defines for all stm32h743/50 boards
- add stm32h7(5/3)0-pinctrl.dtsi
- move gpio(a..k) register defines to stm32h743.dtsi, sync with kernel
- introduce stm32h750i-art-pi-u-boot.dtsi for sdram paramter, fmc pins

---

v2: sync with kernel device tree files

 arch/arm/dts/Makefile                      |   3 +-
 arch/arm/dts/stm32h7-pinctrl.dtsi          | 340 +++++++++++++++++++++++++++++
 arch/arm/dts/stm32h743-pinctrl.dtsi        | 307 +-------------------------
 arch/arm/dts/stm32h743.dtsi                | 168 +++++++++++++-
 arch/arm/dts/stm32h750-pinctrl.dtsi        |  11 +
 arch/arm/dts/stm32h750.dtsi                |   5 +
 arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi |  81 +++++++
 arch/arm/dts/stm32h750i-art-pi.dts         | 188 ++++++++++++++++
 include/dt-bindings/memory/stm32-sdram.h   |   2 +
 9 files changed, 799 insertions(+), 306 deletions(-)
 create mode 100644 arch/arm/dts/stm32h7-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32h750-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32h750.dtsi
 create mode 100644 arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi
 create mode 100644 arch/arm/dts/stm32h750i-art-pi.dts
arch/arm/dts/Makefile +2 -1
index c671082..0f54801 100644
@@ -454,7 +454,8 @@ dtb-$(CONFIG_STM32F7) += stm32f746-disco.dtb \
 	stm32f769-disco.dtb \
 	stm32746g-eval.dtb
 dtb-$(CONFIG_STM32H7) += stm32h743i-disco.dtb \
-	stm32h743i-eval.dtb
+	stm32h743i-eval.dtb \
+	stm32h750i-art-pi.dtb
 
 dtb-$(CONFIG_MACH_SUN4I) += \
 	sun4i-a10-a1000.dtb \
arch/arm/dts/stm32h7-pinctrl.dtsi new file +340 -0

340 lines not on this page · raw message

arch/arm/dts/stm32h743-pinctrl.dtsi +6 -301

312 lines not on this page · raw message

arch/arm/dts/stm32h743.dtsi +164 -4

210 lines not on this page · raw message

arch/arm/dts/stm32h750-pinctrl.dtsi new file +11 -0
new file mode 100644
index 0000000..24e9997
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2021 - All Rights Reserved
+ * Author: Dillon Min  <[email protected]> for STMicroelectronics.
+ */
+
+#include "stm32h7-pinctrl.dtsi"
+
+&pinctrl{
+	compatible = "st,stm32h750-pinctrl";
+};
arch/arm/dts/stm32h750.dtsi new file +5 -0
new file mode 100644
index 0000000..99533f3
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/* Copyright (C) STMicroelectronics 2021 - All Rights Reserved */
+
+#include "stm32h743.dtsi"
+
arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi new file +81 -0

81 lines not on this page · raw message

arch/arm/dts/stm32h750i-art-pi.dts new file +188 -0

188 lines not on this page · raw message

include/dt-bindings/memory/stm32-sdram.h +2 -0
index ab91d2b..90ef2e1 100644
@@ -34,8 +34,10 @@
 #define TXSR_1		(1 - 1)
 #define TXSR_6		(6 - 1)
 #define TXSR_7		(7 - 1)
+#define TXSR_8		(8 - 1)
 #define TRAS_1		(1 - 1)
 #define TRAS_4		(4 - 1)
+#define TRAS_6		(6 - 1)
 #define TRC_6		(6 - 1)
 #define TWR_1		(1 - 1)
 #define TWR_2		(2 - 1)
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 3/6 board: Add rt-thread art-pi board support

In reply to dillon.minfei at gmail.com

From: dillon min <[email protected]>

This patch adds support for rt-thread art-pi board.

for more information about art-pi, please goto:
https://art-pi.gitee.io/website/

---

v2: fix wrong author name / date

 arch/arm/mach-stm32/stm32h7/Kconfig          |  4 ++
 board/st/stm32h750-art-pi/Kconfig            | 19 +++++++++
 board/st/stm32h750-art-pi/MAINTAINERS        |  7 ++++
 board/st/stm32h750-art-pi/Makefile           |  6 +++
 board/st/stm32h750-art-pi/stm32h750-art-pi.c | 58 ++++++++++++++++++++++++++++
 configs/stm32h750-art-pi_defconfig           | 51 ++++++++++++++++++++++++
 include/configs/stm32h750-art-pi.h           | 48 +++++++++++++++++++++++
 7 files changed, 193 insertions(+)
 create mode 100644 board/st/stm32h750-art-pi/Kconfig
 create mode 100644 board/st/stm32h750-art-pi/MAINTAINERS
 create mode 100644 board/st/stm32h750-art-pi/Makefile
 create mode 100644 board/st/stm32h750-art-pi/stm32h750-art-pi.c
 create mode 100644 configs/stm32h750-art-pi_defconfig
 create mode 100644 include/configs/stm32h750-art-pi.h
arch/arm/mach-stm32/stm32h7/Kconfig +4 -0
index 55e6217..70233a4 100644
@@ -6,7 +6,11 @@ config TARGET_STM32H743_DISCO
 config TARGET_STM32H743_EVAL
 	bool "STM32H743 Evaluation board"
 
+config TARGET_STM32H750_ART_PI
+	bool "STM32H750 ART Pi board"
+
 source "board/st/stm32h743-eval/Kconfig"
 source "board/st/stm32h743-disco/Kconfig"
+source "board/st/stm32h750-art-pi/Kconfig"
 
 endif
board/st/stm32h750-art-pi/Kconfig new file +19 -0
new file mode 100644
index 0000000..c31b984
@@ -0,0 +1,19 @@
+if TARGET_STM32H750_ART_PI
+
+config SYS_BOARD
+	string
+	default "stm32h750-art-pi"
+
+config SYS_VENDOR
+	string
+	default "st"
+
+config SYS_SOC
+	string
+	default "stm32h7"
+
+config SYS_CONFIG_NAME
+	string
+	default "stm32h750-art-pi"
+
+endif
board/st/stm32h750-art-pi/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000..9578833
@@ -0,0 +1,7 @@
+STM32H750 ART PI BOARD
+M:	Dillon Min <[email protected]>
+S:	Maintained
+F:	board/st/stm32h750-art-pi
+F:	include/configs/stm32h750-art-pi.h
+F:	configs/stm32h750-art-pi_defconfig
+F:	arch/arm/dts/stm32h7*
board/st/stm32h750-art-pi/Makefile new file +6 -0
new file mode 100644
index 0000000..a06de87
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2021, RT-Thread - All Rights Reserved
+# Author(s): Dillon Min, <[email protected]> for RT-Thread.
+
+obj-y	:= stm32h750-art-pi.o
board/st/stm32h750-art-pi/stm32h750-art-pi.c new file +58 -0

58 lines not on this page · raw message

configs/stm32h750-art-pi_defconfig new file +51 -0

51 lines not on this page · raw message

include/configs/stm32h750-art-pi.h new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 4/6 ram: stm32: fix strsep failed on read only memory

In reply to dillon.minfei at gmail.com

From: dillon min <[email protected]>

strsep will change data from original memory address, in case the memory is in non-sdram/sram place, will run into a bug(hang at SDRAM: )

just add a temporary array to store bank_name[] to fix this bug.

Fixes f303aaf ("ram: stm32: add second SDRAM bank management")

---

v2: no changes

 drivers/ram/stm32_sdram.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ram/stm32_sdram.c +3 -0
index 540ad85..da27677 100644
@@ -268,6 +268,7 @@ static int stm32_fmc_of_to_plat(struct udevice *dev)
 	u32 swp_fmc;
 	ofnode bank_node;
 	char *bank_name;
+	char _bank_name[128] = {0};
 	u8 bank = 0;
 	int ret;
 
@@ -300,6 +301,8 @@ static int stm32_fmc_of_to_plat(struct udevice *dev)
 	dev_for_each_subnode(bank_node, dev) {
 		/* extract the bank index from DT */
 		bank_name = (char *)ofnode_get_name(bank_node);
+		strcpy(_bank_name, bank_name);
+		bank_name = _bank_name;
 		strsep(&bank_name, "@");
 		if (!bank_name) {
 			pr_err("missing sdram bank index");
Signature · 1 line
2.7.4
#7 lore raw

PATCH v2 5/6 dt-bindings: pinctrl: stm32: Add st, stm32h750-pinctrl for stm32h750 soc

In reply to dillon.minfei at gmail.com

From: dillon min <[email protected]>

This patch add st,stm32h750-pinctrl for stm32h750 soc

---

v2: first add

 doc/device-tree-bindings/pinctrl/st,stm32-pinctrl.txt | 1 +
 1 file changed, 1 insertion(+)
doc/device-tree-bindings/pinctrl/st,stm32-pinctrl.txt +1 -0
index 0016925..472539c 100644
@@ -13,6 +13,7 @@ Required properies:
    "st,stm32f746-pinctrl"
    "st,stm32f769-pinctrl"
    "st,stm32h743-pinctrl"
+   "st,stm32h750-pinctrl"
    "st,stm32mp157-pinctrl"
    "st,stm32mp157-z-pinctrl"
  - #address-cells: The value of this property must be 1
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 6/6 pinctrl: stm32: Add st, stm32h750-pinctrl compatible string

In reply to dillon.minfei at gmail.com

From: dillon min <[email protected]>

Due to DT kernel synchronisation, add new pinctrl compatible string for stm32h750.

---

v2: first add

 drivers/pinctrl/pinctrl_stm32.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/pinctrl_stm32.c +1 -0
index 6c98538..c5279c4 100644
@@ -491,6 +491,7 @@ static const struct udevice_id stm32_pinctrl_ids[] = {
 	{ .compatible = "st,stm32f746-pinctrl" },
 	{ .compatible = "st,stm32f769-pinctrl" },
 	{ .compatible = "st,stm32h743-pinctrl" },
+	{ .compatible = "st,stm32h750-pinctrl" },
 	{ .compatible = "st,stm32mp157-pinctrl" },
 	{ .compatible = "st,stm32mp157-z-pinctrl" },
 	{ }
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 2/6 ARM: dts: stm32: Add RT-Thread art-pi board support

In reply to dillon.minfei at gmail.com

some minors remark below

with this, you can add

thanks

Patrice

Quoted 14 lines · dillon.minfei at gmail.com

From: dillon min <[email protected]>

All these files are add for support rt-thread art-pi board

the detail board information can be found at:
https://art-pi.gitee.io/website/

board resources:
- stm32h750xbh6 128k flash, 1024k sram
- 32MiB sdram
- 16MiB spi flash
- 8MiB qspi flash
- onboard wifi, bt, fm

Quoted 5 lines

Add following changes to sync with kernel device tree files:
- add stm32h7-pinctrl.dtsi to include pin defines for all stm32h743/50 boards
- add stm32h7(5/3)0-pinctrl.dtsi
- move gpio(a..k) register defines to stm32h743.dtsi, sync with kernel
- introduce stm32h750i-art-pi-u-boot.dtsi for sdram paramter, fmc pins

s/parmeter/parameter

Quoted 3 lines

---

[...]

arch/arm/dts/stm32h750-pinctrl.dtsi line 4

Quoted 10 lines
arch/arm/dts/stm32h750-pinctrl.dtsi new file +4 -0
new file mode 100644
index 0000000..24e9997
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2021 - All Rights Reserved
+ * Author: Dillon Min  <[email protected]> for STMicroelectronics.

As you are not member of STMicroelectronics company, remove the "for STMicroelectronics."

Quoted 315 lines
arch/arm/dts/stm32h750-pinctrl.dtsi new file +7 -0
+ */
+
+#include "stm32h7-pinctrl.dtsi"
+
+&pinctrl{
+	compatible = "st,stm32h750-pinctrl";
+};
arch/arm/dts/stm32h750.dtsi new file +5 -0
new file mode 100644
index 0000000..99533f3
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/* Copyright (C) STMicroelectronics 2021 - All Rights Reserved */
+
+#include "stm32h743.dtsi"
+
arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi new file +81 -0
new file mode 100644
index 0000000..326a553
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <stm32h7-u-boot.dtsi>
+
+&fmc {
+	/*
+	 * Memory configuration from sdram datasheet W9825G6KH
+	 * first bank is bank at 0
+	 * second bank is bank at 1
+	 */
+	bank1: bank at 0 {
+		st,sdram-control = /bits/ 8 <NO_COL_9
+					     NO_ROW_13
+					     MWIDTH_16
+					     BANKS_4
+					     CAS_2
+					     SDCLK_3
+					     RD_BURST_EN
+					     RD_PIPE_DL_0>;
+		st,sdram-timing = /bits/ 8 <TMRD_2
+					    TXSR_6
+					    TRAS_6
+					    TRC_6
+					    TRP_2
+					    TWR_2
+					    TRCD_2>;
+		st,sdram-refcount = <677>;
+	};
+};
+
+&pinctrl {
+	fmc_pins: fmc at 0 {
+		pins {
+			pinmux = <STM32_PINMUX('D', 0, AF12)>,
+				 <STM32_PINMUX('D', 1, AF12)>,
+				 <STM32_PINMUX('D', 8, AF12)>,
+				 <STM32_PINMUX('D', 9, AF12)>,
+				 <STM32_PINMUX('D',10, AF12)>,
+				 <STM32_PINMUX('D',14, AF12)>,
+				 <STM32_PINMUX('D',15, AF12)>,
+
+				 <STM32_PINMUX('E', 0, AF12)>,
+				 <STM32_PINMUX('E', 1, AF12)>,
+				 <STM32_PINMUX('E', 7, AF12)>,
+				 <STM32_PINMUX('E', 8, AF12)>,
+				 <STM32_PINMUX('E', 9, AF12)>,
+				 <STM32_PINMUX('E',10, AF12)>,
+				 <STM32_PINMUX('E',11, AF12)>,
+				 <STM32_PINMUX('E',12, AF12)>,
+				 <STM32_PINMUX('E',13, AF12)>,
+				 <STM32_PINMUX('E',14, AF12)>,
+				 <STM32_PINMUX('E',15, AF12)>,
+
+				 <STM32_PINMUX('F', 0, AF12)>,
+				 <STM32_PINMUX('F', 1, AF12)>,
+				 <STM32_PINMUX('F', 2, AF12)>,
+				 <STM32_PINMUX('F', 3, AF12)>,
+				 <STM32_PINMUX('F', 4, AF12)>,
+				 <STM32_PINMUX('F', 5, AF12)>,
+				 <STM32_PINMUX('F',11, AF12)>,
+				 <STM32_PINMUX('F',12, AF12)>,
+				 <STM32_PINMUX('F',13, AF12)>,
+				 <STM32_PINMUX('F',14, AF12)>,
+				 <STM32_PINMUX('F',15, AF12)>,
+
+				 <STM32_PINMUX('G', 0, AF12)>,
+				 <STM32_PINMUX('G', 1, AF12)>,
+				 <STM32_PINMUX('G', 2, AF12)>,
+				 <STM32_PINMUX('G', 4, AF12)>,
+				 <STM32_PINMUX('G', 5, AF12)>,
+				 <STM32_PINMUX('G', 8, AF12)>,
+				 <STM32_PINMUX('G',15, AF12)>,
+
+				 <STM32_PINMUX('H', 5, AF12)>,
+				 <STM32_PINMUX('C', 2, AF12)>,
+				 <STM32_PINMUX('C', 3, AF12)>;
+
+			slew-rate = <3>;
+		};
+	};
+};
arch/arm/dts/stm32h750i-art-pi.dts new file +188 -0
new file mode 100644
index 0000000..dd81198
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * Copyright 2021 - Dillon Min <[email protected]>
+ *
+ */
+
+/dts-v1/;
+#include "stm32h750.dtsi"
+#include "stm32h750-pinctrl.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "RT-Thread STM32H750i-ART-PI board";
+	compatible = "st,stm32h750i-art-pi", "st,stm32h750";
+
+	chosen {
+		bootargs = "root=/dev/ram";
+		stdout-path = "serial0:2000000n8";
+	};
+
+	memory at c0000000 {
+		device_type = "memory";
+		reg = <0xc0000000 0x2000000>;
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,cma {
+			compatible = "shared-dma-pool";
+			no-map;
+			size = <0x100000>;
+			linux,dma-default;
+		};
+	};
+
+	aliases {
+		serial0 = &uart4;
+		serial1 = &usart3;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		led-red {
+			gpios = <&gpioi 8 0>;
+		};
+		led-green {
+			gpios = <&gpioc 15 0>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	v3v3: regulator-v3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "v3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	wlan_pwr: regulator-wlan {
+		compatible = "regulator-fixed";
+
+		regulator-name = "wl-reg";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+
+		gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+};
+
+&clk_hse {
+	clock-frequency = <25000000>;
+};
+
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
+&mac {
+	status = "disabled";
+	pinctrl-0	= <&ethernet_rmii>;
+	pinctrl-names	= "default";
+	phy-mode	= "rmii";
+	phy-handle	= <&phy0>;
+
+	mdio0 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "snps,dwmac-mdio";
+		phy0: ethernet-phy at 0 {
+			reg = <0>;
+		};
+	};
+};
+
+&sdmmc1 {
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc1_b4_pins_a>;
+	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
+	broken-cd;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&v3v3>;
+	status = "okay";
+};
+
+&sdmmc2 {
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc2_b4_pins_a>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	broken-cd;
+	non-removable;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&wlan_pwr>;
+	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
+&spi1 {
+	status = "okay";
+	pinctrl-0 = <&spi1_pins>;
+	pinctrl-names = "default";
+	cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
+	dmas = <&dmamux1 37 0x400 0x05>,
+	       <&dmamux1 38 0x400 0x05>;
+	dma-names = "rx", "tx";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "winbond,w25q128", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <80000000>;
+
+		partition at 0 {
+			label = "root filesystem";
+			reg = <0 0x1000000>;
+		};
+	};
+};
+
+&usart2 {
+	pinctrl-0 = <&usart2_pins>;
+	pinctrl-names = "default";
+	status = "disabled";
+};
+
+&usart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usart3_pins>;
+	dmas = <&dmamux1 45 0x400 0x05>,
+	       <&dmamux1 46 0x400 0x05>;
+	dma-names = "rx", "tx";
+	st,hw-flow-ctrl;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		host-wakeup-gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
+		device-wakeup-gpios = <&gpioi 10 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpioi 11 GPIO_ACTIVE_HIGH>;
+		max-speed = <115200>;
+	};
+};
+
+&uart4 {
+	pinctrl-0 = <&uart4_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
include/dt-bindings/memory/stm32-sdram.h +2 -0
index ab91d2b..90ef2e1 100644
@@ -34,8 +34,10 @@
 #define TXSR_1		(1 - 1)
 #define TXSR_6		(6 - 1)
 #define TXSR_7		(7 - 1)
+#define TXSR_8		(8 - 1)
 #define TRAS_1		(1 - 1)
 #define TRAS_4		(4 - 1)
+#define TRAS_6		(6 - 1)
 #define TRC_6		(6 - 1)
 #define TWR_1		(1 - 1)
 #define TWR_2		(2 - 1)
author
#4 lore raw

PATCH v2 2/6 ARM: dts: stm32: Add RT-Thread art-pi board support

Hi Patrice,

Thanks for the quick reply.

Quoted 26 lines · Patrice CHOTARD

some minors remark below

with this, you can add

thanks

Patrice

Quoted 14 lines · dillon.minfei at gmail.com

From: dillon min <[email protected]>

All these files are add for support rt-thread art-pi board

the detail board information can be found at:
https://art-pi.gitee.io/website/

board resources:
- stm32h750xbh6 128k flash, 1024k sram
- 32MiB sdram
- 16MiB spi flash
- 8MiB qspi flash
- onboard wifi, bt, fm

Quoted 7 lines
Quoted 5 lines

Add following changes to sync with kernel device tree files:
- add stm32h7-pinctrl.dtsi to include pin defines for all stm32h743/50 boards
- add stm32h7(5/3)0-pinctrl.dtsi
- move gpio(a..k) register defines to stm32h743.dtsi, sync with kernel
- introduce stm32h750i-art-pi-u-boot.dtsi for sdram paramter, fmc pins

s/parmeter/parameter

Okay.

Quoted 6 lines
Quoted 4 lines

---

[...]

Will add diff description in next submission.

Quoted 13 lines

arch/arm/dts/stm32h750-pinctrl.dtsi line 4

Quoted 11 lines
arch/arm/dts/stm32h750-pinctrl.dtsi new file +4 -0
new file mode 100644
index 0000000..24e9997
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2021 - All Rights Reserved
+ * Author: Dillon Min  <[email protected]> for STMicroelectronics.

As you are not member of STMicroelectronics company, remove the "for STMicroelectronics."

Okay, thanks.

Quoted 316 lines
Quoted 316 lines
arch/arm/dts/stm32h750-pinctrl.dtsi new file +7 -0
+ */
+
+#include "stm32h7-pinctrl.dtsi"
+
+&pinctrl{
+     compatible = "st,stm32h750-pinctrl";
+};
arch/arm/dts/stm32h750.dtsi new file +5 -0
new file mode 100644
index 0000000..99533f3
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/* Copyright (C) STMicroelectronics 2021 - All Rights Reserved */
+
+#include "stm32h743.dtsi"
+
arch/arm/dts/stm32h750i-art-pi-u-boot.dtsi new file +81 -0
new file mode 100644
index 0000000..326a553
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <stm32h7-u-boot.dtsi>
+
+&fmc {
+     /*
+      * Memory configuration from sdram datasheet W9825G6KH
+      * first bank is bank at 0
+      * second bank is bank at 1
+      */
+     bank1: bank at 0 {
+             st,sdram-control = /bits/ 8 <NO_COL_9
+                                          NO_ROW_13
+                                          MWIDTH_16
+                                          BANKS_4
+                                          CAS_2
+                                          SDCLK_3
+                                          RD_BURST_EN
+                                          RD_PIPE_DL_0>;
+             st,sdram-timing = /bits/ 8 <TMRD_2
+                                         TXSR_6
+                                         TRAS_6
+                                         TRC_6
+                                         TRP_2
+                                         TWR_2
+                                         TRCD_2>;
+             st,sdram-refcount = <677>;
+     };
+};
+
+&pinctrl {
+     fmc_pins: fmc at 0 {
+             pins {
+                     pinmux = <STM32_PINMUX('D', 0, AF12)>,
+                              <STM32_PINMUX('D', 1, AF12)>,
+                              <STM32_PINMUX('D', 8, AF12)>,
+                              <STM32_PINMUX('D', 9, AF12)>,
+                              <STM32_PINMUX('D',10, AF12)>,
+                              <STM32_PINMUX('D',14, AF12)>,
+                              <STM32_PINMUX('D',15, AF12)>,
+
+                              <STM32_PINMUX('E', 0, AF12)>,
+                              <STM32_PINMUX('E', 1, AF12)>,
+                              <STM32_PINMUX('E', 7, AF12)>,
+                              <STM32_PINMUX('E', 8, AF12)>,
+                              <STM32_PINMUX('E', 9, AF12)>,
+                              <STM32_PINMUX('E',10, AF12)>,
+                              <STM32_PINMUX('E',11, AF12)>,
+                              <STM32_PINMUX('E',12, AF12)>,
+                              <STM32_PINMUX('E',13, AF12)>,
+                              <STM32_PINMUX('E',14, AF12)>,
+                              <STM32_PINMUX('E',15, AF12)>,
+
+                              <STM32_PINMUX('F', 0, AF12)>,
+                              <STM32_PINMUX('F', 1, AF12)>,
+                              <STM32_PINMUX('F', 2, AF12)>,
+                              <STM32_PINMUX('F', 3, AF12)>,
+                              <STM32_PINMUX('F', 4, AF12)>,
+                              <STM32_PINMUX('F', 5, AF12)>,
+                              <STM32_PINMUX('F',11, AF12)>,
+                              <STM32_PINMUX('F',12, AF12)>,
+                              <STM32_PINMUX('F',13, AF12)>,
+                              <STM32_PINMUX('F',14, AF12)>,
+                              <STM32_PINMUX('F',15, AF12)>,
+
+                              <STM32_PINMUX('G', 0, AF12)>,
+                              <STM32_PINMUX('G', 1, AF12)>,
+                              <STM32_PINMUX('G', 2, AF12)>,
+                              <STM32_PINMUX('G', 4, AF12)>,
+                              <STM32_PINMUX('G', 5, AF12)>,
+                              <STM32_PINMUX('G', 8, AF12)>,
+                              <STM32_PINMUX('G',15, AF12)>,
+
+                              <STM32_PINMUX('H', 5, AF12)>,
+                              <STM32_PINMUX('C', 2, AF12)>,
+                              <STM32_PINMUX('C', 3, AF12)>;
+
+                     slew-rate = <3>;
+             };
+     };
+};
arch/arm/dts/stm32h750i-art-pi.dts new file +188 -0
new file mode 100644
index 0000000..dd81198
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * Copyright 2021 - Dillon Min <[email protected]>
+ *
+ */
+
+/dts-v1/;
+#include "stm32h750.dtsi"
+#include "stm32h750-pinctrl.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+     model = "RT-Thread STM32H750i-ART-PI board";
+     compatible = "st,stm32h750i-art-pi", "st,stm32h750";
+
+     chosen {
+             bootargs = "root=/dev/ram";
+             stdout-path = "serial0:2000000n8";
+     };
+
+     memory at c0000000 {
+             device_type = "memory";
+             reg = <0xc0000000 0x2000000>;
+     };
+
+     reserved-memory {
+             #address-cells = <1>;
+             #size-cells = <1>;
+             ranges;
+
+             linux,cma {
+                     compatible = "shared-dma-pool";
+                     no-map;
+                     size = <0x100000>;
+                     linux,dma-default;
+             };
+     };
+
+     aliases {
+             serial0 = &uart4;
+             serial1 = &usart3;
+     };
+
+     leds {
+             compatible = "gpio-leds";
+             led-red {
+                     gpios = <&gpioi 8 0>;
+             };
+             led-green {
+                     gpios = <&gpioc 15 0>;
+                     linux,default-trigger = "heartbeat";
+             };
+     };
+
+     v3v3: regulator-v3v3 {
+             compatible = "regulator-fixed";
+             regulator-name = "v3v3";
+             regulator-min-microvolt = <3300000>;
+             regulator-max-microvolt = <3300000>;
+             regulator-always-on;
+     };
+
+     wlan_pwr: regulator-wlan {
+             compatible = "regulator-fixed";
+
+             regulator-name = "wl-reg";
+             regulator-min-microvolt = <3300000>;
+             regulator-max-microvolt = <3300000>;
+
+             gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
+             enable-active-high;
+     };
+};
+
+&clk_hse {
+     clock-frequency = <25000000>;
+};
+
+&dma1 {
+     status = "okay";
+};
+
+&dma2 {
+     status = "okay";
+};
+
+&mac {
+     status = "disabled";
+     pinctrl-0       = <&ethernet_rmii>;
+     pinctrl-names   = "default";
+     phy-mode        = "rmii";
+     phy-handle      = <&phy0>;
+
+     mdio0 {
+             #address-cells = <1>;
+             #size-cells = <0>;
+             compatible = "snps,dwmac-mdio";
+             phy0: ethernet-phy at 0 {
+                     reg = <0>;
+             };
+     };
+};
+
+&sdmmc1 {
+     pinctrl-names = "default", "opendrain", "sleep";
+     pinctrl-0 = <&sdmmc1_b4_pins_a>;
+     pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+     pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
+     broken-cd;
+     st,neg-edge;
+     bus-width = <4>;
+     vmmc-supply = <&v3v3>;
+     status = "okay";
+};
+
+&sdmmc2 {
+     pinctrl-names = "default", "opendrain", "sleep";
+     pinctrl-0 = <&sdmmc2_b4_pins_a>;
+     pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
+     pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+     broken-cd;
+     non-removable;
+     st,neg-edge;
+     bus-width = <4>;
+     vmmc-supply = <&wlan_pwr>;
+     status = "okay";
+
+     #address-cells = <1>;
+     #size-cells = <0>;
+     brcmf: bcrmf at 1 {
+             reg = <1>;
+             compatible = "brcm,bcm4329-fmac";
+     };
+};
+
+&spi1 {
+     status = "okay";
+     pinctrl-0 = <&spi1_pins>;
+     pinctrl-names = "default";
+     cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
+     dmas = <&dmamux1 37 0x400 0x05>,
+            <&dmamux1 38 0x400 0x05>;
+     dma-names = "rx", "tx";
+
+     flash at 0 {
+             #address-cells = <1>;
+             #size-cells = <1>;
+             compatible = "winbond,w25q128", "jedec,spi-nor";
+             reg = <0>;
+             spi-max-frequency = <80000000>;
+
+             partition at 0 {
+                     label = "root filesystem";
+                     reg = <0 0x1000000>;
+             };
+     };
+};
+
+&usart2 {
+     pinctrl-0 = <&usart2_pins>;
+     pinctrl-names = "default";
+     status = "disabled";
+};
+
+&usart3 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&usart3_pins>;
+     dmas = <&dmamux1 45 0x400 0x05>,
+            <&dmamux1 46 0x400 0x05>;
+     dma-names = "rx", "tx";
+     st,hw-flow-ctrl;
+     status = "okay";
+
+     bluetooth {
+             compatible = "brcm,bcm43438-bt";
+             host-wakeup-gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
+             device-wakeup-gpios = <&gpioi 10 GPIO_ACTIVE_HIGH>;
+             shutdown-gpios = <&gpioi 11 GPIO_ACTIVE_HIGH>;
+             max-speed = <115200>;
+     };
+};
+
+&uart4 {
+     pinctrl-0 = <&uart4_pins>;
+     pinctrl-names = "default";
+     status = "okay";
+};
include/dt-bindings/memory/stm32-sdram.h +2 -0
index ab91d2b..90ef2e1 100644
@@ -34,8 +34,10 @@
 #define TXSR_1               (1 - 1)
 #define TXSR_6               (6 - 1)
 #define TXSR_7               (7 - 1)
+#define TXSR_8               (8 - 1)
 #define TRAS_1               (1 - 1)
 #define TRAS_4               (4 - 1)
+#define TRAS_6               (6 - 1)
 #define TRC_6                (6 - 1)
 #define TWR_1                (1 - 1)
 #define TWR_2                (2 - 1)