Skip to contentSkip to conversation

ARM: stm32: Permit multiple board targets

PATCH New Marek Vasut 2 participants 6 messages Dec 18, 2019 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD, SYS_VENDOR and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 . Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig +5 -5
index 4fa2360b4f..c84aa41f06 100644
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery Board"
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery Board"
-	default y
-
 endif
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

Hi Marek,

Quoted 40 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:59

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD, SYS_VENDOR and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 .
Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig index renamed from board/st/stm32mp1/Kconfig +0 -0

4fa2360b4f..c84aa41f06 100644

board/st/stm32mp1/Kconfig +2 -1
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig +3 -2
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig config CMD_STBOARD · line 27

Quoted 1 line
board/st/stm32mp1/Kconfig +0 -1
-	default y

I try to understood the issue but checked DK2 is not enought (I will soon introduce a new config for EV1 support)

What it the use case ?

Add a new board (not a board provided by ST) which are managed by a new directory
board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>

I think, if it is the case, we should test CONFIG_SYS_VENDOR = "stm32mp1" in board/st/stm32mp1/Kconfig

And move CONFIG_SYS_VENDOR to arch

NB: default value can be overidde in your board defconfig...

Normally:
- stm32mp1_trusted_defconfig
- stm32mp1_basic_defconfig
- stm32mp1_optee_defconfig

only support the directory ST board with board/st/stm32mp1

Quoted 3 lines

endif
--
2.24.1

Patrick

#2 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

Hi Marek,

Quoted 63 lines

From: Patrick DELAUNAY
Sent: mercredi 18 décembre 2019 14:20

Hi Marek,

Quoted 4 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:59

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD,

SYS_VENDOR

Quoted 37 lines

and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 .
Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig +0 -0

index
4fa2360b4f..c84aa41f06 100644

board/st/stm32mp1/Kconfig +2 -1
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig +3 -2
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig config CMD_STBOARD · line 27

Quoted 1 line
board/st/stm32mp1/Kconfig +0 -1
-	default y

I try to understood the issue but checked DK2 is not enought (I will soon introduce a new config for EV1 support)

What it the use case ?

Add a new board (not a board provided by ST) which are managed by a new directory
board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>

I think, if it is the case, we should test CONFIG_SYS_VENDOR = "stm32mp1" in board/st/stm32mp1/Kconfig

And move CONFIG_SYS_VENDOR to arch

Quoted 8 lines

NB: default value can be overidde in your board defconfig...

Normally:
- stm32mp1_trusted_defconfig
- stm32mp1_basic_defconfig
- stm32mp1_optee_defconfig

only support the directory ST board with board/st/stm32mp1

After deeper check => it is already managed by the config

CONFIG_TARGET_STM32MP1

board/st/stm32mp1.Kconfig

dtb-$(CONFIG_TARGET_STM32MP1) += \
	stm32mp157a-dk1.dtb \
	stm32mp157a-avenger96.dtb \
	stm32mp157c-dk2.dtb \
	stm32mp157c-ed1.dtb \
	stm32mp157c-ev1.dtb

Activated by default in the ST defconfig (stm32mp1_trusted_defconfig, stm32mp1_basic_defconfig, stm32mp1_optee_defconfig)

Do you need other way of configuration ?

Patrick

#3 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

Quoted 87 lines · Patrick DELAUNAY

Hi Marek,

Quoted 63 lines

From: Patrick DELAUNAY
Sent: mercredi 18 décembre 2019 14:20

Hi Marek,

Quoted 4 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:59

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD,

SYS_VENDOR

Quoted 37 lines

and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 .
Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig +0 -0

index
4fa2360b4f..c84aa41f06 100644

board/st/stm32mp1/Kconfig +2 -1
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig +3 -2
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig config CMD_STBOARD · line 27

Quoted 1 line
board/st/stm32mp1/Kconfig +0 -1
-	default y

I try to understood the issue but checked DK2 is not enought (I will soon introduce a new config for EV1 support)

What it the use case ?

Add a new board (not a board provided by ST) which are managed by a new directory
board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>

I think, if it is the case, we should test CONFIG_SYS_VENDOR = "stm32mp1" in board/st/stm32mp1/Kconfig

And move CONFIG_SYS_VENDOR to arch

Quoted 8 lines

NB: default value can be overidde in your board defconfig...

Normally:
- stm32mp1_trusted_defconfig
- stm32mp1_basic_defconfig
- stm32mp1_optee_defconfig

only support the directory ST board with board/st/stm32mp1

After deeper check => it is already managed by the config

CONFIG_TARGET_STM32MP1

board/st/stm32mp1.Kconfig

dtb-$(CONFIG_TARGET_STM32MP1) += \
	stm32mp157a-dk1.dtb \
	stm32mp157a-avenger96.dtb \
	stm32mp157c-dk2.dtb \
	stm32mp157c-ed1.dtb \
	stm32mp157c-ev1.dtb
Quoted 3 lines

Activated by default in the ST defconfig (stm32mp1_trusted_defconfig, stm32mp1_basic_defconfig, stm32mp1_optee_defconfig)

Do you need other way of configuration ?

Yes, I need to override the configuration which is currently forced by the ST Kconfig file. Hence this patch.

I can repost this patch with the board patch once that's ready. It might make it easier to understand the purpose.

