All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25
@ 2024-01-15 14:05 Patrick Delaunay
  2024-01-15 14:05 ` [PATCH v2 01/14] arm64: dts: st: add bsec " Patrick Delaunay
                   ` (13 more replies)
  0 siblings, 14 replies; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Alexandre Torgue, Bhupesh Sharma,
	Christian Hewitt, FUKAUMI Naoki, Gatien Chevallier,
	Grzegorz Szymaszek, Hai Pham, Igor Opaniuk, Ilias Apalodimas,
	Jonas Karlman, Kever Yang, Lukasz Majewski, Marek Vasut,
	Masahisa Kojima, Michal Simek, Neil Armstrong, Oleksandr Suvorov,
	Patrice Chotard, Rasmus Villemoes, Sean Anderson, Simon Glass,
	Svyatoslav Ryhel, Tom Rini, U-Boot STM32, Yann Gautier


Add BSEC support to STM32MP25 SoC family with SoC information:
- SERIAL number with UUID (BSEC_OTP_DATA5)
- RPN = Device part number (BSEC_OTP_DATA9)
- PKG = package data register (Bits 2:0 of BSEC_OTP_DATA122)

and with board information for STMicroelectronics boards
- BOARD identifier:  OTP246
- MAC address: OTP247 and after


Changes in v2:
- fix CONFIG name with 'x': TARGET_ST_STM32MP15x TARGET_ST_STM32MP13x
- add "arm: Rename STM32MP13x"
- add "arm: Rename STM32MP15x"

Patrice Chotard (1):
  stm32mp: add setup_serial_number for stm32mp25

Patrick Delaunay (12):
  arm64: dts: st: add bsec support to stm32mp25
  stm32mp: bsec: add driver data
  stm32mp: bsec: add support of stm32mp25
  configs: stm32mp25: add support of fuse command
  stm32mp: add soc.c file
  smt32mp: add setup_mac_address for stm32mp25
  stm32mp: stm32prog: add support of stm32mp25
  stm32mp: activate the command stboard for stm32mp25 boards
  board: st: stm32mp2: add checkboard
  board: st: stm32mp2: display the board identification
  arm: Rename STM32MP13x
  arm: Rename STM32MP15x

Yann Gautier (1):
  arm: stm32mp: add Rev.B support for STM32MP25

 arch/arm/dts/Makefile                         |   4 +-
 arch/arm/dts/stm32mp15-u-boot.dtsi            |   2 +-
 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi      |   4 +-
 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi      |   4 +-
 arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi      |   4 +-
 arch/arm/dts/stm32mp25-u-boot.dtsi            |   4 +
 arch/arm/dts/stm32mp251.dtsi                  |  16 +++
 arch/arm/mach-stm32mp/Kconfig                 |   8 +-
 arch/arm/mach-stm32mp/Kconfig.13x             |   4 +-
 arch/arm/mach-stm32mp/Kconfig.15x             |   6 +-
 arch/arm/mach-stm32mp/Makefile                |   5 +-
 arch/arm/mach-stm32mp/bsec.c                  |  45 +++++--
 arch/arm/mach-stm32mp/cmd_stm32key.c          |  20 +--
 .../mach-stm32mp/cmd_stm32prog/stm32prog.h    |  12 +-
 arch/arm/mach-stm32mp/include/mach/stm32.h    |  22 ++--
 .../arm/mach-stm32mp/include/mach/sys_proto.h |   1 +
 arch/arm/mach-stm32mp/soc.c                   | 118 ++++++++++++++++++
 arch/arm/mach-stm32mp/stm32mp1/Makefile       |   4 +-
 arch/arm/mach-stm32mp/stm32mp1/cpu.c          |  96 +-------------
 arch/arm/mach-stm32mp/stm32mp1/fdt.c          |  10 +-
 arch/arm/mach-stm32mp/stm32mp2/cpu.c          |  14 +--
 arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c   |   3 +
 board/st/common/Kconfig                       |   2 +-
 board/st/common/cmd_stboard.c                 |   2 +
 board/st/stm32mp1/Kconfig                     |   4 +-
 board/st/stm32mp1/stm32mp1.c                  |   6 +-
 board/st/stm32mp2/stm32mp2.c                  |  37 ++++++
 configs/stm32mp13_defconfig                   |   4 +-
 configs/stm32mp15_basic_defconfig             |   2 +-
 configs/stm32mp15_defconfig                   |   2 +-
 configs/stm32mp15_trusted_defconfig           |   4 +-
 configs/stm32mp25_defconfig                   |   1 +
 drivers/clk/stm32/Kconfig                     |   4 +-
 33 files changed, 297 insertions(+), 177 deletions(-)
 create mode 100644 arch/arm/mach-stm32mp/soc.c

-- 
2.25.1


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

* [PATCH v2 01/14] arm64: dts: st: add bsec support to stm32mp25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:22   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25 Patrick Delaunay
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Patrice Chotard, Alexandre Torgue, Simon Glass,
	uboot-stm32

Add BSEC support to STM32MP25 SoC family with SoC information:
- RPN = Device part number (BSEC_OTP_DATA9)
- PKG = package data register (Bits 2:0 of BSEC_OTP_DATA122)

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
---

(no changes since v1)

 arch/arm/dts/stm32mp25-u-boot.dtsi |  4 ++++
 arch/arm/dts/stm32mp251.dtsi       | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/arch/arm/dts/stm32mp25-u-boot.dtsi b/arch/arm/dts/stm32mp25-u-boot.dtsi
index f4f26add2a41..0c8e95b34163 100644
--- a/arch/arm/dts/stm32mp25-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp25-u-boot.dtsi
@@ -37,6 +37,10 @@
 	};
 };
 
+&bsec {
+	bootph-all;
+};
+
 &gpioa {
 	bootph-all;
 };
diff --git a/arch/arm/dts/stm32mp251.dtsi b/arch/arm/dts/stm32mp251.dtsi
index cf2f28dc1582..44eb664fb510 100644
--- a/arch/arm/dts/stm32mp251.dtsi
+++ b/arch/arm/dts/stm32mp251.dtsi
@@ -127,6 +127,22 @@
 			};
 		};
 
+		bsec: efuse@44000000 {
+			compatible = "st,stm32mp25-bsec";
+			reg = <0x44000000 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			part_number_otp@24 {
+				reg = <0x24 0x4>;
+			};
+
+			package_otp@1e8 {
+				reg = <0x1e8 0x1>;
+				bits = <0 3>;
+			};
+		};
+
 		syscfg: syscon@44230000 {
 			compatible = "st,stm32mp25-syscfg", "syscon";
 			reg = <0x44230000 0x10000>;
-- 
2.25.1


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

* [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
  2024-01-15 14:05 ` [PATCH v2 01/14] arm64: dts: st: add bsec " Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:24   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 03/14] stm32mp: bsec: add driver data Patrick Delaunay
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Yann Gautier, Patrice Chotard, Patrick Delaunay, Tom Rini, U-Boot STM32

From: Yann Gautier <yann.gautier@foss.st.com>

Add chip revision B support for STM32MP25, for displaying it in trace.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c b/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
index 4b2f70af9cc6..7f896a0d65d2 100644
--- a/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
+++ b/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
@@ -167,6 +167,9 @@ void get_soc_name(char name[SOC_NAME_SIZE])
 		case CPU_REV1:
 			cpu_r = "A";
 			break;
+		case CPU_REV2:
+			cpu_r = "B";
+			break;
 		default:
 			break;
 		}
-- 
2.25.1


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

* [PATCH v2 03/14] stm32mp: bsec: add driver data
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
  2024-01-15 14:05 ` [PATCH v2 01/14] arm64: dts: st: add bsec " Patrick Delaunay
  2024-01-15 14:05 ` [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25 Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:24   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25 Patrick Delaunay
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, Simon Glass, U-Boot STM32

Add driver data in  BSEC driver to test presence of OP-TEE TA,
mandatory for STM32MP13 family and prepare the support of new device
with more OTP than 95.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/bsec.c | 38 ++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index 28a8280b2804..705c994d9307 100644
--- a/arch/arm/mach-stm32mp/bsec.c
+++ b/arch/arm/mach-stm32mp/bsec.c
@@ -20,7 +20,6 @@
 #include <linux/iopoll.h>
 #include <linux/printk.h>
 
-#define BSEC_OTP_MAX_VALUE		95
 #define BSEC_OTP_UPPER_START		32
 #define BSEC_TIMEOUT_US			10000
 
@@ -400,6 +399,11 @@ struct stm32mp_bsec_priv {
 	struct udevice *tee;
 };
 
+struct stm32mp_bsec_drvdata {
+	int size;
+	bool ta;
+};
+
 static int stm32mp_bsec_read_otp(struct udevice *dev, u32 *val, u32 otp)
 {
 	struct stm32mp_bsec_plat *plat;
@@ -609,6 +613,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
 			     void *buf, int size)
 {
 	struct stm32mp_bsec_priv *priv = dev_get_priv(dev);
+	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
 	int ret;
 	int i;
 	bool shadow = true, lock = false;
@@ -642,7 +647,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
 
 	otp = offs / sizeof(u32);
 
-	for (i = otp; i < (otp + nb_otp) && i <= BSEC_OTP_MAX_VALUE; i++) {
+	for (i = otp; i < (otp + nb_otp) && i < data->size; i++) {
 		u32 *addr = &((u32 *)buf)[i - otp];
 
 		if (lock)
@@ -665,6 +670,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
 			      const void *buf, int size)
 {
 	struct stm32mp_bsec_priv *priv = dev_get_priv(dev);
+	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
 	int ret = 0;
 	int i;
 	bool shadow = true, lock = false;
@@ -698,7 +704,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
 
 	otp = offs / sizeof(u32);
 
-	for (i = otp; i < otp + nb_otp && i <= BSEC_OTP_MAX_VALUE; i++) {
+	for (i = otp; i < otp + nb_otp && i < data->size; i++) {
 		u32 *val = &((u32 *)buf)[i - otp];
 
 		if (lock)
@@ -732,6 +738,7 @@ static int stm32mp_bsec_of_to_plat(struct udevice *dev)
 
 static int stm32mp_bsec_probe(struct udevice *dev)
 {
+	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
 	int otp;
 	struct stm32mp_bsec_plat *plat;
 	struct clk_bulk clk_bulk;
@@ -745,16 +752,22 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 	}
 
 	if (IS_ENABLED(CONFIG_OPTEE))
-		bsec_optee_open(dev);
+		ret = bsec_optee_open(dev);
+	else
+		ret = -ENOTSUPP;
+	/* failed if OP-TEE TA is required */
+	if (data->ta && !ret)
+		return ret;
 
 	/*
 	 * update unlocked shadow for OTP cleared by the rom code
 	 * only executed in SPL, it is done in TF-A for TFABOOT
 	 */
-	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
+	if (IS_ENABLED(CONFIG_SPL_BUILD) && !data->ta) {
 		plat = dev_get_plat(dev);
 
-		for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
+		/* here 57 is the value for STM32MP15x ROM code, only MPU with SPL support*/
+		for (otp = 57; otp < data->size; otp++)
 			if (!bsec_read_SR_lock(plat->base, otp))
 				bsec_shadow_register(dev, plat->base, otp);
 	}
@@ -762,9 +775,18 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 	return 0;
 }
 
+static const struct stm32mp_bsec_drvdata stm32mp13_data = {
+	.size = 96,
+	.ta = true,
+};
+
+static const struct stm32mp_bsec_drvdata stm32mp15_data = {
+	.size = 96,
+	.ta = false,
+};
 static const struct udevice_id stm32mp_bsec_ids[] = {
-	{ .compatible = "st,stm32mp13-bsec" },
-	{ .compatible = "st,stm32mp15-bsec" },
+	{ .compatible = "st,stm32mp13-bsec", .data = (ulong)&stm32mp13_data},
+	{ .compatible = "st,stm32mp15-bsec", .data = (ulong)&stm32mp15_data},
 	{}
 };
 
-- 
2.25.1


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

* [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (2 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 03/14] stm32mp: bsec: add driver data Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:24   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 05/14] configs: stm32mp25: add support of fuse command Patrick Delaunay
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Patrice Chotard, Igor Opaniuk, Marek Vasut,
	Oleksandr Suvorov, Simon Glass, U-Boot STM32

Add support of BSEC for STM32MP25x family to access OTP.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/bsec.c               | 7 +++++++
 arch/arm/mach-stm32mp/include/mach/stm32.h | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index 705c994d9307..5b869017ec1a 100644
--- a/arch/arm/mach-stm32mp/bsec.c
+++ b/arch/arm/mach-stm32mp/bsec.c
@@ -784,9 +784,16 @@ static const struct stm32mp_bsec_drvdata stm32mp15_data = {
 	.size = 96,
 	.ta = false,
 };
+
+static const struct stm32mp_bsec_drvdata stm32mp25_data = {
+	.size = 368, /* 384 but no access to HWKEY and STM32PRVKEY */
+	.ta = true,
+};
+
 static const struct udevice_id stm32mp_bsec_ids[] = {
 	{ .compatible = "st,stm32mp13-bsec", .data = (ulong)&stm32mp13_data},
 	{ .compatible = "st,stm32mp15-bsec", .data = (ulong)&stm32mp15_data},
+	{ .compatible = "st,stm32mp25-bsec", .data = (ulong)&stm32mp25_data},
 	{}
 };
 
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 46d469881b32..45c929aa605d 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -197,7 +197,8 @@ enum forced_boot_mode {
 #ifdef CONFIG_STM32MP25X
 #define BSEC_OTP_SERIAL	5
 #define BSEC_OTP_RPN	9
-#define BSEC_OTP_PKG	246
+#define BSEC_OTP_PKG	122
+#define BSEC_OTP_MAC	247
 #endif
 
 #ifndef __ASSEMBLY__
-- 
2.25.1


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

* [PATCH v2 05/14] configs: stm32mp25: add support of fuse command
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (3 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25 Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:25   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 06/14] stm32mp: add soc.c file Patrick Delaunay
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, Simon Glass, uboot-stm32

Add support of the command fuse with CONFIG_CMD_FUSE to allow access
on OTP with command line.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 configs/stm32mp25_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/stm32mp25_defconfig b/configs/stm32mp25_defconfig
index 75f27c98b441..9fbd7eb15755 100644
--- a/configs/stm32mp25_defconfig
+++ b/configs/stm32mp25_defconfig
@@ -21,6 +21,7 @@ CONFIG_CMD_ADTIMG=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_CLK=y
+CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADB is not set
 CONFIG_CMD_CACHE=y
-- 
2.25.1


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

* [PATCH v2 06/14] stm32mp: add soc.c file
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (4 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 05/14] configs: stm32mp25: add support of fuse command Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 16:26   ` Igor Opaniuk
  2024-01-15 14:05 ` [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25 Patrick Delaunay
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Patrice Chotard, Bhupesh Sharma, Igor Opaniuk,
	Oleksandr Suvorov, Rasmus Villemoes, Simon Glass, U-Boot STM32

Add a new file soc.c for common functions between stm32mp1 and stm32mp2
family and move print_cpuinfo() in this new file.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/Makefile       |  1 +
 arch/arm/mach-stm32mp/soc.c          | 17 +++++++++++++++++
 arch/arm/mach-stm32mp/stm32mp1/cpu.c | 11 -----------
 arch/arm/mach-stm32mp/stm32mp2/cpu.c | 11 -----------
 4 files changed, 18 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/mach-stm32mp/soc.c

diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
index 00dc25bb275c..fdcbbf91dfd5 100644
--- a/arch/arm/mach-stm32mp/Makefile
+++ b/arch/arm/mach-stm32mp/Makefile
@@ -6,6 +6,7 @@
 obj-y += dram_init.o
 obj-y += syscon.o
 obj-y += bsec.o
+obj-y += soc.o
 
 obj-$(CONFIG_STM32MP15x) += stm32mp1/
 obj-$(CONFIG_STM32MP13x) += stm32mp1/
diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
new file mode 100644
index 000000000000..8d5fa474ccaf
--- /dev/null
+++ b/arch/arm/mach-stm32mp/soc.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
+/*
+ * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
+ */
+
+#include <asm/arch/sys_proto.h>
+
+/* used when CONFIG_DISPLAY_CPUINFO is activated */
+int print_cpuinfo(void)
+{
+	char name[SOC_NAME_SIZE];
+
+	get_soc_name(name);
+	printf("CPU: %s\n", name);
+
+	return 0;
+}
diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
index 55574fd4bebf..00fea7929b2f 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
@@ -158,17 +158,6 @@ void enable_caches(void)
 	dcache_enable();
 }
 
-/* used when CONFIG_DISPLAY_CPUINFO is activated */
-int print_cpuinfo(void)
-{
-	char name[SOC_NAME_SIZE];
-
-	get_soc_name(name);
-	printf("CPU: %s\n", name);
-
-	return 0;
-}
-
 static void setup_boot_mode(void)
 {
 	const u32 serial_addr[] = {
diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
index f43d1aaf72cc..c0f6519e8d7c 100644
--- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
@@ -67,17 +67,6 @@ void enable_caches(void)
 	dcache_enable();
 }
 
-/* used when CONFIG_DISPLAY_CPUINFO is activated */
-int print_cpuinfo(void)
-{
-	char name[SOC_NAME_SIZE];
-
-	get_soc_name(name);
-	printf("CPU: %s\n", name);
-
-	return 0;
-}
-
 int arch_misc_init(void)
 {
 	return 0;
-- 
2.25.1


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

* [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (5 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 06/14] stm32mp: add soc.c file Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 16:23   ` Igor Opaniuk
  2024-01-15 14:05 ` [PATCH v2 08/14] smt32mp: add setup_mac_address " Patrick Delaunay
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice Chotard, Patrick Delaunay, Bhupesh Sharma, Igor Opaniuk,
	Oleksandr Suvorov, Rasmus Villemoes, Simon Glass, U-Boot STM32

From: Patrice Chotard <patrice.chotard@foss.st.com>

Add support of serial number for stm32mp25, gets from OTP with BSEC driver.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 .../arm/mach-stm32mp/include/mach/sys_proto.h |  1 +
 arch/arm/mach-stm32mp/soc.c                   | 31 +++++++++++++++++++
 arch/arm/mach-stm32mp/stm32mp1/cpu.c          | 27 ----------------
 arch/arm/mach-stm32mp/stm32mp2/cpu.c          |  2 ++
 4 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
index 83388fdb7371..2a65efc0a50a 100644
--- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
+++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
@@ -97,6 +97,7 @@ u32 get_bootauth(void);
 
 int get_eth_nb(void);
 int setup_mac_address(void);
+int setup_serial_number(void);
 
 /* board power management : configure vddcore according OPP */
 void board_vddcore_init(u32 voltage_mv);
diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
index 8d5fa474ccaf..ff70ebe97464 100644
--- a/arch/arm/mach-stm32mp/soc.c
+++ b/arch/arm/mach-stm32mp/soc.c
@@ -3,7 +3,11 @@
  * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
  */
 
+#include <env.h>
+#include <misc.h>
 #include <asm/arch/sys_proto.h>
+#include <dm/device.h>
+#include <dm/uclass.h>
 
 /* used when CONFIG_DISPLAY_CPUINFO is activated */
 int print_cpuinfo(void)
@@ -15,3 +19,30 @@ int print_cpuinfo(void)
 
 	return 0;
 }
+
+int setup_serial_number(void)
+{
+	char serial_string[25];
+	u32 otp[3] = {0, 0, 0 };
+	struct udevice *dev;
+	int ret;
+
+	if (env_get("serial#"))
+		return 0;
+
+	ret = uclass_get_device_by_driver(UCLASS_MISC,
+					  DM_DRIVER_GET(stm32mp_bsec),
+					  &dev);
+	if (ret)
+		return ret;
+
+	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
+			otp, sizeof(otp));
+	if (ret < 0)
+		return ret;
+
+	sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
+	env_set("serial#", serial_string);
+
+	return 0;
+}
diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
index 00fea7929b2f..f84cb26fa565 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
@@ -336,33 +336,6 @@ __weak int setup_mac_address(void)
 	return 0;
 }
 
-static int setup_serial_number(void)
-{
-	char serial_string[25];
-	u32 otp[3] = {0, 0, 0 };
-	struct udevice *dev;
-	int ret;
-
-	if (env_get("serial#"))
-		return 0;
-
-	ret = uclass_get_device_by_driver(UCLASS_MISC,
-					  DM_DRIVER_GET(stm32mp_bsec),
-					  &dev);
-	if (ret)
-		return ret;
-
-	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
-			otp, sizeof(otp));
-	if (ret < 0)
-		return ret;
-
-	sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
-	env_set("serial#", serial_string);
-
-	return 0;
-}
-
 __weak void stm32mp_misc_init(void)
 {
 }
diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
index c0f6519e8d7c..301e365cf4f4 100644
--- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
@@ -69,6 +69,8 @@ void enable_caches(void)
 
 int arch_misc_init(void)
 {
+	setup_serial_number();
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH v2 08/14] smt32mp: add setup_mac_address for stm32mp25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (6 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25 Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:26   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25 Patrick Delaunay
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Patrice Chotard, Bhupesh Sharma,
	Oleksandr Suvorov, Rasmus Villemoes, Simon Glass, uboot-stm32

Add a function setup_mac_address() to update the MAC address from the
default location in OTP for stm32mp2 platform.

The max number of OTP for MAC address is increased to 8 for STM32MP25,
defined with get_eth_nb() and checked in setup_mac_address.

The MAC address FF:FF:FF:FF:FF:FF, the broadcast ethaddr, is a invalid
value used for unused MAC address slot in OTP, for example for board
with STM32MP25x part number allows up to 5 ethernet ports but it is not
supported by the hardware, without switch; the associated variable
"enetaddr%d" is not created.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/soc.c          | 70 ++++++++++++++++++++++++++++
 arch/arm/mach-stm32mp/stm32mp1/cpu.c | 58 +----------------------
 arch/arm/mach-stm32mp/stm32mp2/cpu.c |  1 +
 3 files changed, 72 insertions(+), 57 deletions(-)

diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
index ff70ebe97464..fa56b0d2e0f1 100644
--- a/arch/arm/mach-stm32mp/soc.c
+++ b/arch/arm/mach-stm32mp/soc.c
@@ -5,10 +5,14 @@
 
 #include <env.h>
 #include <misc.h>
+#include <net.h>
 #include <asm/arch/sys_proto.h>
 #include <dm/device.h>
 #include <dm/uclass.h>
 
+/* max: 8 OTP for 5 mac address on stm32mp2*/
+#define MAX_NB_OTP	8
+
 /* used when CONFIG_DISPLAY_CPUINFO is activated */
 int print_cpuinfo(void)
 {
@@ -46,3 +50,69 @@ int setup_serial_number(void)
 
 	return 0;
 }
+
+/*
+ * If there is no MAC address in the environment, then it will be initialized
+ * (silently) from the value in the OTP.
+ */
+__weak int setup_mac_address(void)
+{
+	int ret;
+	int i;
+	u32 otp[MAX_NB_OTP];
+	uchar enetaddr[ARP_HLEN];
+	struct udevice *dev;
+	int nb_eth, nb_otp, index;
+
+	if (!IS_ENABLED(CONFIG_NET))
+		return 0;
+
+	nb_eth = get_eth_nb();
+	if (!nb_eth)
+		return 0;
+
+	/* 6 bytes for each MAC addr and 4 bytes for each OTP */
+	nb_otp = DIV_ROUND_UP(ARP_HLEN * nb_eth, 4);
+	if (nb_otp > MAX_NB_OTP) {
+		log_err("invalid number of OTP = %d, max = %d\n", nb_otp, MAX_NB_OTP);
+		return -EINVAL;
+	}
+
+	ret = uclass_get_device_by_driver(UCLASS_MISC,
+					  DM_DRIVER_GET(stm32mp_bsec),
+					  &dev);
+	if (ret)
+		return ret;
+
+	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC), otp, 4 * nb_otp);
+	if (ret < 0)
+		return ret;
+
+	for (index = 0; index < nb_eth; index++) {
+		/* MAC already in environment */
+		if (eth_env_get_enetaddr_by_index("eth", index, enetaddr))
+			continue;
+
+		for (i = 0; i < ARP_HLEN; i++)
+			enetaddr[i] = ((uint8_t *)&otp)[i + ARP_HLEN * index];
+
+		/* skip FF:FF:FF:FF:FF:FF */
+		if (is_broadcast_ethaddr(enetaddr))
+			continue;
+
+		if (!is_valid_ethaddr(enetaddr)) {
+			log_err("invalid MAC address %d in OTP %pM\n",
+				index, enetaddr);
+			return -EINVAL;
+		}
+		log_debug("OTP MAC address %d = %pM\n", index, enetaddr);
+		ret = eth_env_set_enetaddr_by_index("eth", index, enetaddr);
+		if (ret) {
+			log_err("Failed to set mac address %pM from OTP: %d\n",
+				enetaddr, ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
index f84cb26fa565..524778f00c67 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
@@ -14,8 +14,8 @@
 #include <log.h>
 #include <lmb.h>
 #include <misc.h>
-#include <net.h>
 #include <spl.h>
+#include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/arch/stm32.h>
 #include <asm/arch/sys_proto.h>
@@ -280,62 +280,6 @@ static void setup_boot_mode(void)
 	clrsetbits_le32(TAMP_BOOT_CONTEXT, TAMP_BOOT_FORCED_MASK, BOOT_NORMAL);
 }
 
-/*
- * If there is no MAC address in the environment, then it will be initialized
- * (silently) from the value in the OTP.
- */
-__weak int setup_mac_address(void)
-{
-	int ret;
-	int i;
-	u32 otp[3];
-	uchar enetaddr[6];
-	struct udevice *dev;
-	int nb_eth, nb_otp, index;
-
-	if (!IS_ENABLED(CONFIG_NET))
-		return 0;
-
-	nb_eth = get_eth_nb();
-
-	/* 6 bytes for each MAC addr and 4 bytes for each OTP */
-	nb_otp = DIV_ROUND_UP(6 * nb_eth, 4);
-
-	ret = uclass_get_device_by_driver(UCLASS_MISC,
-					  DM_DRIVER_GET(stm32mp_bsec),
-					  &dev);
-	if (ret)
-		return ret;
-
-	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC), otp, 4 * nb_otp);
-	if (ret < 0)
-		return ret;
-
-	for (index = 0; index < nb_eth; index++) {
-		/* MAC already in environment */
-		if (eth_env_get_enetaddr_by_index("eth", index, enetaddr))
-			continue;
-
-		for (i = 0; i < 6; i++)
-			enetaddr[i] = ((uint8_t *)&otp)[i + 6 * index];
-
-		if (!is_valid_ethaddr(enetaddr)) {
-			log_err("invalid MAC address %d in OTP %pM\n",
-				index, enetaddr);
-			return -EINVAL;
-		}
-		log_debug("OTP MAC address %d = %pM\n", index, enetaddr);
-		ret = eth_env_set_enetaddr_by_index("eth", index, enetaddr);
-		if (ret) {
-			log_err("Failed to set mac address %pM from OTP: %d\n",
-				enetaddr, ret);
-			return ret;
-		}
-	}
-
-	return 0;
-}
-
 __weak void stm32mp_misc_init(void)
 {
 }
diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
index 301e365cf4f4..9530aa8534b7 100644
--- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
@@ -70,6 +70,7 @@ void enable_caches(void)
 int arch_misc_init(void)
 {
 	setup_serial_number();
+	setup_mac_address();
 
 	return 0;
 }
-- 
2.25.1


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

* [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (7 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 08/14] smt32mp: add setup_mac_address " Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 17:41   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards Patrick Delaunay
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, Simon Glass, U-Boot STM32

Change OTP number to 364 for STM32MP25 as it is done in bsec driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index ae4bd8842f53..eda98eb61d76 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -28,7 +28,15 @@
 #else
 #define OTP_SIZE_SMC		0
 #endif
-#define OTP_SIZE_TA		776
+/* size of the OTP struct in NVMEM PTA */
+#define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
+#if defined(CONFIG_STM32MP13x) || defined(CONFIG_STM32MP15x)
+/* STM32MP1 with BSEC2 */
+#define OTP_SIZE_TA		_OTP_SIZE_TA(96)
+#else
+/* STM32MP2 with BSEC3 */
+#define OTP_SIZE_TA		_OTP_SIZE_TA(368)
+#endif
 #define PMIC_SIZE		8
 
 enum stm32prog_target {
-- 
2.25.1


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

* [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (8 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25 Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 17:42   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 11/14] board: st: stm32mp2: add checkboard Patrick Delaunay
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Igor Opaniuk, Marek Vasut, Oleksandr Suvorov,
	Patrice Chotard, Simon Glass, U-Boot STM32

Activate the command stboard for stm32mp25 STMicroelectronics boards,
add the default used OTP identifier and the associated board identifier:
- stm32mp25xx-ev1 = MB1936
- stm32mp25xx-dk = MB1605

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

Changes in v2:
- fix CONFIG name with 'x': TARGET_ST_STM32MP15x TARGET_ST_STM32MP13x

 arch/arm/mach-stm32mp/include/mach/stm32.h | 1 +
 board/st/common/Kconfig                    | 2 +-
 board/st/common/cmd_stboard.c              | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 45c929aa605d..726c390977e3 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -198,6 +198,7 @@ enum forced_boot_mode {
 #define BSEC_OTP_SERIAL	5
 #define BSEC_OTP_RPN	9
 #define BSEC_OTP_PKG	122
+#define BSEC_OTP_BOARD	246
 #define BSEC_OTP_MAC	247
 #endif
 
diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
index c1c254d07354..f40d1a78ca36 100644
--- a/board/st/common/Kconfig
+++ b/board/st/common/Kconfig
@@ -1,7 +1,7 @@
 config CMD_STBOARD
 	bool "stboard - command for OTP board information"
 	depends on ARCH_STM32MP
-	default y if TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
+	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
 	help
 	  This compile the stboard command to
 	  read and write the board in the OTP.
diff --git a/board/st/common/cmd_stboard.c b/board/st/common/cmd_stboard.c
index 853ab78bbf16..cb103e69b369 100644
--- a/board/st/common/cmd_stboard.c
+++ b/board/st/common/cmd_stboard.c
@@ -49,7 +49,9 @@ static bool check_stboard(u16 board)
 		0x1298,
 		0x1341,
 		0x1497,
+		0x1605, /* stm32mp25xx-dk */
 		0x1635,
+		0x1936, /* stm32mp25xx-ev1 */
 	};
 
 	for (i = 0; i < ARRAY_SIZE(st_board_id); i++)
-- 
2.25.1


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

* [PATCH v2 11/14] board: st: stm32mp2: add checkboard
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (9 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:27   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 12/14] board: st: stm32mp2: display the board identification Patrick Delaunay
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, uboot-stm32

Implement the weak function checkboard to identify the used board with
compatible in device tree for the support of stm32mp2 STMicroelectronics
boards.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 board/st/stm32mp2/stm32mp2.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
index c97a7efff46e..9a881583d904 100644
--- a/board/st/stm32mp2/stm32mp2.c
+++ b/board/st/stm32mp2/stm32mp2.c
@@ -8,14 +8,28 @@
 #include <config.h>
 #include <env.h>
 #include <fdt_support.h>
+#include <log.h>
 #include <asm/global_data.h>
 #include <asm/arch/sys_proto.h>
+#include <dm/ofnode.h>
 
 /*
  * Get a global data pointer
  */
 DECLARE_GLOBAL_DATA_PTR;
 
+int checkboard(void)
+{
+	const char *fdt_compat;
+	int fdt_compat_len;
+
+	fdt_compat = ofnode_get_property(ofnode_root(), "compatible", &fdt_compat_len);
+
+	log_info("Board: stm32mp2 (%s)\n", fdt_compat && fdt_compat_len ? fdt_compat : "");
+
+	return 0;
+}
+
 /* board dependent setup after realloc */
 int board_init(void)
 {
-- 
2.25.1


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

* [PATCH v2 12/14] board: st: stm32mp2: display the board identification
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (10 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 11/14] board: st: stm32mp2: add checkboard Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-19 13:27   ` Patrice CHOTARD
  2024-01-15 14:05 ` [PATCH v2 13/14] arm: Rename STM32MP13x Patrick Delaunay
  2024-01-15 14:05 ` [PATCH v2 14/14] arm: Rename STM32MP15x Patrick Delaunay
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, uboot-stm32

Add the display of the STMicroelectronics board identification saved in OTP
in stm32mp2 checkboard function.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

(no changes since v1)

 board/st/stm32mp2/stm32mp2.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
index 9a881583d904..aa7dd31996ea 100644
--- a/board/st/stm32mp2/stm32mp2.c
+++ b/board/st/stm32mp2/stm32mp2.c
@@ -9,9 +9,12 @@
 #include <env.h>
 #include <fdt_support.h>
 #include <log.h>
+#include <misc.h>
 #include <asm/global_data.h>
 #include <asm/arch/sys_proto.h>
+#include <dm/device.h>
 #include <dm/ofnode.h>
+#include <dm/uclass.h>
 
 /*
  * Get a global data pointer
@@ -20,6 +23,9 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int checkboard(void)
 {
+	int ret;
+	u32 otp;
+	struct udevice *dev;
 	const char *fdt_compat;
 	int fdt_compat_len;
 
@@ -27,6 +33,23 @@ int checkboard(void)
 
 	log_info("Board: stm32mp2 (%s)\n", fdt_compat && fdt_compat_len ? fdt_compat : "");
 
+	/* display the STMicroelectronics board identification */
+	if (CONFIG_IS_ENABLED(CMD_STBOARD)) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_DRIVER_GET(stm32mp_bsec),
+						  &dev);
+		if (!ret)
+			ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
+					&otp, sizeof(otp));
+		if (ret > 0 && otp)
+			log_info("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
+				 otp >> 16,
+				 (otp >> 12) & 0xF,
+				 (otp >> 4) & 0xF,
+				 ((otp >> 8) & 0xF) - 1 + 'A',
+				 otp & 0xF);
+	}
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH v2 13/14] arm: Rename STM32MP13x
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (11 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 12/14] board: st: stm32mp2: display the board identification Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 17:02   ` Igor Opaniuk
  2024-01-15 14:05 ` [PATCH v2 14/14] arm: Rename STM32MP15x Patrick Delaunay
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Simon Glass, Christian Hewitt, FUKAUMI Naoki,
	Gatien Chevallier, Hai Pham, Igor Opaniuk, Jonas Karlman,
	Kever Yang, Lukasz Majewski, Marek Vasut, Michal Simek,
	Neil Armstrong, Oleksandr Suvorov, Patrice Chotard,
	Sean Anderson, Svyatoslav Ryhel, Tom Rini, uboot-stm32

CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---
See Simon's patch in serie "Clean up of bad Kconfig options" never merged
https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-68-sjg@chromium.org/

Changes in v2:
- add "arm: Rename STM32MP13x"

 arch/arm/dts/Makefile                           |  2 +-
 arch/arm/mach-stm32mp/Kconfig                   |  4 ++--
 arch/arm/mach-stm32mp/Kconfig.13x               |  4 ++--
 arch/arm/mach-stm32mp/Makefile                  |  2 +-
 arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  2 +-
 arch/arm/mach-stm32mp/include/mach/stm32.h      |  8 ++++----
 arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
 arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  4 ++--
 board/st/common/Kconfig                         |  2 +-
 board/st/stm32mp1/Kconfig                       |  2 +-
 configs/stm32mp13_defconfig                     |  4 ++--
 drivers/clk/stm32/Kconfig                       |  2 +-
 13 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 773c2546131c..8dcf1f5717ce 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1360,7 +1360,7 @@ dtb-$(CONFIG_ASPEED_AST2600) += ast2600-evb.dtb
 
 dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
 
-dtb-$(CONFIG_STM32MP13x) += \
+dtb-$(CONFIG_STM32MP13X) += \
 	stm32mp135f-dk.dtb
 
 dtb-$(CONFIG_STM32MP15x) += \
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 5fc92d07fe6d..241fcf3e0d22 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -37,7 +37,7 @@ choice
 	prompt "Select STMicroelectronics STM32MPxxx Soc"
 	default STM32MP15x
 
-config STM32MP13x
+config STM32MP13X
 	bool "Support STMicroelectronics STM32MP13x Soc"
 	select ARM_SMCCC
 	select CPU_V7A
@@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
 
 config STM32_ETZPC
 	bool "STM32 Extended TrustZone Protection"
-	depends on STM32MP15x || STM32MP13x
+	depends on STM32MP15x || STM32MP13X
 	default y
 	imply BOOTP_SERVERIP
 	help
diff --git a/arch/arm/mach-stm32mp/Kconfig.13x b/arch/arm/mach-stm32mp/Kconfig.13x
index acc02a5a1872..4d74b35055b8 100644
--- a/arch/arm/mach-stm32mp/Kconfig.13x
+++ b/arch/arm/mach-stm32mp/Kconfig.13x
@@ -1,10 +1,10 @@
-if STM32MP13x
+if STM32MP13X
 
 choice
 	prompt "STM32MP13x board select"
 	optional
 
-config TARGET_ST_STM32MP13x
+config TARGET_ST_STM32MP13X
 	bool "STMicroelectronics STM32MP13x boards"
 	imply BOOTSTAGE
 	imply CMD_BOOTSTAGE
diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
index fdcbbf91dfd5..3d194de0631c 100644
--- a/arch/arm/mach-stm32mp/Makefile
+++ b/arch/arm/mach-stm32mp/Makefile
@@ -9,7 +9,7 @@ obj-y += bsec.o
 obj-y += soc.o
 
 obj-$(CONFIG_STM32MP15x) += stm32mp1/
-obj-$(CONFIG_STM32MP13x) += stm32mp1/
+obj-$(CONFIG_STM32MP13X) += stm32mp1/
 obj-$(CONFIG_STM32MP25X) += stm32mp2/
 
 obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
index e16fcf4424dc..dcef6ac4fb82 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32key.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
@@ -19,7 +19,7 @@
  * STM32MP13x: 0b111111 = 0x3F for OTP_SECURED closed device
  */
 #define STM32_OTP_CLOSE_ID		0
-#define STM32_OTP_STM32MP13x_CLOSE_MASK	0x3F
+#define STM32_OTP_STM32MP13X_CLOSE_MASK	0x3F
 #define STM32_OTP_STM32MP15x_CLOSE_MASK	BIT(6)
 
 /* PKH is the first element of the key list */
