Skip to contentSkip to conversation

Add rt-thread art-pi board support

PATCH Superseded dillon.minfei at gmail.com 2 participants 11 messages Mar 29, 2021 – Mar 31, 2021

Subsystems (6)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 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 v3:
two mirror changes in [PATCH v3 2/6], others same to version 2
- remove "for STMicroelectronics." from arch/arm/dts/stm32h750-pinctrl.dtsi
- correct misspelling parameters
you can found detail patch v2 information at link:
https://patchwork.ozlabs.org/project/uboot/list/?series=236009

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

*** BLURB HERE ***

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

---
v3: no changes

 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 v3 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 parameters, fmc pins

---
v3:
- remove "for STMicroelectronics." from arch/arm/dts/stm32h750-pinctrl.dtsi
- correct misspelling parameters

 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..57b7ebe
@@ -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]>
+ */
+
+#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
#3 lore raw

PATCH v3 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/

---
v3: no changes

 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
#4 lore raw

PATCH v3 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")

---
v3: 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 v3 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

---
v3: no changes

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

---
v3: no changes

 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
#9 lore raw

v3 cover Add rt-thread art-pi board support

In reply to dillon.minfei at gmail.com

Hi Dillon

I discussed with Alexandre Torque about the pinctrl rework you did on kernel side for stm32h750. When the kernel series will be fully accepted on kernel side, you can resubmit the equivalent on u-boot side.

Nevertheless, there is one issue i didn't spot on previous review regarding patch 4 "ram: stm32: fix strsep failed on read only memory"

Patrice

Quoted 75 lines · dillon.minfei at gmail.com

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 v3:
two mirror changes in [PATCH v3 2/6], others same to version 2
- remove "for STMicroelectronics." from arch/arm/dts/stm32h750-pinctrl.dtsi
- correct misspelling parameters
you can found detail patch v2 information at link:
https://patchwork.ozlabs.org/project/uboot/list/?series=236009

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

*** BLURB HERE ***

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
#5 lore raw

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

In reply to dillon.minfei at gmail.com

one remark below

Quoted 31 lines · 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")

---
v3: no changes

 drivers/ram/stm32_sdram.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ram/stm32_sdram.c +1 -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;
 

drivers/ram/stm32_sdram.c static int stm32_fmc_of_to_plat(struct udevice *dev) · line 304

Quoted 4 lines
drivers/ram/stm32_sdram.c +1 -0
@@ -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);

strcpy/strncpy usage is to be avoided. Instead use strlcpy()

Thanks

Quoted 5 lines
drivers/ram/stm32_sdram.c +1 -0
+		bank_name = _bank_name;
 		strsep(&bank_name, "@");
 		if (!bank_name) {
 			pr_err("missing sdram bank index");
author
#10 lore raw

v3 cover Add rt-thread art-pi board support

In reply to Patrice CHOTARD

Hi Patrice,

Thanks for the reply,

Quoted 6 lines · Patrice CHOTARD

Hi Dillon

I discussed with Alexandre Torque about the pinctrl rework you did on kernel side for stm32h750. When the kernel series will be fully accepted on kernel side, you can resubmit the equivalent on u-boot side.

Agree, I loop you to the kernel mailing list , just let you know the status of device tree review on kernel side, i'll hold u-boot's patch submission, until kernel's patch is fully accepted.

Quoted 2 lines

Nevertheless, there is one issue I didn't spot on previous review regarding patch 4 "ram: stm32: fix strsep failed on read only memory"

Okay, i'm going to rework that patch, thanks.

Quoted 78 lines

Patrice

Quoted 75 lines · dillon.minfei at gmail.com

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 v3:
two mirror changes in [PATCH v3 2/6], others same to version 2
- remove "for STMicroelectronics." from arch/arm/dts/stm32h750-pinctrl.dtsi
- correct misspelling parameters
you can found detail patch v2 information at link:
https://patchwork.ozlabs.org/project/uboot/list/?series=236009

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

*** BLURB HERE ***

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
author
#6 lore raw

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

In reply to Patrice CHOTARD
Quoted 34 lines · Patrice CHOTARD

one remark below

Quoted 30 lines · 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")

---
v3: no changes

 drivers/ram/stm32_sdram.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ram/stm32_sdram.c +1 -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;
 
Quoted 7 lines

drivers/ram/stm32_sdram.c static int stm32_fmc_of_to_plat(struct udevice *dev) · line 304

Quoted 5 lines
drivers/ram/stm32_sdram.c +1 -0
@@ -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);

strcpy/strncpy usage is to be avoided. Instead use strlcpy()

Agree, will add to next submission.
thanks.

Quoted 8 lines

Thanks

Quoted 5 lines
drivers/ram/stm32_sdram.c +1 -0
+             bank_name = _bank_name;
              strsep(&bank_name, "@");
              if (!bank_name) {
                      pr_err("missing sdram bank index");