#4 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

Hi,

Quoted 94 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 15:15

Quoted 90 lines · Patrick DELAUNAY

Hi Marek,

Quoted 63 lines

From: Patrick DELAUNAY
Sent: mercredi 18 décembre 2019 14:20

Hi Marek,

Quoted 4 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:59

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD,

SYS_VENDOR

Quoted 37 lines

and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 .
Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig +0 -0

index
4fa2360b4f..c84aa41f06 100644

board/st/stm32mp1/Kconfig +2 -1
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig +3 -2
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig config CMD_STBOARD · line 27

Quoted 1 line
board/st/stm32mp1/Kconfig +0 -1
-	default y

I try to understood the issue but checked DK2 is not enought (I will soon introduce a new config for EV1 support)

What it the use case ?

Add a new board (not a board provided by ST) which are managed by a new directory
board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>

I think, if it is the case, we should test CONFIG_SYS_VENDOR = "stm32mp1" in board/st/stm32mp1/Kconfig

And move CONFIG_SYS_VENDOR to arch

Quoted 8 lines

NB: default value can be overidde in your board defconfig...

Normally:
- stm32mp1_trusted_defconfig
- stm32mp1_basic_defconfig
- stm32mp1_optee_defconfig

only support the directory ST board with board/st/stm32mp1

After deeper check => it is already managed by the config

CONFIG_TARGET_STM32MP1

board/st/stm32mp1.Kconfig

dtb-$(CONFIG_TARGET_STM32MP1) += \
	stm32mp157a-dk1.dtb \
	stm32mp157a-avenger96.dtb \
	stm32mp157c-dk2.dtb \
	stm32mp157c-ed1.dtb \
	stm32mp157c-ev1.dtb

Activated by default in the ST defconfig (stm32mp1_trusted_defconfig, stm32mp1_basic_defconfig, stm32mp1_optee_defconfig)

Quoted 7 lines
Quoted 1 line

Do you need other way of configuration ?

Yes, I need to override the configuration which is currently forced by the ST Kconfig file. Hence this patch.

I can repost this patch with the board patch once that's ready. It might make it easier to understand the purpose.

Yes thanks.

I am waiting your patchset..

Anyway it is not yet clear for me how manage customer board...

I perhaps need to have a common directory (board/st/common) to share code between ST board and customer board (as it is done by other arch)

I expect it will be the same than imx or rockwell board

one board (or one family) => one defconfig

for all ST board (EV1 DK1 DK2) => CONFIG_TARGET_STM32MP1 for custom board CUST0 => CONFIG_TARGET_CUST0

with Kconfig

if TARGET_STM32MP1

config SYS_BOARD

	default "stm32mp1"

config SYS_VENDOR
default "st"

config SYS_CONFIG_NAME

	default "stm32mp1"

<....>

endif

if TARGET_CUST0

config SYS_BOARD
default "cust0"

config SYS_VENDOR
default "customer"

config SYS_CONFIG_NAME
default "cust0"

endif

Regards Patrick

#5 lore raw

PATCH 1/1 ARM: stm32: Permit multiple board targets

In reply to Patrick DELAUNAY
Quoted 1 line · Patrick DELAUNAY

Hi Marek,

Hi,

Quoted 45 lines
Quoted 40 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:59

Setting TARGET_STM32MP1 in Kconfig always forces SYS_BOARD, SYS_VENDOR and SYS_CONFIG_NAME to values set by the ST reference platforms. Allow changing that by pulling out the TARGET_STM32MP157C_DK2 and making the ST reference platform settings conditional on TARGET_STM32MP157C_DK2 .
Other platforms can now define a different TARGET_ and thus override the SYS_ settings in their Kconfig.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 board/st/stm32mp1/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/st/stm32mp1/Kconfig index renamed from board/st/stm32mp1/Kconfig +0 -0

4fa2360b4f..c84aa41f06 100644

board/st/stm32mp1/Kconfig +2 -1
@@ -1,4 +1,8 @@
-if TARGET_STM32MP1
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig +3 -2
+	default y
+
+if TARGET_STM32MP157C_DK2
 
 config SYS_BOARD
 	default "stm32mp1"
@@ -22,8 +26,4 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
-config TARGET_STM32MP157C_DK2
-	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery

Board"

board/st/stm32mp1/Kconfig config CMD_STBOARD · line 27

Quoted 1 line
board/st/stm32mp1/Kconfig +0 -1
-	default y

I try to understood the issue but checked DK2 is not enought (I will soon introduce a new config for EV1 support)

Quoted 1 line

What it the use case ?

Custom board.

Quoted 7 lines

Add a new board (not a board provided by ST) which are managed by a new directory
board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>

I think, if it is the case, we should test CONFIG_SYS_VENDOR = "stm32mp1" in board/st/stm32mp1/Kconfig

And move CONFIG_SYS_VENDOR to arch

Nope, SYS_VENDOR is the board manufacturer . For you it's ST, for me it's "thus far undisclosed custom board vendor".

Quoted 8 lines

NB: default value can be overidde in your board defconfig...

Normally:
- stm32mp1_trusted_defconfig
- stm32mp1_basic_defconfig
- stm32mp1_optee_defconfig

only support the directory ST board with board/st/stm32mp1

That's not how it's supposed to work -- these values should be defaulted in Kconfig.