@@ -61,7 +61,7 @@ static u8 stm32key_index;
 
 static u8 get_key_nb(void)
 {
-	if (IS_ENABLED(CONFIG_STM32MP13x))
+	if (IS_ENABLED(CONFIG_STM32MP13X))
 		return ARRAY_SIZE(stm32mp13_list);
 
 	if (IS_ENABLED(CONFIG_STM32MP15x))
@@ -70,7 +70,7 @@ static u8 get_key_nb(void)
 
 static const struct stm32key *get_key(u8 index)
 {
-	if (IS_ENABLED(CONFIG_STM32MP13x))
+	if (IS_ENABLED(CONFIG_STM32MP13X))
 		return &stm32mp13_list[index];
 
 	if (IS_ENABLED(CONFIG_STM32MP15x))
@@ -79,8 +79,8 @@ static const struct stm32key *get_key(u8 index)
 
 static u32 get_otp_close_mask(void)
 {
-	if (IS_ENABLED(CONFIG_STM32MP13x))
-		return STM32_OTP_STM32MP13x_CLOSE_MASK;
+	if (IS_ENABLED(CONFIG_STM32MP13X))
+		return STM32_OTP_STM32MP13X_CLOSE_MASK;
 
 	if (IS_ENABLED(CONFIG_STM32MP15x))
 		return STM32_OTP_STM32MP15x_CLOSE_MASK;
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index eda98eb61d76..934ffb1105a0 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -30,7 +30,7 @@
 #endif
 /* size of the OTP struct in NVMEM PTA */
 #define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
-#if defined(CONFIG_STM32MP13x) || defined(CONFIG_STM32MP15x)
+#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
 /* STM32MP1 with BSEC2 */
 #define OTP_SIZE_TA		_OTP_SIZE_TA(96)
 #else
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 726c390977e3..2d7d973368c1 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -71,7 +71,7 @@ enum forced_boot_mode {
  * only address used before device tree parsing
  */
 
-#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13x)
+#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
 #define STM32_RCC_BASE			0x50000000
 #define STM32_PWR_BASE			0x50001000
 #define STM32_SYSCFG_BASE		0x50020000
@@ -92,7 +92,7 @@ enum forced_boot_mode {
 #define STM32_USART1_BASE		0x5C000000
 #define STM32_USART2_BASE		0x4000E000
 #endif
-#ifdef CONFIG_STM32MP13x
+#ifdef CONFIG_STM32MP13X
 #define STM32_USART1_BASE		0x4c000000
 #define STM32_USART2_BASE		0x4c001000
 #endif
@@ -149,7 +149,7 @@ enum forced_boot_mode {
 #define TAMP_COPRO_STATE_CRASH		5
 #endif
 
-#ifdef CONFIG_STM32MP13x
+#ifdef CONFIG_STM32MP13X
 #define TAMP_BOOTCOUNT			TAMP_BACKUP_REGISTER(31)
 #define TAMP_BOOT_CONTEXT		TAMP_BACKUP_REGISTER(30)
 #endif
@@ -188,7 +188,7 @@ enum forced_boot_mode {
 #define BSEC_OTP_MAC	57
 #define BSEC_OTP_BOARD	59
 #endif
-#ifdef CONFIG_STM32MP13x
+#ifdef CONFIG_STM32MP13X
 #define BSEC_OTP_RPN	1
 #define BSEC_OTP_SERIAL	13
 #define BSEC_OTP_MAC	57
diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
index 94c7724127e4..e74342d0c608 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
+++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
@@ -5,7 +5,7 @@
 
 obj-y += cpu.o
 
-obj-$(CONFIG_STM32MP13x) += stm32mp13x.o
+obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
 obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
 
 obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
index de5c5a55ea0e..9436b872e31e 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
+++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
@@ -270,7 +270,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
 	int offset, shift;
 	u32 addr, status, decprot[ETZPC_DECPROT_NB];
 
-	if (IS_ENABLED(CONFIG_STM32MP13x)) {
+	if (IS_ENABLED(CONFIG_STM32MP13X)) {
 		array = stm32mp13_ip_addr;
 		array_size = ARRAY_SIZE(stm32mp13_ip_addr);
 	}
@@ -491,7 +491,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
 	cpu = get_cpu_type();
 	get_soc_name(name);
 
-	if (IS_ENABLED(CONFIG_STM32MP13x))
+	if (IS_ENABLED(CONFIG_STM32MP13X))
 		stm32mp13_fdt_fixup(blob, soc, cpu, name);
 
 	if (IS_ENABLED(CONFIG_STM32MP15x)) {
diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
index f40d1a78ca36..6d1b76ba43a8 100644
--- a/board/st/common/Kconfig
+++ b/board/st/common/Kconfig
@@ -1,7 +1,7 @@
 config CMD_STBOARD
 	bool "stboard - command for OTP board information"
 	depends on ARCH_STM32MP
-	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
+	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
 	help
 	  This compile the stboard command to
 	  read and write the board in the OTP.
diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
index 6ab8f80fa45b..7d0d41bfea05 100644
--- a/board/st/stm32mp1/Kconfig
+++ b/board/st/stm32mp1/Kconfig
@@ -12,7 +12,7 @@ config SYS_CONFIG_NAME
 source "board/st/common/Kconfig"
 endif
 
-if TARGET_ST_STM32MP13x
+if TARGET_ST_STM32MP13X
 
 config SYS_BOARD
 	default "stm32mp1"
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig
index 2d79bf0eb050..c893e272db9b 100644
--- a/configs/stm32mp13_defconfig
+++ b/configs/stm32mp13_defconfig
@@ -5,10 +5,10 @@ CONFIG_SYS_MALLOC_F_LEN=0x180000
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc0400000
 CONFIG_ENV_OFFSET=0x900000
 CONFIG_DEFAULT_DEVICE_TREE="stm32mp135f-dk"
-CONFIG_STM32MP13x=y
+CONFIG_STM32MP13X=y
 CONFIG_DDR_CACHEABLE_SIZE=0x8000000
 CONFIG_CMD_STM32KEY=y
-CONFIG_TARGET_ST_STM32MP13x=y
+CONFIG_TARGET_ST_STM32MP13X=y
 CONFIG_ENV_OFFSET_REDUND=0x940000
 CONFIG_CMD_STM32PROG=y
 # CONFIG_ARMV7_NONSEC is not set
diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
index 7a34ea23c381..7dbddd032b89 100644
--- a/drivers/clk/stm32/Kconfig
+++ b/drivers/clk/stm32/Kconfig
@@ -31,7 +31,7 @@ config CLK_STM32MP1
 config CLK_STM32MP13
 	bool "Enable RCC clock driver for STM32MP13"
 	depends on ARCH_STM32MP && CLK
-	default y if STM32MP13x
+	default y if STM32MP13X
 	select CLK_STM32_CORE
 	help
 	  Enable the STM32 clock (RCC) driver. Enable support for
-- 
2.25.1


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

* [PATCH v2 14/14] arm: Rename STM32MP15x
  2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
                   ` (12 preceding siblings ...)
  2024-01-15 14:05 ` [PATCH v2 13/14] arm: Rename STM32MP13x Patrick Delaunay
@ 2024-01-15 14:05 ` Patrick Delaunay
  2024-01-15 17:40   ` Patrice CHOTARD
  13 siblings, 1 reply; 33+ messages in thread
From: Patrick Delaunay @ 2024-01-15 14:05 UTC (permalink / raw)
  To: u-boot
  Cc: Patrick Delaunay, Christian Hewitt, FUKAUMI Naoki,
	Gatien Chevallier, Grzegorz Szymaszek, Hai Pham, Igor Opaniuk,
	Ilias Apalodimas, Jonas Karlman, Kever Yang, Lukasz Majewski,
	Marek Vasut, Masahisa Kojima, Michal Simek, Neil Armstrong,
	Patrice Chotard, Rasmus Villemoes, Sean Anderson, Simon Glass,
	Svyatoslav Ryhel, Tom Rini, uboot-stm32

CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass <sjg@chromium.org
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---
See Simon's patch in serie "Clean up of bad Kconfig options" never merged
https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-69-sjg@chromium.org/

Changes in v2:
- add "arm: Rename STM32MP15x"

 arch/arm/dts/Makefile                           |  2 +-
 arch/arm/dts/stm32mp15-u-boot.dtsi              |  2 +-
 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi        |  4 ++--
 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi        |  4 ++--
 arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi        |  4 ++--
 arch/arm/mach-stm32mp/Kconfig                   |  6 +++---
 arch/arm/mach-stm32mp/Kconfig.15x               |  6 +++---
 arch/arm/mach-stm32mp/Makefile                  |  2 +-
 arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  4 ++--
 arch/arm/mach-stm32mp/include/mach/stm32.h      | 12 ++++++------
 arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
 arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  6 +++---
 board/st/common/Kconfig                         |  2 +-
 board/st/stm32mp1/Kconfig                       |  2 +-
 board/st/stm32mp1/stm32mp1.c                    |  6 +++---
 configs/stm32mp15_basic_defconfig               |  2 +-
 configs/stm32mp15_defconfig                     |  2 +-
 configs/stm32mp15_trusted_defconfig             |  4 ++--
 drivers/clk/stm32/Kconfig                       |  2 +-
 20 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 8dcf1f5717ce..02074440b55d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1363,7 +1363,7 @@ dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
 dtb-$(CONFIG_STM32MP13X) += \
 	stm32mp135f-dk.dtb
 
-dtb-$(CONFIG_STM32MP15x) += \
+dtb-$(CONFIG_STM32MP15X) += \
 	stm32mp157a-dk1.dtb \
 	stm32mp157a-dk1-scmi.dtb \
 	stm32mp157a-icore-stm32mp1-ctouch2.dtb \
diff --git a/arch/arm/dts/stm32mp15-u-boot.dtsi b/arch/arm/dts/stm32mp15-u-boot.dtsi
index 573dd4d3ed56..fe56f05616a0 100644
--- a/arch/arm/dts/stm32mp15-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp15-u-boot.dtsi
@@ -206,7 +206,7 @@
 	resets = <&rcc UART8_R>;
 };
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE)
 &binman {
 	u-boot-stm32 {
 		filename = "u-boot.stm32";
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
index 2623cebf21a4..a16358266a2d 100644
--- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
@@ -22,13 +22,13 @@
 		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
 	};
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
 	config {
 		u-boot,mmc-env-partition = "ssbl";
 	};
 #endif
 
-#ifdef CONFIG_STM32MP15x_STM32IMAGE
+#ifdef CONFIG_STM32MP15X_STM32IMAGE
 	/* only needed for boot with TF-A, witout FIP support */
 	firmware {
 		optee {
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
index b8288273ddb5..ef91088aa375 100644
--- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
@@ -20,13 +20,13 @@
 		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
 	};
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
 	config {
 		u-boot,mmc-env-partition = "ssbl";
 	};
 #endif
 
-#ifdef CONFIG_STM32MP15x_STM32IMAGE
+#ifdef CONFIG_STM32MP15X_STM32IMAGE
 	/* only needed for boot with TF-A, witout FIP support */
 	firmware {
 		optee {
diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
index eb283cacd27d..139940bd5d47 100644
--- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
@@ -28,7 +28,7 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
 		partition@0 {
 			label = "fsbl1";
 			reg = <0x00000000 0x00040000>;
@@ -82,7 +82,7 @@
 				#address-cells = <1>;
 				#size-cells = <1>;
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
 				partition@0 {
 					label = "fsbl";
 					reg = <0x00000000 0x00200000>;
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 241fcf3e0d22..a1763ff19993 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -35,7 +35,7 @@ config ENV_SIZE
 
 choice
 	prompt "Select STMicroelectronics STM32MPxxx Soc"
-	default STM32MP15x
+	default STM32MP15X
 
 config STM32MP13X
 	bool "Support STMicroelectronics STM32MP13x Soc"
@@ -55,7 +55,7 @@ config STM32MP13X
 		support of STMicroelectronics SOC STM32MP13x family
 		STMicroelectronics MPU with core ARMv7
 
-config STM32MP15x
+config STM32MP15X
 	bool "Support STMicroelectronics STM32MP15x Soc"
 	select ARCH_SUPPORT_PSCI
 	select BINMAN
@@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
 
 config STM32_ETZPC
 	bool "STM32 Extended TrustZone Protection"
-	depends on STM32MP15x || STM32MP13X
+	depends on STM32MP15X || STM32MP13X
 	default y
 	imply BOOTP_SERVERIP
 	help
diff --git a/arch/arm/mach-stm32mp/Kconfig.15x b/arch/arm/mach-stm32mp/Kconfig.15x
index 1d32f8bf3395..71c14eb4955f 100644
--- a/arch/arm/mach-stm32mp/Kconfig.15x
+++ b/arch/arm/mach-stm32mp/Kconfig.15x
@@ -1,6 +1,6 @@
-if STM32MP15x
+if STM32MP15X
 
-config STM32MP15x_STM32IMAGE
+config STM32MP15X_STM32IMAGE
 	bool "Support STM32 image for generated U-Boot image"
 	depends on TFABOOT
 	help
@@ -11,7 +11,7 @@ choice
 	prompt "STM32MP15x board select"
 	optional
 
-config TARGET_ST_STM32MP15x
+config TARGET_ST_STM32MP15X
 	bool "STMicroelectronics STM32MP15x boards"
 	imply BOOTSTAGE
 	imply CMD_BOOTSTAGE
diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
index 3d194de0631c..ee8a5428feba 100644
--- a/arch/arm/mach-stm32mp/Makefile
+++ b/arch/arm/mach-stm32mp/Makefile
@@ -8,7 +8,7 @@ obj-y += syscon.o
 obj-y += bsec.o
 obj-y += soc.o
 
-obj-$(CONFIG_STM32MP15x) += stm32mp1/
+obj-$(CONFIG_STM32MP15X) += stm32mp1/
 obj-$(CONFIG_STM32MP13X) += stm32mp1/
 obj-$(CONFIG_STM32MP25X) += stm32mp2/
 
diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
index dcef6ac4fb82..c7fe232f86e0 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32key.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
@@ -20,7 +20,7 @@
  */
 #define STM32_OTP_CLOSE_ID		0
 #define STM32_OTP_STM32MP13X_CLOSE_MASK	0x3F
-#define STM32_OTP_STM32MP15x_CLOSE_MASK	BIT(6)
+#define STM32_OTP_STM32MP15X_CLOSE_MASK	BIT(6)
 
 /* PKH is the first element of the key list */
 #define STM32KEY_PKH 0
@@ -64,7 +64,7 @@ static u8 get_key_nb(void)
 	if (IS_ENABLED(CONFIG_STM32MP13X))
 		return ARRAY_SIZE(stm32mp13_list);
 
-	if (IS_ENABLED(CONFIG_STM32MP15x))
+	if (IS_ENABLED(CONFIG_STM32MP15X))
 		return ARRAY_SIZE(stm32mp15_list);
 }
 
@@ -73,7 +73,7 @@ static const struct stm32key *get_key(u8 index)
 	if (IS_ENABLED(CONFIG_STM32MP13X))
 		return &stm32mp13_list[index];
 
-	if (IS_ENABLED(CONFIG_STM32MP15x))
+	if (IS_ENABLED(CONFIG_STM32MP15X))
 		return &stm32mp15_list[index];
 }
 
@@ -82,8 +82,8 @@ static u32 get_otp_close_mask(void)
 	if (IS_ENABLED(CONFIG_STM32MP13X))
 		return STM32_OTP_STM32MP13X_CLOSE_MASK;
 
-	if (IS_ENABLED(CONFIG_STM32MP15x))
-		return STM32_OTP_STM32MP15x_CLOSE_MASK;
+	if (IS_ENABLED(CONFIG_STM32MP15X))
+		return STM32_OTP_STM32MP15X_CLOSE_MASK;
 }
 
 static int get_misc_dev(struct udevice **dev)
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index 934ffb1105a0..bf184c8a8846 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -23,14 +23,14 @@
 
 #define CMD_SIZE		512
 /* SMC is only supported in SPMIN for STM32MP15x */
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define OTP_SIZE_SMC		1024
 #else
 #define OTP_SIZE_SMC		0
 #endif
 /* size of the OTP struct in NVMEM PTA */
 #define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
-#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
+#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15X)
 /* STM32MP1 with BSEC2 */
 #define OTP_SIZE_TA		_OTP_SIZE_TA(96)
 #else
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 2d7d973368c1..f598da99fbab 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -71,11 +71,11 @@ enum forced_boot_mode {
  * only address used before device tree parsing
  */
 
-#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
+#if defined(CONFIG_STM32MP15X) || defined(CONFIG_STM32MP13X)
 #define STM32_RCC_BASE			0x50000000
 #define STM32_PWR_BASE			0x50001000
 #define STM32_SYSCFG_BASE		0x50020000
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define STM32_DBGMCU_BASE		0x50081000
 #endif
 #define STM32_FMC2_BASE			0x58002000
@@ -88,7 +88,7 @@ enum forced_boot_mode {
 #define STM32_STGEN_BASE		0x5C008000
 #define STM32_TAMP_BASE			0x5C00A000
 
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define STM32_USART1_BASE		0x5C000000
 #define STM32_USART2_BASE		0x4000E000
 #endif
@@ -107,7 +107,7 @@ enum forced_boot_mode {
 #define STM32_SDMMC2_BASE		0x58007000
 #define STM32_SDMMC3_BASE		0x48004000
 
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define STM32_SYSRAM_BASE		0x2FFC0000
 #define STM32_SYSRAM_SIZE		SZ_256K
 #endif
@@ -129,7 +129,7 @@ enum forced_boot_mode {
 /* TAMP registers */
 #define TAMP_BACKUP_REGISTER(x)		(STM32_TAMP_BASE + 0x100 + 4 * x)
 
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define TAMP_BACKUP_MAGIC_NUMBER	TAMP_BACKUP_REGISTER(4)
 #define TAMP_BACKUP_BRANCH_ADDRESS	TAMP_BACKUP_REGISTER(5)
 #define TAMP_FWU_BOOT_INFO_REG		TAMP_BACKUP_REGISTER(10)
@@ -181,7 +181,7 @@ enum forced_boot_mode {
 #define STM32_BSEC_LOCK(id)		(STM32_BSEC_LOCK_OFFSET + (id) * 4)
 
 /* BSEC OTP index */
-#ifdef CONFIG_STM32MP15x
+#ifdef CONFIG_STM32MP15X
 #define BSEC_OTP_RPN	1
 #define BSEC_OTP_SERIAL	13
 #define BSEC_OTP_PKG	16
diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
index e74342d0c608..857148747ef7 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
+++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
@@ -6,7 +6,7 @@
 obj-y += cpu.o
 
 obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
-obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
+obj-$(CONFIG_STM32MP15X) += stm32mp15x.o
 
 obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
 ifdef CONFIG_SPL_BUILD
diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
index 9436b872e31e..d0b6c3cc5a55 100644
--- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
+++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
@@ -275,7 +275,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
 		array_size = ARRAY_SIZE(stm32mp13_ip_addr);
 	}
 
-	if (IS_ENABLED(CONFIG_STM32MP15x)) {
+	if (IS_ENABLED(CONFIG_STM32MP15X)) {
 		array = stm32mp15_ip_addr;
 		array_size = ARRAY_SIZE(stm32mp15_ip_addr);
 	}
@@ -494,7 +494,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
 	if (IS_ENABLED(CONFIG_STM32MP13X))
 		stm32mp13_fdt_fixup(blob, soc, cpu, name);
 
-	if (IS_ENABLED(CONFIG_STM32MP15x)) {
+	if (IS_ENABLED(CONFIG_STM32MP15X)) {
 		stm32mp15_fdt_fixup(blob, soc, cpu, name);
 
 		/*
@@ -505,7 +505,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
 		 * under CONFIG_STM32MP15x_STM32IMAGE only for compatibility
 		 * when FIP is not used by TF-A
 		 */
-		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE) &&
+		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE) &&
 		    !tee_find_device(NULL, NULL, NULL, NULL))
 			stm32_fdt_disable_optee(blob);
 	}
diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
index 6d1b76ba43a8..5efac658cf4d 100644
--- a/board/st/common/Kconfig
+++ b/board/st/common/Kconfig
@@ -1,7 +1,7 @@
 config CMD_STBOARD
 	bool "stboard - command for OTP board information"
 	depends on ARCH_STM32MP
-	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
+	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15X || TARGET_ST_STM32MP13X
 	help
 	  This compile the stboard command to
 	  read and write the board in the OTP.
diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
index 7d0d41bfea05..96de41546f1d 100644
--- a/board/st/stm32mp1/Kconfig
+++ b/board/st/stm32mp1/Kconfig
@@ -1,4 +1,4 @@
-if TARGET_ST_STM32MP15x
+if TARGET_ST_STM32MP15X
 
 config SYS_BOARD
 	default "stm32mp1"
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 8f5719c28b33..a17c314daeb8 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -114,7 +114,7 @@ int checkboard(void)
 	int fdt_compat_len;
 
 	if (IS_ENABLED(CONFIG_TFABOOT)) {
-		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE))
+		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE))
 			mode = "trusted - stm32image";
 		else
 			mode = "trusted";
@@ -616,7 +616,7 @@ error:
 
 static bool board_is_stm32mp15x_dk2(void)
 {
-	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
+	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
 	    of_machine_is_compatible("st,stm32mp157c-dk2"))
 		return true;
 
@@ -625,7 +625,7 @@ static bool board_is_stm32mp15x_dk2(void)
 
 static bool board_is_stm32mp15x_ev1(void)
 {
-	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
+	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
 	    (of_machine_is_compatible("st,stm32mp157a-ev1") ||
 	     of_machine_is_compatible("st,stm32mp157c-ev1") ||
 	     of_machine_is_compatible("st,stm32mp157d-ev1") ||
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index 3032d83b992e..005f1d55f80e 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -13,7 +13,7 @@ CONFIG_SPL_STACK=0x30000000
 CONFIG_SPL=y
 CONFIG_CMD_STM32KEY=y
 CONFIG_TYPEC_STUSB160X=y
-CONFIG_TARGET_ST_STM32MP15x=y
+CONFIG_TARGET_ST_STM32MP15X=y
 CONFIG_ENV_OFFSET_REDUND=0x2C0000
 CONFIG_CMD_STM32PROG=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig
index 4aff6398846f..3302b3069965 100644
--- a/configs/stm32mp15_defconfig
+++ b/configs/stm32mp15_defconfig
@@ -9,7 +9,7 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
 CONFIG_DDR_CACHEABLE_SIZE=0x8000000
 CONFIG_CMD_STM32KEY=y
 CONFIG_TYPEC_STUSB160X=y
-CONFIG_TARGET_ST_STM32MP15x=y
+CONFIG_TARGET_ST_STM32MP15X=y
 CONFIG_ENV_OFFSET_REDUND=0x940000
 CONFIG_CMD_STM32PROG=y
 # CONFIG_ARMV7_NONSEC is not set
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
index ec32f1ea0f2c..84b0854b5573 100644
--- a/configs/stm32mp15_trusted_defconfig
+++ b/configs/stm32mp15_trusted_defconfig
@@ -9,8 +9,8 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
 CONFIG_DDR_CACHEABLE_SIZE=0x10000000
 CONFIG_CMD_STM32KEY=y
 CONFIG_TYPEC_STUSB160X=y
-CONFIG_STM32MP15x_STM32IMAGE=y
-CONFIG_TARGET_ST_STM32MP15x=y
+CONFIG_STM32MP15X_STM32IMAGE=y
+CONFIG_TARGET_ST_STM32MP15X=y
 CONFIG_ENV_OFFSET_REDUND=0x2C0000
 CONFIG_CMD_STM32PROG=y
 # CONFIG_ARMV7_NONSEC is not set
diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
index 7dbddd032b89..c05015efe8b4 100644
--- a/drivers/clk/stm32/Kconfig
+++ b/drivers/clk/stm32/Kconfig
@@ -23,7 +23,7 @@ config CLK_STM32_CORE
 config CLK_STM32MP1
 	bool "Enable RCC clock driver for STM32MP15"
 	depends on ARCH_STM32MP && CLK
-	default y if STM32MP15x
+	default y if STM32MP15X
 	help
 	  Enable the STM32 clock (RCC) driver. Enable support for
 	  manipulating STM32MP15's on-SoC clocks.
-- 
2.25.1


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

* Re: [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25
  2024-01-15 14:05 ` [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25 Patrick Delaunay
@ 2024-01-15 16:23   ` Igor Opaniuk
  2024-01-19 13:25     ` Patrice CHOTARD
  0 siblings, 1 reply; 33+ messages in thread
From: Igor Opaniuk @ 2024-01-15 16:23 UTC (permalink / raw)
  To: Patrick Delaunay
  Cc: u-boot, Patrice Chotard, Bhupesh Sharma, Oleksandr Suvorov,
	Rasmus Villemoes, Simon Glass, U-Boot STM32

Hello Patrick,

On Mon, Jan 15, 2024 at 5:03 PM Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> From: Patrice Chotard <patrice.chotard@foss.st.com>
>
> Add support of serial number for stm32mp25, gets from OTP with BSEC driver.
>
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
> (no changes since v1)
>
>  .../arm/mach-stm32mp/include/mach/sys_proto.h |  1 +
>  arch/arm/mach-stm32mp/soc.c                   | 31 +++++++++++++++++++
>  arch/arm/mach-stm32mp/stm32mp1/cpu.c          | 27 ----------------
>  arch/arm/mach-stm32mp/stm32mp2/cpu.c          |  2 ++
>  4 files changed, 34 insertions(+), 27 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> index 83388fdb7371..2a65efc0a50a 100644
> --- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> +++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
> @@ -97,6 +97,7 @@ u32 get_bootauth(void);
>
>  int get_eth_nb(void);
>  int setup_mac_address(void);
> +int setup_serial_number(void);
>
>  /* board power management : configure vddcore according OPP */
>  void board_vddcore_init(u32 voltage_mv);
> diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
> index 8d5fa474ccaf..ff70ebe97464 100644
> --- a/arch/arm/mach-stm32mp/soc.c
> +++ b/arch/arm/mach-stm32mp/soc.c
> @@ -3,7 +3,11 @@
>   * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
>   */
>
> +#include <env.h>
> +#include <misc.h>
>  #include <asm/arch/sys_proto.h>
> +#include <dm/device.h>
> +#include <dm/uclass.h>
>
>  /* used when CONFIG_DISPLAY_CPUINFO is activated */
>  int print_cpuinfo(void)
> @@ -15,3 +19,30 @@ int print_cpuinfo(void)
>
>         return 0;
>  }
> +
> +int setup_serial_number(void)
> +{
> +       char serial_string[25];
> +       u32 otp[3] = {0, 0, 0 };
> +       struct udevice *dev;
> +       int ret;
> +
> +       if (env_get("serial#"))
> +               return 0;
> +
> +       ret = uclass_get_device_by_driver(UCLASS_MISC,
> +                                         DM_DRIVER_GET(stm32mp_bsec),
> +                                         &dev);
> +       if (ret)
> +               return ret;
> +
> +       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
> +                       otp, sizeof(otp));
> +       if (ret < 0)
> +               return ret;
> +
> +       sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
> +       env_set("serial#", serial_string);
> +
> +       return 0;
> +}
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> index 00fea7929b2f..f84cb26fa565 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> @@ -336,33 +336,6 @@ __weak int setup_mac_address(void)
>         return 0;
>  }
>
> -static int setup_serial_number(void)
> -{
> -       char serial_string[25];
> -       u32 otp[3] = {0, 0, 0 };
> -       struct udevice *dev;
> -       int ret;
> -
> -       if (env_get("serial#"))
> -               return 0;
> -
> -       ret = uclass_get_device_by_driver(UCLASS_MISC,
> -                                         DM_DRIVER_GET(stm32mp_bsec),
> -                                         &dev);
> -       if (ret)
> -               return ret;
> -
> -       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
> -                       otp, sizeof(otp));
> -       if (ret < 0)
> -               return ret;
> -
> -       sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
> -       env_set("serial#", serial_string);
> -
> -       return 0;
> -}
> -
>  __weak void stm32mp_misc_init(void)
>  {
>  }
> diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> index c0f6519e8d7c..301e365cf4f4 100644
> --- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> @@ -69,6 +69,8 @@ void enable_caches(void)
>
>  int arch_misc_init(void)
>  {
> +       setup_serial_number();
> +
>         return 0;
>  }
>
> --
> 2.25.1
>

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk@gmail.com
skype: igor.opanyuk
+48 666 108 041
http://ua.linkedin.com/in/iopaniuk

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

* Re: [PATCH v2 06/14] stm32mp: add soc.c file
  2024-01-15 14:05 ` [PATCH v2 06/14] stm32mp: add soc.c file Patrick Delaunay
@ 2024-01-15 16:26   ` Igor Opaniuk
  2024-01-19 13:25     ` Patrice CHOTARD
  0 siblings, 1 reply; 33+ messages in thread
From: Igor Opaniuk @ 2024-01-15 16:26 UTC (permalink / raw)
  To: Patrick Delaunay
  Cc: u-boot, Patrice Chotard, Bhupesh Sharma, Oleksandr Suvorov,
	Rasmus Villemoes, Simon Glass, U-Boot STM32

On Mon, Jan 15, 2024 at 3:07 PM Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> Add a new file soc.c for common functions between stm32mp1 and stm32mp2
> family and move print_cpuinfo() in this new file.
>
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
> (no changes since v1)
>
>  arch/arm/mach-stm32mp/Makefile       |  1 +
>  arch/arm/mach-stm32mp/soc.c          | 17 +++++++++++++++++
>  arch/arm/mach-stm32mp/stm32mp1/cpu.c | 11 -----------
>  arch/arm/mach-stm32mp/stm32mp2/cpu.c | 11 -----------
>  4 files changed, 18 insertions(+), 22 deletions(-)
>  create mode 100644 arch/arm/mach-stm32mp/soc.c
>
> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
> index 00dc25bb275c..fdcbbf91dfd5 100644
> --- a/arch/arm/mach-stm32mp/Makefile
> +++ b/arch/arm/mach-stm32mp/Makefile
> @@ -6,6 +6,7 @@
>  obj-y += dram_init.o
>  obj-y += syscon.o
>  obj-y += bsec.o
> +obj-y += soc.o
>
>  obj-$(CONFIG_STM32MP15x) += stm32mp1/
>  obj-$(CONFIG_STM32MP13x) += stm32mp1/
> diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
> new file mode 100644
> index 000000000000..8d5fa474ccaf
> --- /dev/null
> +++ b/arch/arm/mach-stm32mp/soc.c
> @@ -0,0 +1,17 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
> +/*
> + * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
> + */
> +
> +#include <asm/arch/sys_proto.h>
> +
> +/* used when CONFIG_DISPLAY_CPUINFO is activated */
> +int print_cpuinfo(void)
> +{
> +       char name[SOC_NAME_SIZE];
> +
> +       get_soc_name(name);
> +       printf("CPU: %s\n", name);
> +
> +       return 0;
> +}
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> index 55574fd4bebf..00fea7929b2f 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> @@ -158,17 +158,6 @@ void enable_caches(void)
>         dcache_enable();
>  }
>
> -/* used when CONFIG_DISPLAY_CPUINFO is activated */
> -int print_cpuinfo(void)
> -{
> -       char name[SOC_NAME_SIZE];
> -
> -       get_soc_name(name);
> -       printf("CPU: %s\n", name);
> -
> -       return 0;
> -}
> -
>  static void setup_boot_mode(void)
>  {
>         const u32 serial_addr[] = {
> diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> index f43d1aaf72cc..c0f6519e8d7c 100644
> --- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> @@ -67,17 +67,6 @@ void enable_caches(void)
>         dcache_enable();
>  }
>
> -/* used when CONFIG_DISPLAY_CPUINFO is activated */
> -int print_cpuinfo(void)
> -{
> -       char name[SOC_NAME_SIZE];
> -
> -       get_soc_name(name);
> -       printf("CPU: %s\n", name);
> -
> -       return 0;
> -}
> -
>  int arch_misc_init(void)
>  {
>         return 0;
> --
> 2.25.1
>

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk
Embedded Software Engineer
T:  +380 938364067
E: igor.opaniuk@foundries.io
W: www.foundries.io

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

* Re: [PATCH v2 13/14] arm: Rename STM32MP13x
  2024-01-15 14:05 ` [PATCH v2 13/14] arm: Rename STM32MP13x Patrick Delaunay
@ 2024-01-15 17:02   ` Igor Opaniuk
  2024-01-19 13:28     ` Patrice CHOTARD
  0 siblings, 1 reply; 33+ messages in thread
From: Igor Opaniuk @ 2024-01-15 17:02 UTC (permalink / raw)
  To: Patrick Delaunay
  Cc: u-boot, Simon Glass, Christian Hewitt, FUKAUMI Naoki,
	Gatien Chevallier, Hai Pham, Jonas Karlman, Kever Yang,
	Lukasz Majewski, Marek Vasut, Michal Simek, Neil Armstrong,
	Oleksandr Suvorov, Patrice Chotard, Sean Anderson,
	Svyatoslav Ryhel, Tom Rini, uboot-stm32

On Mon, Jan 15, 2024 at 3:08 PM Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> CONFIG options must not use lower-case letter. Convert this and related
> ones to upper case.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> See Simon's patch in serie "Clean up of bad Kconfig options" never merged
> https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
> https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-68-sjg@chromium.org/
>
> Changes in v2:
> - add "arm: Rename STM32MP13x"
>
>  arch/arm/dts/Makefile                           |  2 +-
>  arch/arm/mach-stm32mp/Kconfig                   |  4 ++--
>  arch/arm/mach-stm32mp/Kconfig.13x               |  4 ++--
>  arch/arm/mach-stm32mp/Makefile                  |  2 +-
>  arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  2 +-
>  arch/arm/mach-stm32mp/include/mach/stm32.h      |  8 ++++----
>  arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
>  arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  4 ++--
>  board/st/common/Kconfig                         |  2 +-
>  board/st/stm32mp1/Kconfig                       |  2 +-
>  configs/stm32mp13_defconfig                     |  4 ++--
>  drivers/clk/stm32/Kconfig                       |  2 +-
>  13 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 773c2546131c..8dcf1f5717ce 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1360,7 +1360,7 @@ dtb-$(CONFIG_ASPEED_AST2600) += ast2600-evb.dtb
>
>  dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
>
> -dtb-$(CONFIG_STM32MP13x) += \
> +dtb-$(CONFIG_STM32MP13X) += \
>         stm32mp135f-dk.dtb
>
>  dtb-$(CONFIG_STM32MP15x) += \
> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
> index 5fc92d07fe6d..241fcf3e0d22 100644
> --- a/arch/arm/mach-stm32mp/Kconfig
> +++ b/arch/arm/mach-stm32mp/Kconfig
> @@ -37,7 +37,7 @@ choice
>         prompt "Select STMicroelectronics STM32MPxxx Soc"
>         default STM32MP15x
>
> -config STM32MP13x
> +config STM32MP13X
>         bool "Support STMicroelectronics STM32MP13x Soc"
>         select ARM_SMCCC
>         select CPU_V7A
> @@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
>
>  config STM32_ETZPC
>         bool "STM32 Extended TrustZone Protection"
> -       depends on STM32MP15x || STM32MP13x
> +       depends on STM32MP15x || STM32MP13X
>         default y
>         imply BOOTP_SERVERIP
>         help
> diff --git a/arch/arm/mach-stm32mp/Kconfig.13x b/arch/arm/mach-stm32mp/Kconfig.13x
> index acc02a5a1872..4d74b35055b8 100644
> --- a/arch/arm/mach-stm32mp/Kconfig.13x
> +++ b/arch/arm/mach-stm32mp/Kconfig.13x
> @@ -1,10 +1,10 @@
> -if STM32MP13x
> +if STM32MP13X
>
>  choice
>         prompt "STM32MP13x board select"
>         optional
>
> -config TARGET_ST_STM32MP13x
> +config TARGET_ST_STM32MP13X
>         bool "STMicroelectronics STM32MP13x boards"
>         imply BOOTSTAGE
>         imply CMD_BOOTSTAGE
> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
> index fdcbbf91dfd5..3d194de0631c 100644
> --- a/arch/arm/mach-stm32mp/Makefile
> +++ b/arch/arm/mach-stm32mp/Makefile
> @@ -9,7 +9,7 @@ obj-y += bsec.o
>  obj-y += soc.o
>
>  obj-$(CONFIG_STM32MP15x) += stm32mp1/
> -obj-$(CONFIG_STM32MP13x) += stm32mp1/
> +obj-$(CONFIG_STM32MP13X) += stm32mp1/
>  obj-$(CONFIG_STM32MP25X) += stm32mp2/
>
>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
> index e16fcf4424dc..dcef6ac4fb82 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32key.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
> @@ -19,7 +19,7 @@
>   * STM32MP13x: 0b111111 = 0x3F for OTP_SECURED closed device
>   */
>  #define STM32_OTP_CLOSE_ID             0
> -#define STM32_OTP_STM32MP13x_CLOSE_MASK        0x3F
> +#define STM32_OTP_STM32MP13X_CLOSE_MASK        0x3F
>  #define STM32_OTP_STM32MP15x_CLOSE_MASK        BIT(6)
>
>  /* PKH is the first element of the key list */
> @@ -61,7 +61,7 @@ static u8 stm32key_index;
>
>  static u8 get_key_nb(void)
>  {
> -       if (IS_ENABLED(CONFIG_STM32MP13x))
> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>                 return ARRAY_SIZE(stm32mp13_list);
>
>         if (IS_ENABLED(CONFIG_STM32MP15x))
> @@ -70,7 +70,7 @@ static u8 get_key_nb(void)
>
>  static const struct stm32key *get_key(u8 index)
>  {
> -       if (IS_ENABLED(CONFIG_STM32MP13x))
> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>                 return &stm32mp13_list[index];
>
>         if (IS_ENABLED(CONFIG_STM32MP15x))
> @@ -79,8 +79,8 @@ static const struct stm32key *get_key(u8 index)
>
>  static u32 get_otp_close_mask(void)
>  {
> -       if (IS_ENABLED(CONFIG_STM32MP13x))
> -               return STM32_OTP_STM32MP13x_CLOSE_MASK;
> +       if (IS_ENABLED(CONFIG_STM32MP13X))
> +               return STM32_OTP_STM32MP13X_CLOSE_MASK;
>
>         if (IS_ENABLED(CONFIG_STM32MP15x))
>                 return STM32_OTP_STM32MP15x_CLOSE_MASK;
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> index eda98eb61d76..934ffb1105a0 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> @@ -30,7 +30,7 @@
>  #endif
>  /* size of the OTP struct in NVMEM PTA */
>  #define _OTP_SIZE_TA(otp)      (((otp) * 2 + 2) * 4)
> -#if defined(CONFIG_STM32MP13x) || defined(CONFIG_STM32MP15x)
> +#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
>  /* STM32MP1 with BSEC2 */
>  #define OTP_SIZE_TA            _OTP_SIZE_TA(96)
>  #else
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
> index 726c390977e3..2d7d973368c1 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
> @@ -71,7 +71,7 @@ enum forced_boot_mode {
>   * only address used before device tree parsing
>   */
>
> -#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13x)
> +#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
>  #define STM32_RCC_BASE                 0x50000000
>  #define STM32_PWR_BASE                 0x50001000
>  #define STM32_SYSCFG_BASE              0x50020000
> @@ -92,7 +92,7 @@ enum forced_boot_mode {
>  #define STM32_USART1_BASE              0x5C000000
>  #define STM32_USART2_BASE              0x4000E000
>  #endif
> -#ifdef CONFIG_STM32MP13x
> +#ifdef CONFIG_STM32MP13X
>  #define STM32_USART1_BASE              0x4c000000
>  #define STM32_USART2_BASE              0x4c001000
>  #endif
> @@ -149,7 +149,7 @@ enum forced_boot_mode {
>  #define TAMP_COPRO_STATE_CRASH         5
>  #endif
>
> -#ifdef CONFIG_STM32MP13x
> +#ifdef CONFIG_STM32MP13X
>  #define TAMP_BOOTCOUNT                 TAMP_BACKUP_REGISTER(31)
>  #define TAMP_BOOT_CONTEXT              TAMP_BACKUP_REGISTER(30)
>  #endif
> @@ -188,7 +188,7 @@ enum forced_boot_mode {
>  #define BSEC_OTP_MAC   57
>  #define BSEC_OTP_BOARD 59
>  #endif
> -#ifdef CONFIG_STM32MP13x
> +#ifdef CONFIG_STM32MP13X
>  #define BSEC_OTP_RPN   1
>  #define BSEC_OTP_SERIAL        13
>  #define BSEC_OTP_MAC   57
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
> index 94c7724127e4..e74342d0c608 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
> +++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
> @@ -5,7 +5,7 @@
>
>  obj-y += cpu.o
>
> -obj-$(CONFIG_STM32MP13x) += stm32mp13x.o
> +obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
>  obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
>
>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> index de5c5a55ea0e..9436b872e31e 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> +++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> @@ -270,7 +270,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
>         int offset, shift;
>         u32 addr, status, decprot[ETZPC_DECPROT_NB];
>
> -       if (IS_ENABLED(CONFIG_STM32MP13x)) {
> +       if (IS_ENABLED(CONFIG_STM32MP13X)) {
>                 array = stm32mp13_ip_addr;
>                 array_size = ARRAY_SIZE(stm32mp13_ip_addr);
>         }
> @@ -491,7 +491,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>         cpu = get_cpu_type();
>         get_soc_name(name);
>
> -       if (IS_ENABLED(CONFIG_STM32MP13x))
> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>                 stm32mp13_fdt_fixup(blob, soc, cpu, name);
>
>         if (IS_ENABLED(CONFIG_STM32MP15x)) {
> diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
> index f40d1a78ca36..6d1b76ba43a8 100644
> --- a/board/st/common/Kconfig
> +++ b/board/st/common/Kconfig
> @@ -1,7 +1,7 @@
>  config CMD_STBOARD
>         bool "stboard - command for OTP board information"
>         depends on ARCH_STM32MP
> -       default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
> +       default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
>         help
>           This compile the stboard command to
>           read and write the board in the OTP.
> diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
> index 6ab8f80fa45b..7d0d41bfea05 100644
> --- a/board/st/stm32mp1/Kconfig
> +++ b/board/st/stm32mp1/Kconfig
> @@ -12,7 +12,7 @@ config SYS_CONFIG_NAME
>  source "board/st/common/Kconfig"
>  endif
>
> -if TARGET_ST_STM32MP13x
> +if TARGET_ST_STM32MP13X
>
>  config SYS_BOARD
>         default "stm32mp1"
> diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig
> index 2d79bf0eb050..c893e272db9b 100644
> --- a/configs/stm32mp13_defconfig
> +++ b/configs/stm32mp13_defconfig
> @@ -5,10 +5,10 @@ CONFIG_SYS_MALLOC_F_LEN=0x180000
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc0400000
>  CONFIG_ENV_OFFSET=0x900000
>  CONFIG_DEFAULT_DEVICE_TREE="stm32mp135f-dk"
> -CONFIG_STM32MP13x=y
> +CONFIG_STM32MP13X=y
>  CONFIG_DDR_CACHEABLE_SIZE=0x8000000
>  CONFIG_CMD_STM32KEY=y
> -CONFIG_TARGET_ST_STM32MP13x=y
> +CONFIG_TARGET_ST_STM32MP13X=y
>  CONFIG_ENV_OFFSET_REDUND=0x940000
>  CONFIG_CMD_STM32PROG=y
>  # CONFIG_ARMV7_NONSEC is not set
> diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
> index 7a34ea23c381..7dbddd032b89 100644
> --- a/drivers/clk/stm32/Kconfig
> +++ b/drivers/clk/stm32/Kconfig
> @@ -31,7 +31,7 @@ config CLK_STM32MP1
>  config CLK_STM32MP13
>         bool "Enable RCC clock driver for STM32MP13"
>         depends on ARCH_STM32MP && CLK
> -       default y if STM32MP13x
> +       default y if STM32MP13X
>         select CLK_STM32_CORE
>         help
>           Enable the STM32 clock (RCC) driver. Enable support for
> --
> 2.25.1
>

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk
Senior Software Engineer, Embedded & Security
E: igor.opaniuk@foundries.io
W: www.foundries.io

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

* Re: [PATCH v2 14/14] arm: Rename STM32MP15x
  2024-01-15 14:05 ` [PATCH v2 14/14] arm: Rename STM32MP15x Patrick Delaunay
@ 2024-01-15 17:40   ` Patrice CHOTARD
  2024-01-19 13:28     ` Patrice CHOTARD
  0 siblings, 1 reply; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-15 17:40 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot
  Cc: Christian Hewitt, FUKAUMI Naoki, Gatien Chevallier,
	Grzegorz Szymaszek, Hai Pham, Igor Opaniuk, Ilias Apalodimas,
	Jonas Karlman, Kever Yang, Lukasz Majewski, Marek Vasut,
	Masahisa Kojima, Michal Simek, Neil Armstrong, Rasmus Villemoes,
	Sean Anderson, Simon Glass, Svyatoslav Ryhel, Tom Rini,
	uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> CONFIG options must not use lower-case letter. Convert this and related
> ones to upper case.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> See Simon's patch in serie "Clean up of bad Kconfig options" never merged
> https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
> https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-69-sjg@chromium.org/
> 
> Changes in v2:
> - add "arm: Rename STM32MP15x"
> 
>  arch/arm/dts/Makefile                           |  2 +-
>  arch/arm/dts/stm32mp15-u-boot.dtsi              |  2 +-
>  arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi        |  4 ++--
>  arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi        |  4 ++--
>  arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi        |  4 ++--
>  arch/arm/mach-stm32mp/Kconfig                   |  6 +++---
>  arch/arm/mach-stm32mp/Kconfig.15x               |  6 +++---
>  arch/arm/mach-stm32mp/Makefile                  |  2 +-
>  arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  4 ++--
>  arch/arm/mach-stm32mp/include/mach/stm32.h      | 12 ++++++------
>  arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
>  arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  6 +++---
>  board/st/common/Kconfig                         |  2 +-
>  board/st/stm32mp1/Kconfig                       |  2 +-
>  board/st/stm32mp1/stm32mp1.c                    |  6 +++---
>  configs/stm32mp15_basic_defconfig               |  2 +-
>  configs/stm32mp15_defconfig                     |  2 +-
>  configs/stm32mp15_trusted_defconfig             |  4 ++--
>  drivers/clk/stm32/Kconfig                       |  2 +-
>  20 files changed, 42 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 8dcf1f5717ce..02074440b55d 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1363,7 +1363,7 @@ dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
>  dtb-$(CONFIG_STM32MP13X) += \
>  	stm32mp135f-dk.dtb
>  
> -dtb-$(CONFIG_STM32MP15x) += \
> +dtb-$(CONFIG_STM32MP15X) += \
>  	stm32mp157a-dk1.dtb \
>  	stm32mp157a-dk1-scmi.dtb \
>  	stm32mp157a-icore-stm32mp1-ctouch2.dtb \
> diff --git a/arch/arm/dts/stm32mp15-u-boot.dtsi b/arch/arm/dts/stm32mp15-u-boot.dtsi
> index 573dd4d3ed56..fe56f05616a0 100644
> --- a/arch/arm/dts/stm32mp15-u-boot.dtsi
> +++ b/arch/arm/dts/stm32mp15-u-boot.dtsi
> @@ -206,7 +206,7 @@
>  	resets = <&rcc UART8_R>;
>  };
>  
> -#if defined(CONFIG_STM32MP15x_STM32IMAGE)
> +#if defined(CONFIG_STM32MP15X_STM32IMAGE)
>  &binman {
>  	u-boot-stm32 {
>  		filename = "u-boot.stm32";
> diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
> index 2623cebf21a4..a16358266a2d 100644
> --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
> +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
> @@ -22,13 +22,13 @@
>  		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
>  	};
>  
> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>  	config {
>  		u-boot,mmc-env-partition = "ssbl";
>  	};
>  #endif
>  
> -#ifdef CONFIG_STM32MP15x_STM32IMAGE
> +#ifdef CONFIG_STM32MP15X_STM32IMAGE
>  	/* only needed for boot with TF-A, witout FIP support */
>  	firmware {
>  		optee {
> diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
> index b8288273ddb5..ef91088aa375 100644
> --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
> +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
> @@ -20,13 +20,13 @@
>  		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
>  	};
>  
> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>  	config {
>  		u-boot,mmc-env-partition = "ssbl";
>  	};
>  #endif
>  
> -#ifdef CONFIG_STM32MP15x_STM32IMAGE
> +#ifdef CONFIG_STM32MP15X_STM32IMAGE
>  	/* only needed for boot with TF-A, witout FIP support */
>  	firmware {
>  		optee {
> diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
> index eb283cacd27d..139940bd5d47 100644
> --- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
> +++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
> @@ -28,7 +28,7 @@
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  
> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>  		partition@0 {
>  			label = "fsbl1";
>  			reg = <0x00000000 0x00040000>;
> @@ -82,7 +82,7 @@
>  				#address-cells = <1>;
>  				#size-cells = <1>;
>  
> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>  				partition@0 {
>  					label = "fsbl";
>  					reg = <0x00000000 0x00200000>;
> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
> index 241fcf3e0d22..a1763ff19993 100644
> --- a/arch/arm/mach-stm32mp/Kconfig
> +++ b/arch/arm/mach-stm32mp/Kconfig
> @@ -35,7 +35,7 @@ config ENV_SIZE
>  
>  choice
>  	prompt "Select STMicroelectronics STM32MPxxx Soc"
> -	default STM32MP15x
> +	default STM32MP15X
>  
>  config STM32MP13X
>  	bool "Support STMicroelectronics STM32MP13x Soc"
> @@ -55,7 +55,7 @@ config STM32MP13X
>  		support of STMicroelectronics SOC STM32MP13x family
>  		STMicroelectronics MPU with core ARMv7
>  
> -config STM32MP15x
> +config STM32MP15X
>  	bool "Support STMicroelectronics STM32MP15x Soc"
>  	select ARCH_SUPPORT_PSCI
>  	select BINMAN
> @@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
>  
>  config STM32_ETZPC
>  	bool "STM32 Extended TrustZone Protection"
> -	depends on STM32MP15x || STM32MP13X
> +	depends on STM32MP15X || STM32MP13X
>  	default y
>  	imply BOOTP_SERVERIP
>  	help
> diff --git a/arch/arm/mach-stm32mp/Kconfig.15x b/arch/arm/mach-stm32mp/Kconfig.15x
> index 1d32f8bf3395..71c14eb4955f 100644
> --- a/arch/arm/mach-stm32mp/Kconfig.15x
> +++ b/arch/arm/mach-stm32mp/Kconfig.15x
> @@ -1,6 +1,6 @@
> -if STM32MP15x
> +if STM32MP15X
>  
> -config STM32MP15x_STM32IMAGE
> +config STM32MP15X_STM32IMAGE
>  	bool "Support STM32 image for generated U-Boot image"
>  	depends on TFABOOT
>  	help
> @@ -11,7 +11,7 @@ choice
>  	prompt "STM32MP15x board select"
>  	optional
>  
> -config TARGET_ST_STM32MP15x
> +config TARGET_ST_STM32MP15X
>  	bool "STMicroelectronics STM32MP15x boards"
>  	imply BOOTSTAGE
>  	imply CMD_BOOTSTAGE
> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
> index 3d194de0631c..ee8a5428feba 100644
> --- a/arch/arm/mach-stm32mp/Makefile
> +++ b/arch/arm/mach-stm32mp/Makefile
> @@ -8,7 +8,7 @@ obj-y += syscon.o
>  obj-y += bsec.o
>  obj-y += soc.o
>  
> -obj-$(CONFIG_STM32MP15x) += stm32mp1/
> +obj-$(CONFIG_STM32MP15X) += stm32mp1/
>  obj-$(CONFIG_STM32MP13X) += stm32mp1/
>  obj-$(CONFIG_STM32MP25X) += stm32mp2/
>  
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
> index dcef6ac4fb82..c7fe232f86e0 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32key.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
> @@ -20,7 +20,7 @@
>   */
>  #define STM32_OTP_CLOSE_ID		0
>  #define STM32_OTP_STM32MP13X_CLOSE_MASK	0x3F
> -#define STM32_OTP_STM32MP15x_CLOSE_MASK	BIT(6)
> +#define STM32_OTP_STM32MP15X_CLOSE_MASK	BIT(6)
>  
>  /* PKH is the first element of the key list */
>  #define STM32KEY_PKH 0
> @@ -64,7 +64,7 @@ static u8 get_key_nb(void)
>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>  		return ARRAY_SIZE(stm32mp13_list);
>  
> -	if (IS_ENABLED(CONFIG_STM32MP15x))
> +	if (IS_ENABLED(CONFIG_STM32MP15X))
>  		return ARRAY_SIZE(stm32mp15_list);
>  }
>  
> @@ -73,7 +73,7 @@ static const struct stm32key *get_key(u8 index)
>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>  		return &stm32mp13_list[index];
>  
> -	if (IS_ENABLED(CONFIG_STM32MP15x))
> +	if (IS_ENABLED(CONFIG_STM32MP15X))
>  		return &stm32mp15_list[index];
>  }
>  
> @@ -82,8 +82,8 @@ static u32 get_otp_close_mask(void)
>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>  		return STM32_OTP_STM32MP13X_CLOSE_MASK;
>  
> -	if (IS_ENABLED(CONFIG_STM32MP15x))
> -		return STM32_OTP_STM32MP15x_CLOSE_MASK;
> +	if (IS_ENABLED(CONFIG_STM32MP15X))
> +		return STM32_OTP_STM32MP15X_CLOSE_MASK;
>  }
>  
>  static int get_misc_dev(struct udevice **dev)
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> index 934ffb1105a0..bf184c8a8846 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> @@ -23,14 +23,14 @@
>  
>  #define CMD_SIZE		512
>  /* SMC is only supported in SPMIN for STM32MP15x */
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define OTP_SIZE_SMC		1024
>  #else
>  #define OTP_SIZE_SMC		0
>  #endif
>  /* size of the OTP struct in NVMEM PTA */
>  #define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
> -#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
> +#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15X)
>  /* STM32MP1 with BSEC2 */
>  #define OTP_SIZE_TA		_OTP_SIZE_TA(96)
>  #else
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
> index 2d7d973368c1..f598da99fbab 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
> @@ -71,11 +71,11 @@ enum forced_boot_mode {
>   * only address used before device tree parsing
>   */
>  
> -#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
> +#if defined(CONFIG_STM32MP15X) || defined(CONFIG_STM32MP13X)
>  #define STM32_RCC_BASE			0x50000000
>  #define STM32_PWR_BASE			0x50001000
>  #define STM32_SYSCFG_BASE		0x50020000
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define STM32_DBGMCU_BASE		0x50081000
>  #endif
>  #define STM32_FMC2_BASE			0x58002000
> @@ -88,7 +88,7 @@ enum forced_boot_mode {
>  #define STM32_STGEN_BASE		0x5C008000
>  #define STM32_TAMP_BASE			0x5C00A000
>  
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define STM32_USART1_BASE		0x5C000000
>  #define STM32_USART2_BASE		0x4000E000
>  #endif
> @@ -107,7 +107,7 @@ enum forced_boot_mode {
>  #define STM32_SDMMC2_BASE		0x58007000
>  #define STM32_SDMMC3_BASE		0x48004000
>  
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define STM32_SYSRAM_BASE		0x2FFC0000
>  #define STM32_SYSRAM_SIZE		SZ_256K
>  #endif
> @@ -129,7 +129,7 @@ enum forced_boot_mode {
>  /* TAMP registers */
>  #define TAMP_BACKUP_REGISTER(x)		(STM32_TAMP_BASE + 0x100 + 4 * x)
>  
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define TAMP_BACKUP_MAGIC_NUMBER	TAMP_BACKUP_REGISTER(4)
>  #define TAMP_BACKUP_BRANCH_ADDRESS	TAMP_BACKUP_REGISTER(5)
>  #define TAMP_FWU_BOOT_INFO_REG		TAMP_BACKUP_REGISTER(10)
> @@ -181,7 +181,7 @@ enum forced_boot_mode {
>  #define STM32_BSEC_LOCK(id)		(STM32_BSEC_LOCK_OFFSET + (id) * 4)
>  
>  /* BSEC OTP index */
> -#ifdef CONFIG_STM32MP15x
> +#ifdef CONFIG_STM32MP15X
>  #define BSEC_OTP_RPN	1
>  #define BSEC_OTP_SERIAL	13
>  #define BSEC_OTP_PKG	16
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
> index e74342d0c608..857148747ef7 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
> +++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
> @@ -6,7 +6,7 @@
>  obj-y += cpu.o
>  
>  obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
> -obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
> +obj-$(CONFIG_STM32MP15X) += stm32mp15x.o
>  
>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
>  ifdef CONFIG_SPL_BUILD
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> index 9436b872e31e..d0b6c3cc5a55 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> +++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
> @@ -275,7 +275,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
>  		array_size = ARRAY_SIZE(stm32mp13_ip_addr);
>  	}
>  
> -	if (IS_ENABLED(CONFIG_STM32MP15x)) {
> +	if (IS_ENABLED(CONFIG_STM32MP15X)) {
>  		array = stm32mp15_ip_addr;
>  		array_size = ARRAY_SIZE(stm32mp15_ip_addr);
>  	}
> @@ -494,7 +494,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>  		stm32mp13_fdt_fixup(blob, soc, cpu, name);
>  
> -	if (IS_ENABLED(CONFIG_STM32MP15x)) {
> +	if (IS_ENABLED(CONFIG_STM32MP15X)) {
>  		stm32mp15_fdt_fixup(blob, soc, cpu, name);
>  
>  		/*
> @@ -505,7 +505,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>  		 * under CONFIG_STM32MP15x_STM32IMAGE only for compatibility
>  		 * when FIP is not used by TF-A
>  		 */
> -		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE) &&
> +		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE) &&
>  		    !tee_find_device(NULL, NULL, NULL, NULL))
>  			stm32_fdt_disable_optee(blob);
>  	}
> diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
> index 6d1b76ba43a8..5efac658cf4d 100644
> --- a/board/st/common/Kconfig
> +++ b/board/st/common/Kconfig
> @@ -1,7 +1,7 @@
>  config CMD_STBOARD
>  	bool "stboard - command for OTP board information"
>  	depends on ARCH_STM32MP
> -	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
> +	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15X || TARGET_ST_STM32MP13X
>  	help
>  	  This compile the stboard command to
>  	  read and write the board in the OTP.
> diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
> index 7d0d41bfea05..96de41546f1d 100644
> --- a/board/st/stm32mp1/Kconfig
> +++ b/board/st/stm32mp1/Kconfig
> @@ -1,4 +1,4 @@
> -if TARGET_ST_STM32MP15x
> +if TARGET_ST_STM32MP15X
>  
>  config SYS_BOARD
>  	default "stm32mp1"
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> index 8f5719c28b33..a17c314daeb8 100644
> --- a/board/st/stm32mp1/stm32mp1.c
> +++ b/board/st/stm32mp1/stm32mp1.c
> @@ -114,7 +114,7 @@ int checkboard(void)
>  	int fdt_compat_len;
>  
>  	if (IS_ENABLED(CONFIG_TFABOOT)) {
> -		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE))
> +		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE))
>  			mode = "trusted - stm32image";
>  		else
>  			mode = "trusted";
> @@ -616,7 +616,7 @@ error:
>  
>  static bool board_is_stm32mp15x_dk2(void)
>  {
> -	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
> +	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
>  	    of_machine_is_compatible("st,stm32mp157c-dk2"))
>  		return true;
>  
> @@ -625,7 +625,7 @@ static bool board_is_stm32mp15x_dk2(void)
>  
>  static bool board_is_stm32mp15x_ev1(void)
>  {
> -	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
> +	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
>  	    (of_machine_is_compatible("st,stm32mp157a-ev1") ||
>  	     of_machine_is_compatible("st,stm32mp157c-ev1") ||
>  	     of_machine_is_compatible("st,stm32mp157d-ev1") ||
> diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
> index 3032d83b992e..005f1d55f80e 100644
> --- a/configs/stm32mp15_basic_defconfig
> +++ b/configs/stm32mp15_basic_defconfig
> @@ -13,7 +13,7 @@ CONFIG_SPL_STACK=0x30000000
>  CONFIG_SPL=y
>  CONFIG_CMD_STM32KEY=y
>  CONFIG_TYPEC_STUSB160X=y
> -CONFIG_TARGET_ST_STM32MP15x=y
> +CONFIG_TARGET_ST_STM32MP15X=y
>  CONFIG_ENV_OFFSET_REDUND=0x2C0000
>  CONFIG_CMD_STM32PROG=y
>  CONFIG_SPL_SPI_FLASH_SUPPORT=y
> diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig
> index 4aff6398846f..3302b3069965 100644
> --- a/configs/stm32mp15_defconfig
> +++ b/configs/stm32mp15_defconfig
> @@ -9,7 +9,7 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
>  CONFIG_DDR_CACHEABLE_SIZE=0x8000000
>  CONFIG_CMD_STM32KEY=y
>  CONFIG_TYPEC_STUSB160X=y
> -CONFIG_TARGET_ST_STM32MP15x=y
> +CONFIG_TARGET_ST_STM32MP15X=y
>  CONFIG_ENV_OFFSET_REDUND=0x940000
>  CONFIG_CMD_STM32PROG=y
>  # CONFIG_ARMV7_NONSEC is not set
> diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
> index ec32f1ea0f2c..84b0854b5573 100644
> --- a/configs/stm32mp15_trusted_defconfig
> +++ b/configs/stm32mp15_trusted_defconfig
> @@ -9,8 +9,8 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
>  CONFIG_DDR_CACHEABLE_SIZE=0x10000000
>  CONFIG_CMD_STM32KEY=y
>  CONFIG_TYPEC_STUSB160X=y
> -CONFIG_STM32MP15x_STM32IMAGE=y
> -CONFIG_TARGET_ST_STM32MP15x=y
> +CONFIG_STM32MP15X_STM32IMAGE=y
> +CONFIG_TARGET_ST_STM32MP15X=y
>  CONFIG_ENV_OFFSET_REDUND=0x2C0000
>  CONFIG_CMD_STM32PROG=y
>  # CONFIG_ARMV7_NONSEC is not set
> diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
> index 7dbddd032b89..c05015efe8b4 100644
> --- a/drivers/clk/stm32/Kconfig
> +++ b/drivers/clk/stm32/Kconfig
> @@ -23,7 +23,7 @@ config CLK_STM32_CORE
>  config CLK_STM32MP1
>  	bool "Enable RCC clock driver for STM32MP15"
>  	depends on ARCH_STM32MP && CLK
> -	default y if STM32MP15x
> +	default y if STM32MP15X
>  	help
>  	  Enable the STM32 clock (RCC) driver. Enable support for
>  	  manipulating STM32MP15's on-SoC clocks.
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

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

* Re: [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25
  2024-01-15 14:05 ` [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25 Patrick Delaunay
@ 2024-01-15 17:41   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-15 17:41 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Simon Glass, U-Boot STM32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Change OTP number to 364 for STM32MP25 as it is done in bsec driver.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> index ae4bd8842f53..eda98eb61d76 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> @@ -28,7 +28,15 @@
>  #else
>  #define OTP_SIZE_SMC		0
>  #endif
> -#define OTP_SIZE_TA		776
> +/* size of the OTP struct in NVMEM PTA */
> +#define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
> +#if defined(CONFIG_STM32MP13x) || defined(CONFIG_STM32MP15x)
> +/* STM32MP1 with BSEC2 */
> +#define OTP_SIZE_TA		_OTP_SIZE_TA(96)
> +#else
> +/* STM32MP2 with BSEC3 */
> +#define OTP_SIZE_TA		_OTP_SIZE_TA(368)
> +#endif
>  #define PMIC_SIZE		8
>  
>  enum stm32prog_target {
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

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

* Re: [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards
  2024-01-15 14:05 ` [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards Patrick Delaunay
@ 2024-01-15 17:42   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-15 17:42 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot
  Cc: Igor Opaniuk, Marek Vasut, Oleksandr Suvorov, Simon Glass, U-Boot STM32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Activate the command stboard for stm32mp25 STMicroelectronics boards,
> add the default used OTP identifier and the associated board identifier:
> - stm32mp25xx-ev1 = MB1936
> - stm32mp25xx-dk = MB1605
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> Changes in v2:
> - fix CONFIG name with 'x': TARGET_ST_STM32MP15x TARGET_ST_STM32MP13x
> 
>  arch/arm/mach-stm32mp/include/mach/stm32.h | 1 +
>  board/st/common/Kconfig                    | 2 +-
>  board/st/common/cmd_stboard.c              | 2 ++
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
> index 45c929aa605d..726c390977e3 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
> @@ -198,6 +198,7 @@ enum forced_boot_mode {
>  #define BSEC_OTP_SERIAL	5
>  #define BSEC_OTP_RPN	9
>  #define BSEC_OTP_PKG	122
> +#define BSEC_OTP_BOARD	246
>  #define BSEC_OTP_MAC	247
>  #endif
>  
> diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
> index c1c254d07354..f40d1a78ca36 100644
> --- a/board/st/common/Kconfig
> +++ b/board/st/common/Kconfig
> @@ -1,7 +1,7 @@
>  config CMD_STBOARD
>  	bool "stboard - command for OTP board information"
>  	depends on ARCH_STM32MP
> -	default y if TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
> +	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
>  	help
>  	  This compile the stboard command to
>  	  read and write the board in the OTP.
> diff --git a/board/st/common/cmd_stboard.c b/board/st/common/cmd_stboard.c
> index 853ab78bbf16..cb103e69b369 100644
> --- a/board/st/common/cmd_stboard.c
> +++ b/board/st/common/cmd_stboard.c
> @@ -49,7 +49,9 @@ static bool check_stboard(u16 board)
>  		0x1298,
>  		0x1341,
>  		0x1497,
> +		0x1605, /* stm32mp25xx-dk */
>  		0x1635,
> +		0x1936, /* stm32mp25xx-ev1 */
>  	};
>  
>  	for (i = 0; i < ARRAY_SIZE(st_board_id); i++)
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks

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

* Re: [PATCH v2 01/14] arm64: dts: st: add bsec support to stm32mp25
  2024-01-15 14:05 ` [PATCH v2 01/14] arm64: dts: st: add bsec " Patrick Delaunay
@ 2024-01-19 13:22   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:22 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Alexandre Torgue, Simon Glass, uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add BSEC support to STM32MP25 SoC family with SoC information:
> - RPN = Device part number (BSEC_OTP_DATA9)
> - PKG = package data register (Bits 2:0 of BSEC_OTP_DATA122)
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/dts/stm32mp25-u-boot.dtsi |  4 ++++
>  arch/arm/dts/stm32mp251.dtsi       | 16 ++++++++++++++++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/arch/arm/dts/stm32mp25-u-boot.dtsi b/arch/arm/dts/stm32mp25-u-boot.dtsi
> index f4f26add2a41..0c8e95b34163 100644
> --- a/arch/arm/dts/stm32mp25-u-boot.dtsi
> +++ b/arch/arm/dts/stm32mp25-u-boot.dtsi
> @@ -37,6 +37,10 @@
>  	};
>  };
>  
> +&bsec {
> +	bootph-all;
> +};
> +
>  &gpioa {
>  	bootph-all;
>  };
> diff --git a/arch/arm/dts/stm32mp251.dtsi b/arch/arm/dts/stm32mp251.dtsi
> index cf2f28dc1582..44eb664fb510 100644
> --- a/arch/arm/dts/stm32mp251.dtsi
> +++ b/arch/arm/dts/stm32mp251.dtsi
> @@ -127,6 +127,22 @@
>  			};
>  		};
>  
> +		bsec: efuse@44000000 {
> +			compatible = "st,stm32mp25-bsec";
> +			reg = <0x44000000 0x1000>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			part_number_otp@24 {
> +				reg = <0x24 0x4>;
> +			};
> +
> +			package_otp@1e8 {
> +				reg = <0x1e8 0x1>;
> +				bits = <0 3>;
> +			};
> +		};
> +
>  		syscfg: syscon@44230000 {
>  			compatible = "st,stm32mp25-syscfg", "syscon";
>  			reg = <0x44230000 0x10000>;

Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25
  2024-01-15 14:05 ` [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25 Patrick Delaunay
@ 2024-01-19 13:24   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:24 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Yann Gautier, Tom Rini, U-Boot STM32



On 1/15/24 15:05, Patrick Delaunay wrote:
> From: Yann Gautier <yann.gautier@foss.st.com>
> 
> Add chip revision B support for STM32MP25, for displaying it in trace.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c b/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
> index 4b2f70af9cc6..7f896a0d65d2 100644
> --- a/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
> +++ b/arch/arm/mach-stm32mp/stm32mp2/stm32mp25x.c
> @@ -167,6 +167,9 @@ void get_soc_name(char name[SOC_NAME_SIZE])
>  		case CPU_REV1:
>  			cpu_r = "A";
>  			break;
> +		case CPU_REV2:
> +			cpu_r = "B";
> +			break;
>  		default:
>  			break;
>  		}
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 03/14] stm32mp: bsec: add driver data
  2024-01-15 14:05 ` [PATCH v2 03/14] stm32mp: bsec: add driver data Patrick Delaunay
@ 2024-01-19 13:24   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:24 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Simon Glass, U-Boot STM32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add driver data in  BSEC driver to test presence of OP-TEE TA,
> mandatory for STM32MP13 family and prepare the support of new device
> with more OTP than 95.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-stm32mp/bsec.c | 38 ++++++++++++++++++++++++++++--------
>  1 file changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
> index 28a8280b2804..705c994d9307 100644
> --- a/arch/arm/mach-stm32mp/bsec.c
> +++ b/arch/arm/mach-stm32mp/bsec.c
> @@ -20,7 +20,6 @@
>  #include <linux/iopoll.h>
>  #include <linux/printk.h>
>  
> -#define BSEC_OTP_MAX_VALUE		95
>  #define BSEC_OTP_UPPER_START		32
>  #define BSEC_TIMEOUT_US			10000
>  
> @@ -400,6 +399,11 @@ struct stm32mp_bsec_priv {
>  	struct udevice *tee;
>  };
>  
> +struct stm32mp_bsec_drvdata {
> +	int size;
> +	bool ta;
> +};
> +
>  static int stm32mp_bsec_read_otp(struct udevice *dev, u32 *val, u32 otp)
>  {
>  	struct stm32mp_bsec_plat *plat;
> @@ -609,6 +613,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
>  			     void *buf, int size)
>  {
>  	struct stm32mp_bsec_priv *priv = dev_get_priv(dev);
> +	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
>  	int ret;
>  	int i;
>  	bool shadow = true, lock = false;
> @@ -642,7 +647,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
>  
>  	otp = offs / sizeof(u32);
>  
> -	for (i = otp; i < (otp + nb_otp) && i <= BSEC_OTP_MAX_VALUE; i++) {
> +	for (i = otp; i < (otp + nb_otp) && i < data->size; i++) {
>  		u32 *addr = &((u32 *)buf)[i - otp];
>  
>  		if (lock)
> @@ -665,6 +670,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
>  			      const void *buf, int size)
>  {
>  	struct stm32mp_bsec_priv *priv = dev_get_priv(dev);
> +	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
>  	int ret = 0;
>  	int i;
>  	bool shadow = true, lock = false;
> @@ -698,7 +704,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
>  
>  	otp = offs / sizeof(u32);
>  
> -	for (i = otp; i < otp + nb_otp && i <= BSEC_OTP_MAX_VALUE; i++) {
> +	for (i = otp; i < otp + nb_otp && i < data->size; i++) {
>  		u32 *val = &((u32 *)buf)[i - otp];
>  
>  		if (lock)
> @@ -732,6 +738,7 @@ static int stm32mp_bsec_of_to_plat(struct udevice *dev)
>  
>  static int stm32mp_bsec_probe(struct udevice *dev)
>  {
> +	struct stm32mp_bsec_drvdata *data = (struct stm32mp_bsec_drvdata *)dev_get_driver_data(dev);
>  	int otp;
>  	struct stm32mp_bsec_plat *plat;
>  	struct clk_bulk clk_bulk;
> @@ -745,16 +752,22 @@ static int stm32mp_bsec_probe(struct udevice *dev)
>  	}
>  
>  	if (IS_ENABLED(CONFIG_OPTEE))
> -		bsec_optee_open(dev);
> +		ret = bsec_optee_open(dev);
> +	else
> +		ret = -ENOTSUPP;
> +	/* failed if OP-TEE TA is required */
> +	if (data->ta && !ret)
> +		return ret;
>  
>  	/*
>  	 * update unlocked shadow for OTP cleared by the rom code
>  	 * only executed in SPL, it is done in TF-A for TFABOOT
>  	 */
> -	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
> +	if (IS_ENABLED(CONFIG_SPL_BUILD) && !data->ta) {
>  		plat = dev_get_plat(dev);
>  
> -		for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
> +		/* here 57 is the value for STM32MP15x ROM code, only MPU with SPL support*/
> +		for (otp = 57; otp < data->size; otp++)
>  			if (!bsec_read_SR_lock(plat->base, otp))
>  				bsec_shadow_register(dev, plat->base, otp);
>  	}
> @@ -762,9 +775,18 @@ static int stm32mp_bsec_probe(struct udevice *dev)
>  	return 0;
>  }
>  
> +static const struct stm32mp_bsec_drvdata stm32mp13_data = {
> +	.size = 96,
> +	.ta = true,
> +};
> +
> +static const struct stm32mp_bsec_drvdata stm32mp15_data = {
> +	.size = 96,
> +	.ta = false,
> +};
>  static const struct udevice_id stm32mp_bsec_ids[] = {
> -	{ .compatible = "st,stm32mp13-bsec" },
> -	{ .compatible = "st,stm32mp15-bsec" },
> +	{ .compatible = "st,stm32mp13-bsec", .data = (ulong)&stm32mp13_data},
> +	{ .compatible = "st,stm32mp15-bsec", .data = (ulong)&stm32mp15_data},
>  	{}
>  };
>  
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25
  2024-01-15 14:05 ` [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25 Patrick Delaunay
@ 2024-01-19 13:24   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:24 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot
  Cc: Igor Opaniuk, Marek Vasut, Oleksandr Suvorov, Simon Glass, U-Boot STM32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add support of BSEC for STM32MP25x family to access OTP.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-stm32mp/bsec.c               | 7 +++++++
>  arch/arm/mach-stm32mp/include/mach/stm32.h | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
> index 705c994d9307..5b869017ec1a 100644
> --- a/arch/arm/mach-stm32mp/bsec.c
> +++ b/arch/arm/mach-stm32mp/bsec.c
> @@ -784,9 +784,16 @@ static const struct stm32mp_bsec_drvdata stm32mp15_data = {
>  	.size = 96,
>  	.ta = false,
>  };
> +
> +static const struct stm32mp_bsec_drvdata stm32mp25_data = {
> +	.size = 368, /* 384 but no access to HWKEY and STM32PRVKEY */
> +	.ta = true,
> +};
> +
>  static const struct udevice_id stm32mp_bsec_ids[] = {
>  	{ .compatible = "st,stm32mp13-bsec", .data = (ulong)&stm32mp13_data},
>  	{ .compatible = "st,stm32mp15-bsec", .data = (ulong)&stm32mp15_data},
> +	{ .compatible = "st,stm32mp25-bsec", .data = (ulong)&stm32mp25_data},
>  	{}
>  };
>  
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
> index 46d469881b32..45c929aa605d 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
> @@ -197,7 +197,8 @@ enum forced_boot_mode {
>  #ifdef CONFIG_STM32MP25X
>  #define BSEC_OTP_SERIAL	5
>  #define BSEC_OTP_RPN	9
> -#define BSEC_OTP_PKG	246
> +#define BSEC_OTP_PKG	122
> +#define BSEC_OTP_MAC	247
>  #endif
>  
>  #ifndef __ASSEMBLY__
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 05/14] configs: stm32mp25: add support of fuse command
  2024-01-15 14:05 ` [PATCH v2 05/14] configs: stm32mp25: add support of fuse command Patrick Delaunay
@ 2024-01-19 13:25   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:25 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Simon Glass, uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add support of the command fuse with CONFIG_CMD_FUSE to allow access
> on OTP with command line.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  configs/stm32mp25_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configs/stm32mp25_defconfig b/configs/stm32mp25_defconfig
> index 75f27c98b441..9fbd7eb15755 100644
> --- a/configs/stm32mp25_defconfig
> +++ b/configs/stm32mp25_defconfig
> @@ -21,6 +21,7 @@ CONFIG_CMD_ADTIMG=y
>  CONFIG_CMD_MEMINFO=y
>  CONFIG_CMD_MEMTEST=y
>  CONFIG_CMD_CLK=y
> +CONFIG_CMD_FUSE=y
>  CONFIG_CMD_GPIO=y
>  # CONFIG_CMD_LOADB is not set
>  CONFIG_CMD_CACHE=y
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 06/14] stm32mp: add soc.c file
  2024-01-15 16:26   ` Igor Opaniuk
@ 2024-01-19 13:25     ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:25 UTC (permalink / raw)
  To: Igor Opaniuk, Patrick Delaunay
  Cc: u-boot, Bhupesh Sharma, Oleksandr Suvorov, Rasmus Villemoes,
	Simon Glass, U-Boot STM32



On 1/15/24 17:26, Igor Opaniuk wrote:
> On Mon, Jan 15, 2024 at 3:07 PM Patrick Delaunay
> <patrick.delaunay@foss.st.com> wrote:
>>
>> Add a new file soc.c for common functions between stm32mp1 and stm32mp2
>> family and move print_cpuinfo() in this new file.
>>
>> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>>
>> (no changes since v1)
>>
>>  arch/arm/mach-stm32mp/Makefile       |  1 +
>>  arch/arm/mach-stm32mp/soc.c          | 17 +++++++++++++++++
>>  arch/arm/mach-stm32mp/stm32mp1/cpu.c | 11 -----------
>>  arch/arm/mach-stm32mp/stm32mp2/cpu.c | 11 -----------
>>  4 files changed, 18 insertions(+), 22 deletions(-)
>>  create mode 100644 arch/arm/mach-stm32mp/soc.c
>>
>> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
>> index 00dc25bb275c..fdcbbf91dfd5 100644
>> --- a/arch/arm/mach-stm32mp/Makefile
>> +++ b/arch/arm/mach-stm32mp/Makefile
>> @@ -6,6 +6,7 @@
>>  obj-y += dram_init.o
>>  obj-y += syscon.o
>>  obj-y += bsec.o
>> +obj-y += soc.o
>>
>>  obj-$(CONFIG_STM32MP15x) += stm32mp1/
>>  obj-$(CONFIG_STM32MP13x) += stm32mp1/
>> diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
>> new file mode 100644
>> index 000000000000..8d5fa474ccaf
>> --- /dev/null
>> +++ b/arch/arm/mach-stm32mp/soc.c
>> @@ -0,0 +1,17 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
>> +/*
>> + * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
>> + */
>> +
>> +#include <asm/arch/sys_proto.h>
>> +
>> +/* used when CONFIG_DISPLAY_CPUINFO is activated */
>> +int print_cpuinfo(void)
>> +{
>> +       char name[SOC_NAME_SIZE];
>> +
>> +       get_soc_name(name);
>> +       printf("CPU: %s\n", name);
>> +
>> +       return 0;
>> +}
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> index 55574fd4bebf..00fea7929b2f 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> @@ -158,17 +158,6 @@ void enable_caches(void)
>>         dcache_enable();
>>  }
>>
>> -/* used when CONFIG_DISPLAY_CPUINFO is activated */
>> -int print_cpuinfo(void)
>> -{
>> -       char name[SOC_NAME_SIZE];
>> -
>> -       get_soc_name(name);
>> -       printf("CPU: %s\n", name);
>> -
>> -       return 0;
>> -}
>> -
>>  static void setup_boot_mode(void)
>>  {
>>         const u32 serial_addr[] = {
>> diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> index f43d1aaf72cc..c0f6519e8d7c 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> @@ -67,17 +67,6 @@ void enable_caches(void)
>>         dcache_enable();
>>  }
>>
>> -/* used when CONFIG_DISPLAY_CPUINFO is activated */
>> -int print_cpuinfo(void)
>> -{
>> -       char name[SOC_NAME_SIZE];
>> -
>> -       get_soc_name(name);
>> -       printf("CPU: %s\n", name);
>> -
>> -       return 0;
>> -}
>> -
>>  int arch_misc_init(void)
>>  {
>>         return 0;
>> --
>> 2.25.1
>>
> 
> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> 
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25
  2024-01-15 16:23   ` Igor Opaniuk
@ 2024-01-19 13:25     ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:25 UTC (permalink / raw)
  To: Igor Opaniuk, Patrick Delaunay
  Cc: u-boot, Bhupesh Sharma, Oleksandr Suvorov, Rasmus Villemoes,
	Simon Glass, U-Boot STM32



On 1/15/24 17:23, Igor Opaniuk wrote:
> Hello Patrick,
> 
> On Mon, Jan 15, 2024 at 5:03 PM Patrick Delaunay
> <patrick.delaunay@foss.st.com> wrote:
>>
>> From: Patrice Chotard <patrice.chotard@foss.st.com>
>>
>> Add support of serial number for stm32mp25, gets from OTP with BSEC driver.
>>
>> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
>> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>>
>> (no changes since v1)
>>
>>  .../arm/mach-stm32mp/include/mach/sys_proto.h |  1 +
>>  arch/arm/mach-stm32mp/soc.c                   | 31 +++++++++++++++++++
>>  arch/arm/mach-stm32mp/stm32mp1/cpu.c          | 27 ----------------
>>  arch/arm/mach-stm32mp/stm32mp2/cpu.c          |  2 ++
>>  4 files changed, 34 insertions(+), 27 deletions(-)
>>
>> diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
>> index 83388fdb7371..2a65efc0a50a 100644
>> --- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
>> +++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
>> @@ -97,6 +97,7 @@ u32 get_bootauth(void);
>>
>>  int get_eth_nb(void);
>>  int setup_mac_address(void);
>> +int setup_serial_number(void);
>>
>>  /* board power management : configure vddcore according OPP */
>>  void board_vddcore_init(u32 voltage_mv);
>> diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
>> index 8d5fa474ccaf..ff70ebe97464 100644
>> --- a/arch/arm/mach-stm32mp/soc.c
>> +++ b/arch/arm/mach-stm32mp/soc.c
>> @@ -3,7 +3,11 @@
>>   * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
>>   */
>>
>> +#include <env.h>
>> +#include <misc.h>
>>  #include <asm/arch/sys_proto.h>
>> +#include <dm/device.h>
>> +#include <dm/uclass.h>
>>
>>  /* used when CONFIG_DISPLAY_CPUINFO is activated */
>>  int print_cpuinfo(void)
>> @@ -15,3 +19,30 @@ int print_cpuinfo(void)
>>
>>         return 0;
>>  }
>> +
>> +int setup_serial_number(void)
>> +{
>> +       char serial_string[25];
>> +       u32 otp[3] = {0, 0, 0 };
>> +       struct udevice *dev;
>> +       int ret;
>> +
>> +       if (env_get("serial#"))
>> +               return 0;
>> +
>> +       ret = uclass_get_device_by_driver(UCLASS_MISC,
>> +                                         DM_DRIVER_GET(stm32mp_bsec),
>> +                                         &dev);
>> +       if (ret)
>> +               return ret;
>> +
>> +       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
>> +                       otp, sizeof(otp));
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
>> +       env_set("serial#", serial_string);
>> +
>> +       return 0;
>> +}
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> index 00fea7929b2f..f84cb26fa565 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
>> @@ -336,33 +336,6 @@ __weak int setup_mac_address(void)
>>         return 0;
>>  }
>>
>> -static int setup_serial_number(void)
>> -{
>> -       char serial_string[25];
>> -       u32 otp[3] = {0, 0, 0 };
>> -       struct udevice *dev;
>> -       int ret;
>> -
>> -       if (env_get("serial#"))
>> -               return 0;
>> -
>> -       ret = uclass_get_device_by_driver(UCLASS_MISC,
>> -                                         DM_DRIVER_GET(stm32mp_bsec),
>> -                                         &dev);
>> -       if (ret)
>> -               return ret;
>> -
>> -       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
>> -                       otp, sizeof(otp));
>> -       if (ret < 0)
>> -               return ret;
>> -
>> -       sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
>> -       env_set("serial#", serial_string);
>> -
>> -       return 0;
>> -}
>> -
>>  __weak void stm32mp_misc_init(void)
>>  {
>>  }
>> diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> index c0f6519e8d7c..301e365cf4f4 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
>> @@ -69,6 +69,8 @@ void enable_caches(void)
>>
>>  int arch_misc_init(void)
>>  {
>> +       setup_serial_number();
>> +
>>         return 0;
>>  }
>>
>> --
>> 2.25.1
>>
> 
> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> 
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 08/14] smt32mp: add setup_mac_address for stm32mp25
  2024-01-15 14:05 ` [PATCH v2 08/14] smt32mp: add setup_mac_address " Patrick Delaunay
@ 2024-01-19 13:26   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:26 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot
  Cc: Bhupesh Sharma, Oleksandr Suvorov, Rasmus Villemoes, Simon Glass,
	uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add a function setup_mac_address() to update the MAC address from the
> default location in OTP for stm32mp2 platform.
> 
> The max number of OTP for MAC address is increased to 8 for STM32MP25,
> defined with get_eth_nb() and checked in setup_mac_address.
> 
> The MAC address FF:FF:FF:FF:FF:FF, the broadcast ethaddr, is a invalid
> value used for unused MAC address slot in OTP, for example for board
> with STM32MP25x part number allows up to 5 ethernet ports but it is not
> supported by the hardware, without switch; the associated variable
> "enetaddr%d" is not created.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-stm32mp/soc.c          | 70 ++++++++++++++++++++++++++++
>  arch/arm/mach-stm32mp/stm32mp1/cpu.c | 58 +----------------------
>  arch/arm/mach-stm32mp/stm32mp2/cpu.c |  1 +
>  3 files changed, 72 insertions(+), 57 deletions(-)
> 
> diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
> index ff70ebe97464..fa56b0d2e0f1 100644
> --- a/arch/arm/mach-stm32mp/soc.c
> +++ b/arch/arm/mach-stm32mp/soc.c
> @@ -5,10 +5,14 @@
>  
>  #include <env.h>
>  #include <misc.h>
> +#include <net.h>
>  #include <asm/arch/sys_proto.h>
>  #include <dm/device.h>
>  #include <dm/uclass.h>
>  
> +/* max: 8 OTP for 5 mac address on stm32mp2*/
> +#define MAX_NB_OTP	8
> +
>  /* used when CONFIG_DISPLAY_CPUINFO is activated */
>  int print_cpuinfo(void)
>  {
> @@ -46,3 +50,69 @@ int setup_serial_number(void)
>  
>  	return 0;
>  }
> +
> +/*
> + * If there is no MAC address in the environment, then it will be initialized
> + * (silently) from the value in the OTP.
> + */
> +__weak int setup_mac_address(void)
> +{
> +	int ret;
> +	int i;
> +	u32 otp[MAX_NB_OTP];
> +	uchar enetaddr[ARP_HLEN];
> +	struct udevice *dev;
> +	int nb_eth, nb_otp, index;
> +
> +	if (!IS_ENABLED(CONFIG_NET))
> +		return 0;
> +
> +	nb_eth = get_eth_nb();
> +	if (!nb_eth)
> +		return 0;
> +
> +	/* 6 bytes for each MAC addr and 4 bytes for each OTP */
> +	nb_otp = DIV_ROUND_UP(ARP_HLEN * nb_eth, 4);
> +	if (nb_otp > MAX_NB_OTP) {
> +		log_err("invalid number of OTP = %d, max = %d\n", nb_otp, MAX_NB_OTP);
> +		return -EINVAL;
> +	}
> +
> +	ret = uclass_get_device_by_driver(UCLASS_MISC,
> +					  DM_DRIVER_GET(stm32mp_bsec),
> +					  &dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC), otp, 4 * nb_otp);
> +	if (ret < 0)
> +		return ret;
> +
> +	for (index = 0; index < nb_eth; index++) {
> +		/* MAC already in environment */
> +		if (eth_env_get_enetaddr_by_index("eth", index, enetaddr))
> +			continue;
> +
> +		for (i = 0; i < ARP_HLEN; i++)
> +			enetaddr[i] = ((uint8_t *)&otp)[i + ARP_HLEN * index];
> +
> +		/* skip FF:FF:FF:FF:FF:FF */
> +		if (is_broadcast_ethaddr(enetaddr))
> +			continue;
> +
> +		if (!is_valid_ethaddr(enetaddr)) {
> +			log_err("invalid MAC address %d in OTP %pM\n",
> +				index, enetaddr);
> +			return -EINVAL;
> +		}
> +		log_debug("OTP MAC address %d = %pM\n", index, enetaddr);
> +		ret = eth_env_set_enetaddr_by_index("eth", index, enetaddr);
> +		if (ret) {
> +			log_err("Failed to set mac address %pM from OTP: %d\n",
> +				enetaddr, ret);
> +			return ret;
> +		}
> +	}
> +
> +	return 0;
> +}
> diff --git a/arch/arm/mach-stm32mp/stm32mp1/cpu.c b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> index f84cb26fa565..524778f00c67 100644
> --- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
> @@ -14,8 +14,8 @@
>  #include <log.h>
>  #include <lmb.h>
>  #include <misc.h>
> -#include <net.h>
>  #include <spl.h>
> +#include <asm/cache.h>
>  #include <asm/io.h>
>  #include <asm/arch/stm32.h>
>  #include <asm/arch/sys_proto.h>
> @@ -280,62 +280,6 @@ static void setup_boot_mode(void)
>  	clrsetbits_le32(TAMP_BOOT_CONTEXT, TAMP_BOOT_FORCED_MASK, BOOT_NORMAL);
>  }
>  
> -/*
> - * If there is no MAC address in the environment, then it will be initialized
> - * (silently) from the value in the OTP.
> - */
> -__weak int setup_mac_address(void)
> -{
> -	int ret;
> -	int i;
> -	u32 otp[3];
> -	uchar enetaddr[6];
> -	struct udevice *dev;
> -	int nb_eth, nb_otp, index;
> -
> -	if (!IS_ENABLED(CONFIG_NET))
> -		return 0;
> -
> -	nb_eth = get_eth_nb();
> -
> -	/* 6 bytes for each MAC addr and 4 bytes for each OTP */
> -	nb_otp = DIV_ROUND_UP(6 * nb_eth, 4);
> -
> -	ret = uclass_get_device_by_driver(UCLASS_MISC,
> -					  DM_DRIVER_GET(stm32mp_bsec),
> -					  &dev);
> -	if (ret)
> -		return ret;
> -
> -	ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC), otp, 4 * nb_otp);
> -	if (ret < 0)
> -		return ret;
> -
> -	for (index = 0; index < nb_eth; index++) {
> -		/* MAC already in environment */
> -		if (eth_env_get_enetaddr_by_index("eth", index, enetaddr))
> -			continue;
> -
> -		for (i = 0; i < 6; i++)
> -			enetaddr[i] = ((uint8_t *)&otp)[i + 6 * index];
> -
> -		if (!is_valid_ethaddr(enetaddr)) {
> -			log_err("invalid MAC address %d in OTP %pM\n",
> -				index, enetaddr);
> -			return -EINVAL;
> -		}
> -		log_debug("OTP MAC address %d = %pM\n", index, enetaddr);
> -		ret = eth_env_set_enetaddr_by_index("eth", index, enetaddr);
> -		if (ret) {
> -			log_err("Failed to set mac address %pM from OTP: %d\n",
> -				enetaddr, ret);
> -			return ret;
> -		}
> -	}
> -
> -	return 0;
> -}
> -
>  __weak void stm32mp_misc_init(void)
>  {
>  }
> diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> index 301e365cf4f4..9530aa8534b7 100644
> --- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> +++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
> @@ -70,6 +70,7 @@ void enable_caches(void)
>  int arch_misc_init(void)
>  {
>  	setup_serial_number();
> +	setup_mac_address();
>  
>  	return 0;
>  }
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 11/14] board: st: stm32mp2: add checkboard
  2024-01-15 14:05 ` [PATCH v2 11/14] board: st: stm32mp2: add checkboard Patrick Delaunay
@ 2024-01-19 13:27   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:27 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Implement the weak function checkboard to identify the used board with
> compatible in device tree for the support of stm32mp2 STMicroelectronics
> boards.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  board/st/stm32mp2/stm32mp2.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
> index c97a7efff46e..9a881583d904 100644
> --- a/board/st/stm32mp2/stm32mp2.c
> +++ b/board/st/stm32mp2/stm32mp2.c
> @@ -8,14 +8,28 @@
>  #include <config.h>
>  #include <env.h>
>  #include <fdt_support.h>
> +#include <log.h>
>  #include <asm/global_data.h>
>  #include <asm/arch/sys_proto.h>
> +#include <dm/ofnode.h>
>  
>  /*
>   * Get a global data pointer
>   */
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +int checkboard(void)
> +{
> +	const char *fdt_compat;
> +	int fdt_compat_len;
> +
> +	fdt_compat = ofnode_get_property(ofnode_root(), "compatible", &fdt_compat_len);
> +
> +	log_info("Board: stm32mp2 (%s)\n", fdt_compat && fdt_compat_len ? fdt_compat : "");
> +
> +	return 0;
> +}
> +
>  /* board dependent setup after realloc */
>  int board_init(void)
>  {
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 12/14] board: st: stm32mp2: display the board identification
  2024-01-15 14:05 ` [PATCH v2 12/14] board: st: stm32mp2: display the board identification Patrick Delaunay
@ 2024-01-19 13:27   ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:27 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: uboot-stm32



On 1/15/24 15:05, Patrick Delaunay wrote:
> Add the display of the STMicroelectronics board identification saved in OTP
> in stm32mp2 checkboard function.
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
> (no changes since v1)
> 
>  board/st/stm32mp2/stm32mp2.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
> index 9a881583d904..aa7dd31996ea 100644
> --- a/board/st/stm32mp2/stm32mp2.c
> +++ b/board/st/stm32mp2/stm32mp2.c
> @@ -9,9 +9,12 @@
>  #include <env.h>
>  #include <fdt_support.h>
>  #include <log.h>
> +#include <misc.h>
>  #include <asm/global_data.h>
>  #include <asm/arch/sys_proto.h>
> +#include <dm/device.h>
>  #include <dm/ofnode.h>
> +#include <dm/uclass.h>
>  
>  /*
>   * Get a global data pointer
> @@ -20,6 +23,9 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  int checkboard(void)
>  {
> +	int ret;
> +	u32 otp;
> +	struct udevice *dev;
>  	const char *fdt_compat;
>  	int fdt_compat_len;
>  
> @@ -27,6 +33,23 @@ int checkboard(void)
>  
>  	log_info("Board: stm32mp2 (%s)\n", fdt_compat && fdt_compat_len ? fdt_compat : "");
>  
> +	/* display the STMicroelectronics board identification */
> +	if (CONFIG_IS_ENABLED(CMD_STBOARD)) {
> +		ret = uclass_get_device_by_driver(UCLASS_MISC,
> +						  DM_DRIVER_GET(stm32mp_bsec),
> +						  &dev);
> +		if (!ret)
> +			ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
> +					&otp, sizeof(otp));
> +		if (ret > 0 && otp)
> +			log_info("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
> +				 otp >> 16,
> +				 (otp >> 12) & 0xF,
> +				 (otp >> 4) & 0xF,
> +				 ((otp >> 8) & 0xF) - 1 + 'A',
> +				 otp & 0xF);
> +	}
> +
>  	return 0;
>  }
>  
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 13/14] arm: Rename STM32MP13x
  2024-01-15 17:02   ` Igor Opaniuk
@ 2024-01-19 13:28     ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:28 UTC (permalink / raw)
  To: Igor Opaniuk, Patrick Delaunay
  Cc: u-boot, Simon Glass, Christian Hewitt, FUKAUMI Naoki,
	Gatien Chevallier, Hai Pham, Jonas Karlman, Kever Yang,
	Lukasz Majewski, Marek Vasut, Michal Simek, Neil Armstrong,
	Oleksandr Suvorov, Sean Anderson, Svyatoslav Ryhel, Tom Rini,
	uboot-stm32



On 1/15/24 18:02, Igor Opaniuk wrote:
> On Mon, Jan 15, 2024 at 3:08 PM Patrick Delaunay
> <patrick.delaunay@foss.st.com> wrote:
>>
>> CONFIG options must not use lower-case letter. Convert this and related
>> ones to upper case.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>> See Simon's patch in serie "Clean up of bad Kconfig options" never merged
>> https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
>> https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-68-sjg@chromium.org/
>>
>> Changes in v2:
>> - add "arm: Rename STM32MP13x"
>>
>>  arch/arm/dts/Makefile                           |  2 +-
>>  arch/arm/mach-stm32mp/Kconfig                   |  4 ++--
>>  arch/arm/mach-stm32mp/Kconfig.13x               |  4 ++--
>>  arch/arm/mach-stm32mp/Makefile                  |  2 +-
>>  arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
>>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  2 +-
>>  arch/arm/mach-stm32mp/include/mach/stm32.h      |  8 ++++----
>>  arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
>>  arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  4 ++--
>>  board/st/common/Kconfig                         |  2 +-
>>  board/st/stm32mp1/Kconfig                       |  2 +-
>>  configs/stm32mp13_defconfig                     |  4 ++--
>>  drivers/clk/stm32/Kconfig                       |  2 +-
>>  13 files changed, 24 insertions(+), 24 deletions(-)
>>
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 773c2546131c..8dcf1f5717ce 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -1360,7 +1360,7 @@ dtb-$(CONFIG_ASPEED_AST2600) += ast2600-evb.dtb
>>
>>  dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
>>
>> -dtb-$(CONFIG_STM32MP13x) += \
>> +dtb-$(CONFIG_STM32MP13X) += \
>>         stm32mp135f-dk.dtb
>>
>>  dtb-$(CONFIG_STM32MP15x) += \
>> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
>> index 5fc92d07fe6d..241fcf3e0d22 100644
>> --- a/arch/arm/mach-stm32mp/Kconfig
>> +++ b/arch/arm/mach-stm32mp/Kconfig
>> @@ -37,7 +37,7 @@ choice
>>         prompt "Select STMicroelectronics STM32MPxxx Soc"
>>         default STM32MP15x
>>
>> -config STM32MP13x
>> +config STM32MP13X
>>         bool "Support STMicroelectronics STM32MP13x Soc"
>>         select ARM_SMCCC
>>         select CPU_V7A
>> @@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
>>
>>  config STM32_ETZPC
>>         bool "STM32 Extended TrustZone Protection"
>> -       depends on STM32MP15x || STM32MP13x
>> +       depends on STM32MP15x || STM32MP13X
>>         default y
>>         imply BOOTP_SERVERIP
>>         help
>> diff --git a/arch/arm/mach-stm32mp/Kconfig.13x b/arch/arm/mach-stm32mp/Kconfig.13x
>> index acc02a5a1872..4d74b35055b8 100644
>> --- a/arch/arm/mach-stm32mp/Kconfig.13x
>> +++ b/arch/arm/mach-stm32mp/Kconfig.13x
>> @@ -1,10 +1,10 @@
>> -if STM32MP13x
>> +if STM32MP13X
>>
>>  choice
>>         prompt "STM32MP13x board select"
>>         optional
>>
>> -config TARGET_ST_STM32MP13x
>> +config TARGET_ST_STM32MP13X
>>         bool "STMicroelectronics STM32MP13x boards"
>>         imply BOOTSTAGE
>>         imply CMD_BOOTSTAGE
>> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
>> index fdcbbf91dfd5..3d194de0631c 100644
>> --- a/arch/arm/mach-stm32mp/Makefile
>> +++ b/arch/arm/mach-stm32mp/Makefile
>> @@ -9,7 +9,7 @@ obj-y += bsec.o
>>  obj-y += soc.o
>>
>>  obj-$(CONFIG_STM32MP15x) += stm32mp1/
>> -obj-$(CONFIG_STM32MP13x) += stm32mp1/
>> +obj-$(CONFIG_STM32MP13X) += stm32mp1/
>>  obj-$(CONFIG_STM32MP25X) += stm32mp2/
>>
>>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
>> diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
>> index e16fcf4424dc..dcef6ac4fb82 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32key.c
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
>> @@ -19,7 +19,7 @@
>>   * STM32MP13x: 0b111111 = 0x3F for OTP_SECURED closed device
>>   */
>>  #define STM32_OTP_CLOSE_ID             0
>> -#define STM32_OTP_STM32MP13x_CLOSE_MASK        0x3F
>> +#define STM32_OTP_STM32MP13X_CLOSE_MASK        0x3F
>>  #define STM32_OTP_STM32MP15x_CLOSE_MASK        BIT(6)
>>
>>  /* PKH is the first element of the key list */
>> @@ -61,7 +61,7 @@ static u8 stm32key_index;
>>
>>  static u8 get_key_nb(void)
>>  {
>> -       if (IS_ENABLED(CONFIG_STM32MP13x))
>> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>>                 return ARRAY_SIZE(stm32mp13_list);
>>
>>         if (IS_ENABLED(CONFIG_STM32MP15x))
>> @@ -70,7 +70,7 @@ static u8 get_key_nb(void)
>>
>>  static const struct stm32key *get_key(u8 index)
>>  {
>> -       if (IS_ENABLED(CONFIG_STM32MP13x))
>> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>>                 return &stm32mp13_list[index];
>>
>>         if (IS_ENABLED(CONFIG_STM32MP15x))
>> @@ -79,8 +79,8 @@ static const struct stm32key *get_key(u8 index)
>>
>>  static u32 get_otp_close_mask(void)
>>  {
>> -       if (IS_ENABLED(CONFIG_STM32MP13x))
>> -               return STM32_OTP_STM32MP13x_CLOSE_MASK;
>> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>> +               return STM32_OTP_STM32MP13X_CLOSE_MASK;
>>
>>         if (IS_ENABLED(CONFIG_STM32MP15x))
>>                 return STM32_OTP_STM32MP15x_CLOSE_MASK;
>> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> index eda98eb61d76..934ffb1105a0 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> @@ -30,7 +30,7 @@
>>  #endif
>>  /* size of the OTP struct in NVMEM PTA */
>>  #define _OTP_SIZE_TA(otp)      (((otp) * 2 + 2) * 4)
>> -#if defined(CONFIG_STM32MP13x) || defined(CONFIG_STM32MP15x)
>> +#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
>>  /* STM32MP1 with BSEC2 */
>>  #define OTP_SIZE_TA            _OTP_SIZE_TA(96)
>>  #else
>> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
>> index 726c390977e3..2d7d973368c1 100644
>> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
>> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
>> @@ -71,7 +71,7 @@ enum forced_boot_mode {
>>   * only address used before device tree parsing
>>   */
>>
>> -#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13x)
>> +#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
>>  #define STM32_RCC_BASE                 0x50000000
>>  #define STM32_PWR_BASE                 0x50001000
>>  #define STM32_SYSCFG_BASE              0x50020000
>> @@ -92,7 +92,7 @@ enum forced_boot_mode {
>>  #define STM32_USART1_BASE              0x5C000000
>>  #define STM32_USART2_BASE              0x4000E000
>>  #endif
>> -#ifdef CONFIG_STM32MP13x
>> +#ifdef CONFIG_STM32MP13X
>>  #define STM32_USART1_BASE              0x4c000000
>>  #define STM32_USART2_BASE              0x4c001000
>>  #endif
>> @@ -149,7 +149,7 @@ enum forced_boot_mode {
>>  #define TAMP_COPRO_STATE_CRASH         5
>>  #endif
>>
>> -#ifdef CONFIG_STM32MP13x
>> +#ifdef CONFIG_STM32MP13X
>>  #define TAMP_BOOTCOUNT                 TAMP_BACKUP_REGISTER(31)
>>  #define TAMP_BOOT_CONTEXT              TAMP_BACKUP_REGISTER(30)
>>  #endif
>> @@ -188,7 +188,7 @@ enum forced_boot_mode {
>>  #define BSEC_OTP_MAC   57
>>  #define BSEC_OTP_BOARD 59
>>  #endif
>> -#ifdef CONFIG_STM32MP13x
>> +#ifdef CONFIG_STM32MP13X
>>  #define BSEC_OTP_RPN   1
>>  #define BSEC_OTP_SERIAL        13
>>  #define BSEC_OTP_MAC   57
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> index 94c7724127e4..e74342d0c608 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> @@ -5,7 +5,7 @@
>>
>>  obj-y += cpu.o
>>
>> -obj-$(CONFIG_STM32MP13x) += stm32mp13x.o
>> +obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
>>  obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
>>
>>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> index de5c5a55ea0e..9436b872e31e 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> @@ -270,7 +270,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
>>         int offset, shift;
>>         u32 addr, status, decprot[ETZPC_DECPROT_NB];
>>
>> -       if (IS_ENABLED(CONFIG_STM32MP13x)) {
>> +       if (IS_ENABLED(CONFIG_STM32MP13X)) {
>>                 array = stm32mp13_ip_addr;
>>                 array_size = ARRAY_SIZE(stm32mp13_ip_addr);
>>         }
>> @@ -491,7 +491,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>>         cpu = get_cpu_type();
>>         get_soc_name(name);
>>
>> -       if (IS_ENABLED(CONFIG_STM32MP13x))
>> +       if (IS_ENABLED(CONFIG_STM32MP13X))
>>                 stm32mp13_fdt_fixup(blob, soc, cpu, name);
>>
>>         if (IS_ENABLED(CONFIG_STM32MP15x)) {
>> diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
>> index f40d1a78ca36..6d1b76ba43a8 100644
>> --- a/board/st/common/Kconfig
>> +++ b/board/st/common/Kconfig
>> @@ -1,7 +1,7 @@
>>  config CMD_STBOARD
>>         bool "stboard - command for OTP board information"
>>         depends on ARCH_STM32MP
>> -       default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13x
>> +       default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
>>         help
>>           This compile the stboard command to
>>           read and write the board in the OTP.
>> diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
>> index 6ab8f80fa45b..7d0d41bfea05 100644
>> --- a/board/st/stm32mp1/Kconfig
>> +++ b/board/st/stm32mp1/Kconfig
>> @@ -12,7 +12,7 @@ config SYS_CONFIG_NAME
>>  source "board/st/common/Kconfig"
>>  endif
>>
>> -if TARGET_ST_STM32MP13x
>> +if TARGET_ST_STM32MP13X
>>
>>  config SYS_BOARD
>>         default "stm32mp1"
>> diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig
>> index 2d79bf0eb050..c893e272db9b 100644
>> --- a/configs/stm32mp13_defconfig
>> +++ b/configs/stm32mp13_defconfig
>> @@ -5,10 +5,10 @@ CONFIG_SYS_MALLOC_F_LEN=0x180000
>>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc0400000
>>  CONFIG_ENV_OFFSET=0x900000
>>  CONFIG_DEFAULT_DEVICE_TREE="stm32mp135f-dk"
>> -CONFIG_STM32MP13x=y
>> +CONFIG_STM32MP13X=y
>>  CONFIG_DDR_CACHEABLE_SIZE=0x8000000
>>  CONFIG_CMD_STM32KEY=y
>> -CONFIG_TARGET_ST_STM32MP13x=y
>> +CONFIG_TARGET_ST_STM32MP13X=y
>>  CONFIG_ENV_OFFSET_REDUND=0x940000
>>  CONFIG_CMD_STM32PROG=y
>>  # CONFIG_ARMV7_NONSEC is not set
>> diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
>> index 7a34ea23c381..7dbddd032b89 100644
>> --- a/drivers/clk/stm32/Kconfig
>> +++ b/drivers/clk/stm32/Kconfig
>> @@ -31,7 +31,7 @@ config CLK_STM32MP1
>>  config CLK_STM32MP13
>>         bool "Enable RCC clock driver for STM32MP13"
>>         depends on ARCH_STM32MP && CLK
>> -       default y if STM32MP13x
>> +       default y if STM32MP13X
>>         select CLK_STM32_CORE
>>         help
>>           Enable the STM32 clock (RCC) driver. Enable support for
>> --
>> 2.25.1
>>
> 
> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> 
Applied to u-boot-stm32/master

Thanks
Patrice

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

* Re: [PATCH v2 14/14] arm: Rename STM32MP15x
  2024-01-15 17:40   ` Patrice CHOTARD
@ 2024-01-19 13:28     ` Patrice CHOTARD
  0 siblings, 0 replies; 33+ messages in thread
From: Patrice CHOTARD @ 2024-01-19 13:28 UTC (permalink / raw)
  To: u-boot



On 1/15/24 18:40, Patrice CHOTARD wrote:
> 
> 
> On 1/15/24 15:05, Patrick Delaunay wrote:
>> CONFIG options must not use lower-case letter. Convert this and related
>> ones to upper case.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>> See Simon's patch in serie "Clean up of bad Kconfig options" never merged
>> https://patchwork.ozlabs.org/project/uboot/list/?series=339004&state=*
>> https://patchwork.ozlabs.org/project/uboot/patch/20230129005903.74918-69-sjg@chromium.org/
>>
>> Changes in v2:
>> - add "arm: Rename STM32MP15x"
>>
>>  arch/arm/dts/Makefile                           |  2 +-
>>  arch/arm/dts/stm32mp15-u-boot.dtsi              |  2 +-
>>  arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi        |  4 ++--
>>  arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi        |  4 ++--
>>  arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi        |  4 ++--
>>  arch/arm/mach-stm32mp/Kconfig                   |  6 +++---
>>  arch/arm/mach-stm32mp/Kconfig.15x               |  6 +++---
>>  arch/arm/mach-stm32mp/Makefile                  |  2 +-
>>  arch/arm/mach-stm32mp/cmd_stm32key.c            | 10 +++++-----
>>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  4 ++--
>>  arch/arm/mach-stm32mp/include/mach/stm32.h      | 12 ++++++------
>>  arch/arm/mach-stm32mp/stm32mp1/Makefile         |  2 +-
>>  arch/arm/mach-stm32mp/stm32mp1/fdt.c            |  6 +++---
>>  board/st/common/Kconfig                         |  2 +-
>>  board/st/stm32mp1/Kconfig                       |  2 +-
>>  board/st/stm32mp1/stm32mp1.c                    |  6 +++---
>>  configs/stm32mp15_basic_defconfig               |  2 +-
>>  configs/stm32mp15_defconfig                     |  2 +-
>>  configs/stm32mp15_trusted_defconfig             |  4 ++--
>>  drivers/clk/stm32/Kconfig                       |  2 +-
>>  20 files changed, 42 insertions(+), 42 deletions(-)
>>
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 8dcf1f5717ce..02074440b55d 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -1363,7 +1363,7 @@ dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
>>  dtb-$(CONFIG_STM32MP13X) += \
>>  	stm32mp135f-dk.dtb
>>  
>> -dtb-$(CONFIG_STM32MP15x) += \
>> +dtb-$(CONFIG_STM32MP15X) += \
>>  	stm32mp157a-dk1.dtb \
>>  	stm32mp157a-dk1-scmi.dtb \
>>  	stm32mp157a-icore-stm32mp1-ctouch2.dtb \
>> diff --git a/arch/arm/dts/stm32mp15-u-boot.dtsi b/arch/arm/dts/stm32mp15-u-boot.dtsi
>> index 573dd4d3ed56..fe56f05616a0 100644
>> --- a/arch/arm/dts/stm32mp15-u-boot.dtsi
>> +++ b/arch/arm/dts/stm32mp15-u-boot.dtsi
>> @@ -206,7 +206,7 @@
>>  	resets = <&rcc UART8_R>;
>>  };
>>  
>> -#if defined(CONFIG_STM32MP15x_STM32IMAGE)
>> +#if defined(CONFIG_STM32MP15X_STM32IMAGE)
>>  &binman {
>>  	u-boot-stm32 {
>>  		filename = "u-boot.stm32";
>> diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
>> index 2623cebf21a4..a16358266a2d 100644
>> --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
>> +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
>> @@ -22,13 +22,13 @@
>>  		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
>>  	};
>>  
>> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
>> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>>  	config {
>>  		u-boot,mmc-env-partition = "ssbl";
>>  	};
>>  #endif
>>  
>> -#ifdef CONFIG_STM32MP15x_STM32IMAGE
>> +#ifdef CONFIG_STM32MP15X_STM32IMAGE
>>  	/* only needed for boot with TF-A, witout FIP support */
>>  	firmware {
>>  		optee {
>> diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
>> index b8288273ddb5..ef91088aa375 100644
>> --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
>> +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
>> @@ -20,13 +20,13 @@
>>  		st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
>>  	};
>>  
>> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
>> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>>  	config {
>>  		u-boot,mmc-env-partition = "ssbl";
>>  	};
>>  #endif
>>  
>> -#ifdef CONFIG_STM32MP15x_STM32IMAGE
>> +#ifdef CONFIG_STM32MP15X_STM32IMAGE
>>  	/* only needed for boot with TF-A, witout FIP support */
>>  	firmware {
>>  		optee {
>> diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
>> index eb283cacd27d..139940bd5d47 100644
>> --- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
>> +++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
>> @@ -28,7 +28,7 @@
>>  		#address-cells = <1>;
>>  		#size-cells = <1>;
>>  
>> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
>> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>>  		partition@0 {
>>  			label = "fsbl1";
>>  			reg = <0x00000000 0x00040000>;
>> @@ -82,7 +82,7 @@
>>  				#address-cells = <1>;
>>  				#size-cells = <1>;
>>  
>> -#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
>> +#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
>>  				partition@0 {
>>  					label = "fsbl";
>>  					reg = <0x00000000 0x00200000>;
>> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
>> index 241fcf3e0d22..a1763ff19993 100644
>> --- a/arch/arm/mach-stm32mp/Kconfig
>> +++ b/arch/arm/mach-stm32mp/Kconfig
>> @@ -35,7 +35,7 @@ config ENV_SIZE
>>  
>>  choice
>>  	prompt "Select STMicroelectronics STM32MPxxx Soc"
>> -	default STM32MP15x
>> +	default STM32MP15X
>>  
>>  config STM32MP13X
>>  	bool "Support STMicroelectronics STM32MP13x Soc"
>> @@ -55,7 +55,7 @@ config STM32MP13X
>>  		support of STMicroelectronics SOC STM32MP13x family
>>  		STMicroelectronics MPU with core ARMv7
>>  
>> -config STM32MP15x
>> +config STM32MP15X
>>  	bool "Support STMicroelectronics STM32MP15x Soc"
>>  	select ARCH_SUPPORT_PSCI
>>  	select BINMAN
>> @@ -127,7 +127,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
>>  
>>  config STM32_ETZPC
>>  	bool "STM32 Extended TrustZone Protection"
>> -	depends on STM32MP15x || STM32MP13X
>> +	depends on STM32MP15X || STM32MP13X
>>  	default y
>>  	imply BOOTP_SERVERIP
>>  	help
>> diff --git a/arch/arm/mach-stm32mp/Kconfig.15x b/arch/arm/mach-stm32mp/Kconfig.15x
>> index 1d32f8bf3395..71c14eb4955f 100644
>> --- a/arch/arm/mach-stm32mp/Kconfig.15x
>> +++ b/arch/arm/mach-stm32mp/Kconfig.15x
>> @@ -1,6 +1,6 @@
>> -if STM32MP15x
>> +if STM32MP15X
>>  
>> -config STM32MP15x_STM32IMAGE
>> +config STM32MP15X_STM32IMAGE
>>  	bool "Support STM32 image for generated U-Boot image"
>>  	depends on TFABOOT
>>  	help
>> @@ -11,7 +11,7 @@ choice
>>  	prompt "STM32MP15x board select"
>>  	optional
>>  
>> -config TARGET_ST_STM32MP15x
>> +config TARGET_ST_STM32MP15X
>>  	bool "STMicroelectronics STM32MP15x boards"
>>  	imply BOOTSTAGE
>>  	imply CMD_BOOTSTAGE
>> diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
>> index 3d194de0631c..ee8a5428feba 100644
>> --- a/arch/arm/mach-stm32mp/Makefile
>> +++ b/arch/arm/mach-stm32mp/Makefile
>> @@ -8,7 +8,7 @@ obj-y += syscon.o
>>  obj-y += bsec.o
>>  obj-y += soc.o
>>  
>> -obj-$(CONFIG_STM32MP15x) += stm32mp1/
>> +obj-$(CONFIG_STM32MP15X) += stm32mp1/
>>  obj-$(CONFIG_STM32MP13X) += stm32mp1/
>>  obj-$(CONFIG_STM32MP25X) += stm32mp2/
>>  
>> diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
>> index dcef6ac4fb82..c7fe232f86e0 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32key.c
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
>> @@ -20,7 +20,7 @@
>>   */
>>  #define STM32_OTP_CLOSE_ID		0
>>  #define STM32_OTP_STM32MP13X_CLOSE_MASK	0x3F
>> -#define STM32_OTP_STM32MP15x_CLOSE_MASK	BIT(6)
>> +#define STM32_OTP_STM32MP15X_CLOSE_MASK	BIT(6)
>>  
>>  /* PKH is the first element of the key list */
>>  #define STM32KEY_PKH 0
>> @@ -64,7 +64,7 @@ static u8 get_key_nb(void)
>>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>>  		return ARRAY_SIZE(stm32mp13_list);
>>  
>> -	if (IS_ENABLED(CONFIG_STM32MP15x))
>> +	if (IS_ENABLED(CONFIG_STM32MP15X))
>>  		return ARRAY_SIZE(stm32mp15_list);
>>  }
>>  
>> @@ -73,7 +73,7 @@ static const struct stm32key *get_key(u8 index)
>>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>>  		return &stm32mp13_list[index];
>>  
>> -	if (IS_ENABLED(CONFIG_STM32MP15x))
>> +	if (IS_ENABLED(CONFIG_STM32MP15X))
>>  		return &stm32mp15_list[index];
>>  }
>>  
>> @@ -82,8 +82,8 @@ static u32 get_otp_close_mask(void)
>>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>>  		return STM32_OTP_STM32MP13X_CLOSE_MASK;
>>  
>> -	if (IS_ENABLED(CONFIG_STM32MP15x))
>> -		return STM32_OTP_STM32MP15x_CLOSE_MASK;
>> +	if (IS_ENABLED(CONFIG_STM32MP15X))
>> +		return STM32_OTP_STM32MP15X_CLOSE_MASK;
>>  }
>>  
>>  static int get_misc_dev(struct udevice **dev)
>> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> index 934ffb1105a0..bf184c8a8846 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
>> @@ -23,14 +23,14 @@
>>  
>>  #define CMD_SIZE		512
>>  /* SMC is only supported in SPMIN for STM32MP15x */
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define OTP_SIZE_SMC		1024
>>  #else
>>  #define OTP_SIZE_SMC		0
>>  #endif
>>  /* size of the OTP struct in NVMEM PTA */
>>  #define _OTP_SIZE_TA(otp)	(((otp) * 2 + 2) * 4)
>> -#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15x)
>> +#if defined(CONFIG_STM32MP13X) || defined(CONFIG_STM32MP15X)
>>  /* STM32MP1 with BSEC2 */
>>  #define OTP_SIZE_TA		_OTP_SIZE_TA(96)
>>  #else
>> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
>> index 2d7d973368c1..f598da99fbab 100644
>> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
>> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
>> @@ -71,11 +71,11 @@ enum forced_boot_mode {
>>   * only address used before device tree parsing
>>   */
>>  
>> -#if defined(CONFIG_STM32MP15x) || defined(CONFIG_STM32MP13X)
>> +#if defined(CONFIG_STM32MP15X) || defined(CONFIG_STM32MP13X)
>>  #define STM32_RCC_BASE			0x50000000
>>  #define STM32_PWR_BASE			0x50001000
>>  #define STM32_SYSCFG_BASE		0x50020000
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define STM32_DBGMCU_BASE		0x50081000
>>  #endif
>>  #define STM32_FMC2_BASE			0x58002000
>> @@ -88,7 +88,7 @@ enum forced_boot_mode {
>>  #define STM32_STGEN_BASE		0x5C008000
>>  #define STM32_TAMP_BASE			0x5C00A000
>>  
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define STM32_USART1_BASE		0x5C000000
>>  #define STM32_USART2_BASE		0x4000E000
>>  #endif
>> @@ -107,7 +107,7 @@ enum forced_boot_mode {
>>  #define STM32_SDMMC2_BASE		0x58007000
>>  #define STM32_SDMMC3_BASE		0x48004000
>>  
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define STM32_SYSRAM_BASE		0x2FFC0000
>>  #define STM32_SYSRAM_SIZE		SZ_256K
>>  #endif
>> @@ -129,7 +129,7 @@ enum forced_boot_mode {
>>  /* TAMP registers */
>>  #define TAMP_BACKUP_REGISTER(x)		(STM32_TAMP_BASE + 0x100 + 4 * x)
>>  
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define TAMP_BACKUP_MAGIC_NUMBER	TAMP_BACKUP_REGISTER(4)
>>  #define TAMP_BACKUP_BRANCH_ADDRESS	TAMP_BACKUP_REGISTER(5)
>>  #define TAMP_FWU_BOOT_INFO_REG		TAMP_BACKUP_REGISTER(10)
>> @@ -181,7 +181,7 @@ enum forced_boot_mode {
>>  #define STM32_BSEC_LOCK(id)		(STM32_BSEC_LOCK_OFFSET + (id) * 4)
>>  
>>  /* BSEC OTP index */
>> -#ifdef CONFIG_STM32MP15x
>> +#ifdef CONFIG_STM32MP15X
>>  #define BSEC_OTP_RPN	1
>>  #define BSEC_OTP_SERIAL	13
>>  #define BSEC_OTP_PKG	16
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/Makefile b/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> index e74342d0c608..857148747ef7 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/Makefile
>> @@ -6,7 +6,7 @@
>>  obj-y += cpu.o
>>  
>>  obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
>> -obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
>> +obj-$(CONFIG_STM32MP15X) += stm32mp15x.o
>>  
>>  obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
>>  ifdef CONFIG_SPL_BUILD
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/fdt.c b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> index 9436b872e31e..d0b6c3cc5a55 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/fdt.c
>> @@ -275,7 +275,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
>>  		array_size = ARRAY_SIZE(stm32mp13_ip_addr);
>>  	}
>>  
>> -	if (IS_ENABLED(CONFIG_STM32MP15x)) {
>> +	if (IS_ENABLED(CONFIG_STM32MP15X)) {
>>  		array = stm32mp15_ip_addr;
>>  		array_size = ARRAY_SIZE(stm32mp15_ip_addr);
>>  	}
>> @@ -494,7 +494,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>>  	if (IS_ENABLED(CONFIG_STM32MP13X))
>>  		stm32mp13_fdt_fixup(blob, soc, cpu, name);
>>  
>> -	if (IS_ENABLED(CONFIG_STM32MP15x)) {
>> +	if (IS_ENABLED(CONFIG_STM32MP15X)) {
>>  		stm32mp15_fdt_fixup(blob, soc, cpu, name);
>>  
>>  		/*
>> @@ -505,7 +505,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
>>  		 * under CONFIG_STM32MP15x_STM32IMAGE only for compatibility
>>  		 * when FIP is not used by TF-A
>>  		 */
>> -		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE) &&
>> +		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE) &&
>>  		    !tee_find_device(NULL, NULL, NULL, NULL))
>>  			stm32_fdt_disable_optee(blob);
>>  	}
>> diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
>> index 6d1b76ba43a8..5efac658cf4d 100644
>> --- a/board/st/common/Kconfig
>> +++ b/board/st/common/Kconfig
>> @@ -1,7 +1,7 @@
>>  config CMD_STBOARD
>>  	bool "stboard - command for OTP board information"
>>  	depends on ARCH_STM32MP
>> -	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15x || TARGET_ST_STM32MP13X
>> +	default y if TARGET_ST_STM32MP25X || TARGET_ST_STM32MP15X || TARGET_ST_STM32MP13X
>>  	help
>>  	  This compile the stboard command to
>>  	  read and write the board in the OTP.
>> diff --git a/board/st/stm32mp1/Kconfig b/board/st/stm32mp1/Kconfig
>> index 7d0d41bfea05..96de41546f1d 100644
>> --- a/board/st/stm32mp1/Kconfig
>> +++ b/board/st/stm32mp1/Kconfig
>> @@ -1,4 +1,4 @@
>> -if TARGET_ST_STM32MP15x
>> +if TARGET_ST_STM32MP15X
>>  
>>  config SYS_BOARD
>>  	default "stm32mp1"
>> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
>> index 8f5719c28b33..a17c314daeb8 100644
>> --- a/board/st/stm32mp1/stm32mp1.c
>> +++ b/board/st/stm32mp1/stm32mp1.c
>> @@ -114,7 +114,7 @@ int checkboard(void)
>>  	int fdt_compat_len;
>>  
>>  	if (IS_ENABLED(CONFIG_TFABOOT)) {
>> -		if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE))
>> +		if (IS_ENABLED(CONFIG_STM32MP15X_STM32IMAGE))
>>  			mode = "trusted - stm32image";
>>  		else
>>  			mode = "trusted";
>> @@ -616,7 +616,7 @@ error:
>>  
>>  static bool board_is_stm32mp15x_dk2(void)
>>  {
>> -	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
>> +	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
>>  	    of_machine_is_compatible("st,stm32mp157c-dk2"))
>>  		return true;
>>  
>> @@ -625,7 +625,7 @@ static bool board_is_stm32mp15x_dk2(void)
>>  
>>  static bool board_is_stm32mp15x_ev1(void)
>>  {
>> -	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
>> +	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15X) &&
>>  	    (of_machine_is_compatible("st,stm32mp157a-ev1") ||
>>  	     of_machine_is_compatible("st,stm32mp157c-ev1") ||
>>  	     of_machine_is_compatible("st,stm32mp157d-ev1") ||
>> diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
>> index 3032d83b992e..005f1d55f80e 100644
>> --- a/configs/stm32mp15_basic_defconfig
>> +++ b/configs/stm32mp15_basic_defconfig
>> @@ -13,7 +13,7 @@ CONFIG_SPL_STACK=0x30000000
>>  CONFIG_SPL=y
>>  CONFIG_CMD_STM32KEY=y
>>  CONFIG_TYPEC_STUSB160X=y
>> -CONFIG_TARGET_ST_STM32MP15x=y
>> +CONFIG_TARGET_ST_STM32MP15X=y
>>  CONFIG_ENV_OFFSET_REDUND=0x2C0000
>>  CONFIG_CMD_STM32PROG=y
>>  CONFIG_SPL_SPI_FLASH_SUPPORT=y
>> diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig
>> index 4aff6398846f..3302b3069965 100644
>> --- a/configs/stm32mp15_defconfig
>> +++ b/configs/stm32mp15_defconfig
>> @@ -9,7 +9,7 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
>>  CONFIG_DDR_CACHEABLE_SIZE=0x8000000
>>  CONFIG_CMD_STM32KEY=y
>>  CONFIG_TYPEC_STUSB160X=y
>> -CONFIG_TARGET_ST_STM32MP15x=y
>> +CONFIG_TARGET_ST_STM32MP15X=y
>>  CONFIG_ENV_OFFSET_REDUND=0x940000
>>  CONFIG_CMD_STM32PROG=y
>>  # CONFIG_ARMV7_NONSEC is not set
>> diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
>> index ec32f1ea0f2c..84b0854b5573 100644
>> --- a/configs/stm32mp15_trusted_defconfig
>> +++ b/configs/stm32mp15_trusted_defconfig
>> @@ -9,8 +9,8 @@ CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
>>  CONFIG_DDR_CACHEABLE_SIZE=0x10000000
>>  CONFIG_CMD_STM32KEY=y
>>  CONFIG_TYPEC_STUSB160X=y
>> -CONFIG_STM32MP15x_STM32IMAGE=y
>> -CONFIG_TARGET_ST_STM32MP15x=y
>> +CONFIG_STM32MP15X_STM32IMAGE=y
>> +CONFIG_TARGET_ST_STM32MP15X=y
>>  CONFIG_ENV_OFFSET_REDUND=0x2C0000
>>  CONFIG_CMD_STM32PROG=y
>>  # CONFIG_ARMV7_NONSEC is not set
>> diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
>> index 7dbddd032b89..c05015efe8b4 100644
>> --- a/drivers/clk/stm32/Kconfig
>> +++ b/drivers/clk/stm32/Kconfig
>> @@ -23,7 +23,7 @@ config CLK_STM32_CORE
>>  config CLK_STM32MP1
>>  	bool "Enable RCC clock driver for STM32MP15"
>>  	depends on ARCH_STM32MP && CLK
>> -	default y if STM32MP15x
>> +	default y if STM32MP15X
>>  	help
>>  	  Enable the STM32 clock (RCC) driver. Enable support for
>>  	  manipulating STM32MP15's on-SoC clocks.
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 
> Thanks
> Patrice
Applied to u-boot-stm32/master

Thanks
Patrice

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

end of thread, other threads:[~2024-01-19 13:28 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 14:05 [PATCH v2 00/14] stm32: add bsec and OTP support to stm32mp25 Patrick Delaunay
2024-01-15 14:05 ` [PATCH v2 01/14] arm64: dts: st: add bsec " Patrick Delaunay
2024-01-19 13:22   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 02/14] arm: stm32mp: add Rev.B support for STM32MP25 Patrick Delaunay
2024-01-19 13:24   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 03/14] stm32mp: bsec: add driver data Patrick Delaunay
2024-01-19 13:24   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 04/14] stm32mp: bsec: add support of stm32mp25 Patrick Delaunay
2024-01-19 13:24   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 05/14] configs: stm32mp25: add support of fuse command Patrick Delaunay
2024-01-19 13:25   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 06/14] stm32mp: add soc.c file Patrick Delaunay
2024-01-15 16:26   ` Igor Opaniuk
2024-01-19 13:25     ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 07/14] stm32mp: add setup_serial_number for stm32mp25 Patrick Delaunay
2024-01-15 16:23   ` Igor Opaniuk
2024-01-19 13:25     ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 08/14] smt32mp: add setup_mac_address " Patrick Delaunay
2024-01-19 13:26   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 09/14] stm32mp: stm32prog: add support of stm32mp25 Patrick Delaunay
2024-01-15 17:41   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 10/14] stm32mp: activate the command stboard for stm32mp25 boards Patrick Delaunay
2024-01-15 17:42   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 11/14] board: st: stm32mp2: add checkboard Patrick Delaunay
2024-01-19 13:27   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 12/14] board: st: stm32mp2: display the board identification Patrick Delaunay
2024-01-19 13:27   ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 13/14] arm: Rename STM32MP13x Patrick Delaunay
2024-01-15 17:02   ` Igor Opaniuk
2024-01-19 13:28     ` Patrice CHOTARD
2024-01-15 14:05 ` [PATCH v2 14/14] arm: Rename STM32MP15x Patrick Delaunay
2024-01-15 17:40   ` Patrice CHOTARD
2024-01-19 13:28     ` Patrice CHOTARD

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.