[PATCH 1/7] board: ti: Add dependency from TARGET selection to SOC

Currently the K3 selection for TARGET boards does not depend on the SoC for which it is based. This leds to the odd ability to select for instance both SOC_K3_AM625 and TARGET_J721E_A72_EVM.
To fix this the target choice should depend on the matching SOC config.
Signed-off-by: Andrew Davis afd@ti.com --- board/siemens/iot2050/Kconfig | 2 +- board/ti/am62ax/Kconfig | 1 + board/ti/am62x/Kconfig | 1 + board/ti/am64x/Kconfig | 1 + board/ti/am65x/Kconfig | 1 + board/ti/j721e/Kconfig | 1 + board/ti/j721s2/Kconfig | 1 + board/toradex/verdin-am62/Kconfig | 1 + 8 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/board/siemens/iot2050/Kconfig b/board/siemens/iot2050/Kconfig index a6170aae807..737cda64744 100644 --- a/board/siemens/iot2050/Kconfig +++ b/board/siemens/iot2050/Kconfig @@ -8,8 +8,8 @@
config TARGET_IOT2050_A53 bool "IOT2050 running on A53" + depends on SOC_K3_AM654 select ARM64 - select SOC_K3_AM654 select BOARD_LATE_INIT select SYS_DISABLE_DCACHE_OPS select BINMAN diff --git a/board/ti/am62ax/Kconfig b/board/ti/am62ax/Kconfig index 61f289faccd..30e1a068660 100644 --- a/board/ti/am62ax/Kconfig +++ b/board/ti/am62ax/Kconfig @@ -5,6 +5,7 @@
choice prompt "TI K3 AM62Ax based boards" + depends on SOC_K3_AM62A7 optional
config TARGET_AM62A7_A53_EVM diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index cd17e939e5a..b4b70337d18 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -5,6 +5,7 @@
choice prompt "TI K3 AM62x based boards" + depends on SOC_K3_AM625 optional
config TARGET_AM625_A53_EVM diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig index fb596e4adfc..2dbc6197b75 100644 --- a/board/ti/am64x/Kconfig +++ b/board/ti/am64x/Kconfig @@ -4,6 +4,7 @@
choice prompt "K3 AM64 based boards" + depends on SOC_K3_AM642 optional
config TARGET_AM642_A53_EVM diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig index 5fd19d652a6..7c1bcfc899c 100644 --- a/board/ti/am65x/Kconfig +++ b/board/ti/am65x/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 AM65 based boards" + depends on SOC_K3_AM654 optional
config TARGET_AM654_A53_EVM diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig index e6cb21f77bd..23867ad8e04 100644 --- a/board/ti/j721e/Kconfig +++ b/board/ti/j721e/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 J721E based boards" + depends on SOC_K3_J721E optional
config TARGET_J721E_A72_EVM diff --git a/board/ti/j721s2/Kconfig b/board/ti/j721s2/Kconfig index f6d1cb57653..a4a5d16ba21 100644 --- a/board/ti/j721s2/Kconfig +++ b/board/ti/j721s2/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 J721S2 board" + depends on SOC_K3_J721S2 optional
config TARGET_J721S2_A72_EVM diff --git a/board/toradex/verdin-am62/Kconfig b/board/toradex/verdin-am62/Kconfig index e7522244070..abc2984f250 100644 --- a/board/toradex/verdin-am62/Kconfig +++ b/board/toradex/verdin-am62/Kconfig @@ -5,6 +5,7 @@
choice prompt "Toradex Verdin AM62 based boards" + depends on SOC_K3_AM625 optional
config TARGET_VERDIN_AM62_A53

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 2 +- arch/arm/mach-k3/j721e/Kconfig | 56 ++++++++++++++++++++++++++++++++++ board/ti/j721e/Kconfig | 47 ---------------------------- 3 files changed, 57 insertions(+), 48 deletions(-) create mode 100644 arch/arm/mach-k3/j721e/Kconfig
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index 9168bf842dc..d5fdabe4293 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -191,7 +191,7 @@ source "board/ti/am65x/Kconfig" source "board/ti/am64x/Kconfig" source "board/ti/am62x/Kconfig" source "board/ti/am62ax/Kconfig" -source "board/ti/j721e/Kconfig" +source "arch/arm/mach-k3/j721e/Kconfig" source "board/siemens/iot2050/Kconfig" source "board/ti/j721s2/Kconfig" source "board/toradex/verdin-am62/Kconfig" diff --git a/arch/arm/mach-k3/j721e/Kconfig b/arch/arm/mach-k3/j721e/Kconfig new file mode 100644 index 00000000000..07cdb5cb517 --- /dev/null +++ b/arch/arm/mach-k3/j721e/Kconfig @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_J721E + +choice + prompt "K3 J721E based boards" + optional + +config TARGET_J721E_A72_EVM + bool "TI K3 based J721E EVM running on A72" + select ARM64 + select BOARD_LATE_INIT + imply TI_I2C_BOARD_DETECT + select SYS_DISABLE_DCACHE_OPS + select BINMAN + +config TARGET_J721E_R5_EVM + bool "TI K3 based J721E EVM running on R5" + select CPU_V7R + select SYS_THUMB_BUILD + select K3_LOAD_SYSFW + select RAM + select SPL_RAM + select K3_DDRSS + select BINMAN + imply SYS_K3_SPL_ATF + imply TI_I2C_BOARD_DETECT + +config TARGET_J7200_A72_EVM + bool "TI K3 based J7200 EVM running on A72" + select ARM64 + select BOARD_LATE_INIT + imply TI_I2C_BOARD_DETECT + select SYS_DISABLE_DCACHE_OPS + select BINMAN + +config TARGET_J7200_R5_EVM + bool "TI K3 based J7200 EVM running on R5" + select CPU_V7R + select SYS_THUMB_BUILD + select K3_LOAD_SYSFW + select RAM + select SPL_RAM + select K3_DDRSS + select BINMAN + imply SYS_K3_SPL_ATF + imply TI_I2C_BOARD_DETECT + +endchoice + +source "board/ti/j721e/Kconfig" + +endif diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig index 23867ad8e04..c18ba5a2745 100644 --- a/board/ti/j721e/Kconfig +++ b/board/ti/j721e/Kconfig @@ -3,53 +3,6 @@ # Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/ # Lokesh Vutla lokeshvutla@ti.com
-choice - prompt "K3 J721E based boards" - depends on SOC_K3_J721E - optional - -config TARGET_J721E_A72_EVM - bool "TI K3 based J721E EVM running on A72" - select ARM64 - select BOARD_LATE_INIT - imply TI_I2C_BOARD_DETECT - select SYS_DISABLE_DCACHE_OPS - select BINMAN - -config TARGET_J721E_R5_EVM - bool "TI K3 based J721E EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -config TARGET_J7200_A72_EVM - bool "TI K3 based J7200 EVM running on A72" - select ARM64 - select BOARD_LATE_INIT - imply TI_I2C_BOARD_DETECT - select SYS_DISABLE_DCACHE_OPS - select BINMAN - -config TARGET_J7200_R5_EVM - bool "TI K3 based J7200 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -endchoice - if TARGET_J721E_A72_EVM
config SYS_BOARD

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 3 +- {board/ti => arch/arm/mach-k3}/am65x/Kconfig | 46 +++++++------------- board/siemens/iot2050/Kconfig | 10 ----- board/ti/am65x/Kconfig | 25 ----------- 4 files changed, 17 insertions(+), 67 deletions(-) copy {board/ti => arch/arm/mach-k3}/am65x/Kconfig (52%)
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index d5fdabe4293..01889e9d7cf 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -187,12 +187,11 @@ config K3_X509_SWRV help SWRV for X509 certificate used for boot images
-source "board/ti/am65x/Kconfig" +source "arch/arm/mach-k3/am65x/Kconfig" source "board/ti/am64x/Kconfig" source "board/ti/am62x/Kconfig" source "board/ti/am62ax/Kconfig" source "arch/arm/mach-k3/j721e/Kconfig" -source "board/siemens/iot2050/Kconfig" source "board/ti/j721s2/Kconfig" source "board/toradex/verdin-am62/Kconfig" endif diff --git a/board/ti/am65x/Kconfig b/arch/arm/mach-k3/am65x/Kconfig similarity index 52% copy from board/ti/am65x/Kconfig copy to arch/arm/mach-k3/am65x/Kconfig index 7c1bcfc899c..f17b641e136 100644 --- a/board/ti/am65x/Kconfig +++ b/arch/arm/mach-k3/am65x/Kconfig @@ -1,11 +1,12 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ -# Lokesh Vutla lokeshvutla@ti.com +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_AM654
choice prompt "K3 AM65 based boards" - depends on SOC_K3_AM654 optional
config TARGET_AM654_A53_EVM @@ -26,34 +27,19 @@ config TARGET_AM654_R5_EVM imply SYS_K3_SPL_ATF imply TI_I2C_BOARD_DETECT
-endchoice - -if TARGET_AM654_A53_EVM - -config SYS_BOARD - default "am65x" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "am65x_evm" - -source "board/ti/common/Kconfig" - -endif - -if TARGET_AM654_R5_EVM - -config SYS_BOARD - default "am65x" - -config SYS_VENDOR - default "ti" +config TARGET_IOT2050_A53 + bool "IOT2050 running on A53" + depends on SOC_K3_AM654 + select ARM64 + select BOARD_LATE_INIT + select SYS_DISABLE_DCACHE_OPS + select BINMAN + help + This builds U-Boot for the IOT2050 devices.
-config SYS_CONFIG_NAME - default "am65x_evm" +endchoice
-source "board/ti/common/Kconfig" +source "board/ti/am65x/Kconfig" +source "board/siemens/iot2050/Kconfig"
endif diff --git a/board/siemens/iot2050/Kconfig b/board/siemens/iot2050/Kconfig index 737cda64744..96dcfc41000 100644 --- a/board/siemens/iot2050/Kconfig +++ b/board/siemens/iot2050/Kconfig @@ -6,16 +6,6 @@ # Le Jin le.jin@siemens.com # Jan Kiszka jan.kiszka@siemens.com
-config TARGET_IOT2050_A53 - bool "IOT2050 running on A53" - depends on SOC_K3_AM654 - select ARM64 - select BOARD_LATE_INIT - select SYS_DISABLE_DCACHE_OPS - select BINMAN - help - This builds U-Boot for the IOT2050 devices. - if TARGET_IOT2050_A53
config SYS_BOARD diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig index 7c1bcfc899c..9102f1d54aa 100644 --- a/board/ti/am65x/Kconfig +++ b/board/ti/am65x/Kconfig @@ -3,31 +3,6 @@ # Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ # Lokesh Vutla lokeshvutla@ti.com
-choice - prompt "K3 AM65 based boards" - depends on SOC_K3_AM654 - optional - -config TARGET_AM654_A53_EVM - bool "TI K3 based AM654 EVM running on A53" - select ARM64 - select SYS_DISABLE_DCACHE_OPS - select BOARD_LATE_INIT - select BINMAN - imply TI_I2C_BOARD_DETECT - -config TARGET_AM654_R5_EVM - bool "TI K3 based AM654 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select K3_AM654_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -endchoice - if TARGET_AM654_A53_EVM
config SYS_BOARD

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 2 +- {board/ti => arch/arm/mach-k3}/am64x/Kconfig | 34 +++----------------- board/ti/am64x/Kconfig | 27 ---------------- 3 files changed, 6 insertions(+), 57 deletions(-) copy {board/ti => arch/arm/mach-k3}/am64x/Kconfig (51%)
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index 01889e9d7cf..7293e3cb4fd 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -188,7 +188,7 @@ config K3_X509_SWRV SWRV for X509 certificate used for boot images
source "arch/arm/mach-k3/am65x/Kconfig" -source "board/ti/am64x/Kconfig" +source "arch/arm/mach-k3/am64x/Kconfig" source "board/ti/am62x/Kconfig" source "board/ti/am62ax/Kconfig" source "arch/arm/mach-k3/j721e/Kconfig" diff --git a/board/ti/am64x/Kconfig b/arch/arm/mach-k3/am64x/Kconfig similarity index 51% copy from board/ti/am64x/Kconfig copy to arch/arm/mach-k3/am64x/Kconfig index 2dbc6197b75..6f7b0039615 100644 --- a/board/ti/am64x/Kconfig +++ b/arch/arm/mach-k3/am64x/Kconfig @@ -1,10 +1,12 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/ +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_AM642
choice prompt "K3 AM64 based boards" - depends on SOC_K3_AM642 optional
config TARGET_AM642_A53_EVM @@ -29,32 +31,6 @@ config TARGET_AM642_R5_EVM
endchoice
-if TARGET_AM642_A53_EVM - -config SYS_BOARD - default "am64x" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "am64x_evm" - -source "board/ti/common/Kconfig" - -endif - -if TARGET_AM642_R5_EVM - -config SYS_BOARD - default "am64x" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "am64x_evm" - -source "board/ti/common/Kconfig" +source "board/ti/am64x/Kconfig"
endif diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig index 2dbc6197b75..b873476a9d5 100644 --- a/board/ti/am64x/Kconfig +++ b/board/ti/am64x/Kconfig @@ -2,33 +2,6 @@ # # Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/
-choice - prompt "K3 AM64 based boards" - depends on SOC_K3_AM642 - optional - -config TARGET_AM642_A53_EVM - bool "TI K3 based AM642 EVM running on A53" - select ARM64 - select BINMAN - imply BOARD - imply SPL_BOARD - imply TI_I2C_BOARD_DETECT - -config TARGET_AM642_R5_EVM - bool "TI K3 based AM642 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -endchoice - if TARGET_AM642_A53_EVM
config SYS_BOARD

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 4 +-- arch/arm/mach-k3/am62x/Kconfig | 49 +++++++++++++++++++++++++++++++ board/ti/am62x/Kconfig | 23 --------------- board/toradex/verdin-am62/Kconfig | 23 --------------- 4 files changed, 51 insertions(+), 48 deletions(-) create mode 100644 arch/arm/mach-k3/am62x/Kconfig
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index 7293e3cb4fd..a460952f119 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -189,9 +189,9 @@ config K3_X509_SWRV
source "arch/arm/mach-k3/am65x/Kconfig" source "arch/arm/mach-k3/am64x/Kconfig" -source "board/ti/am62x/Kconfig" +source "arch/arm/mach-k3/am62x/Kconfig" source "board/ti/am62ax/Kconfig" source "arch/arm/mach-k3/j721e/Kconfig" source "board/ti/j721s2/Kconfig" -source "board/toradex/verdin-am62/Kconfig" + endif diff --git a/arch/arm/mach-k3/am62x/Kconfig b/arch/arm/mach-k3/am62x/Kconfig new file mode 100644 index 00000000000..738065e3310 --- /dev/null +++ b/arch/arm/mach-k3/am62x/Kconfig @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_AM625 + +choice + prompt "K3 AM62x based boards" + optional + +config TARGET_AM625_A53_EVM + bool "TI K3 based AM625 EVM running on A53" + select ARM64 + select BINMAN + +config TARGET_AM625_R5_EVM + bool "TI K3 based AM625 EVM running on R5" + select CPU_V7R + select SYS_THUMB_BUILD + select K3_LOAD_SYSFW + select RAM + select SPL_RAM + select K3_DDRSS + select BINMAN + imply SYS_K3_SPL_ATF + +config TARGET_VERDIN_AM62_A53 + bool "Toradex Verdin AM62 running on A53" + select ARM64 + select BINMAN + +config TARGET_VERDIN_AM62_R5 + bool "Toradex Verdin AM62 running on R5" + select CPU_V7R + select SYS_THUMB_BUILD + select K3_LOAD_SYSFW + select RAM + select SPL_RAM + select K3_DDRSS + select BINMAN + imply SYS_K3_SPL_ATF + +endchoice + +source "board/ti/am62x/Kconfig" +source "board/toradex/verdin-am62/Kconfig" + +endif diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index b4b70337d18..610dacfdc08 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -3,29 +3,6 @@ # Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/ # Suman Anna s-anna@ti.com
-choice - prompt "TI K3 AM62x based boards" - depends on SOC_K3_AM625 - optional - -config TARGET_AM625_A53_EVM - bool "TI K3 based AM625 EVM running on A53" - select ARM64 - select BINMAN - -config TARGET_AM625_R5_EVM - bool "TI K3 based AM625 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - -endchoice - if TARGET_AM625_A53_EVM
config SYS_BOARD diff --git a/board/toradex/verdin-am62/Kconfig b/board/toradex/verdin-am62/Kconfig index abc2984f250..fd65a96b3df 100644 --- a/board/toradex/verdin-am62/Kconfig +++ b/board/toradex/verdin-am62/Kconfig @@ -3,29 +3,6 @@ # Copyright 2023 Toradex #
-choice - prompt "Toradex Verdin AM62 based boards" - depends on SOC_K3_AM625 - optional - -config TARGET_VERDIN_AM62_A53 - bool "Toradex Verdin AM62 running on A53" - select ARM64 - select BINMAN - -config TARGET_VERDIN_AM62_R5 - bool "Toradex Verdin AM62 running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - -endchoice - if TARGET_VERDIN_AM62_A53
config SYS_BOARD

Hello Andrew,
On Wed, Nov 01, 2023 at 03:35:28PM -0500, Andrew Davis wrote:
Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Is this oddity specific of ti k3 based board or is this a generic issue in u-boot? Asking to understand if a k3-specific fix is the correct one here.
Francesco

On 11/2/23 3:55 AM, Francesco Dolcini wrote:
Hello Andrew,
On Wed, Nov 01, 2023 at 03:35:28PM -0500, Andrew Davis wrote:
Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Is this oddity specific of ti k3 based board or is this a generic issue in u-boot? Asking to understand if a k3-specific fix is the correct one here.
Some platforms/archs do it this way, others don't, so it is mixed. Right now I'm just fixing mach-k3 but I agree it would be good to audit for this u-boot wide.
Thinking more on this, what we really need is a consistent strategy for selecting target boards in Kconfig. I'd like to keep as much vendor specific stuff in the board/<vendor> dirs, but in this case we end up with the problem in the commit message.
I think arch/x86/ has the right idea. We can have in arch/arm/mach-k3/Kconfig
config VENDOR_*
selections which lets you choose only one vendor. From there we would only include the one board directory matching that SoC+vendor combo. That way we could keep the target selection down in the board/ dirs so you don't have to make changes in arch/arm/mach-k3 when adding new board.
If everyone is okay with that, I can make that change to this series. Could be a template then for other arch and vendors.
Andrew

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 2 +- {board/ti => arch/arm/mach-k3}/am62ax/Kconfig | 29 ++++--------------- board/ti/am62ax/Kconfig | 27 ----------------- 3 files changed, 7 insertions(+), 51 deletions(-) copy {board/ti => arch/arm/mach-k3}/am62ax/Kconfig (52%)
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index a460952f119..cd7dc5140ac 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -190,7 +190,7 @@ config K3_X509_SWRV source "arch/arm/mach-k3/am65x/Kconfig" source "arch/arm/mach-k3/am64x/Kconfig" source "arch/arm/mach-k3/am62x/Kconfig" -source "board/ti/am62ax/Kconfig" +source "arch/arm/mach-k3/am62ax/Kconfig" source "arch/arm/mach-k3/j721e/Kconfig" source "board/ti/j721s2/Kconfig"
diff --git a/board/ti/am62ax/Kconfig b/arch/arm/mach-k3/am62ax/Kconfig similarity index 52% copy from board/ti/am62ax/Kconfig copy to arch/arm/mach-k3/am62ax/Kconfig index 30e1a068660..c5f1ef87126 100644 --- a/board/ti/am62ax/Kconfig +++ b/arch/arm/mach-k3/am62ax/Kconfig @@ -1,11 +1,12 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ -# +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_AM62A7
choice - prompt "TI K3 AM62Ax based boards" - depends on SOC_K3_AM62A7 + prompt "K3 AM62Ax based boards" optional
config TARGET_AM62A7_A53_EVM @@ -30,24 +31,6 @@ config TARGET_AM62A7_R5_EVM
endchoice
-if TARGET_AM62A7_R5_EVM || TARGET_AM62A7_A53_EVM - -config SYS_BOARD - default "am62ax" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "am62ax_evm" - -source "board/ti/common/Kconfig" - -endif - -if TARGET_AM62A7_R5_EVM - -config SPL_LDSCRIPT - default "arch/arm/mach-omap2/u-boot-spl.lds" +source "board/ti/am62ax/Kconfig"
endif diff --git a/board/ti/am62ax/Kconfig b/board/ti/am62ax/Kconfig index 30e1a068660..51e7b3e0eab 100644 --- a/board/ti/am62ax/Kconfig +++ b/board/ti/am62ax/Kconfig @@ -3,33 +3,6 @@ # Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ #
-choice - prompt "TI K3 AM62Ax based boards" - depends on SOC_K3_AM62A7 - optional - -config TARGET_AM62A7_A53_EVM - bool "TI K3 based AM62A7 EVM running on A53" - select ARM64 - select BINMAN - imply BOARD - imply SPL_BOARD - imply TI_I2C_BOARD_DETECT - -config TARGET_AM62A7_R5_EVM - bool "TI K3 based AM62A7 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -endchoice - if TARGET_AM62A7_R5_EVM || TARGET_AM62A7_A53_EVM
config SYS_BOARD

Currently each set of board targets from a vendor is selected inside the board directory for that vendor. This has the problem of multiple targets, one from each vendor, being selectable at the same time. For instance you can select both TARGET_AM654_A53_EVM and TARGET_IOT2050_A53 in the same build.
To fix this we need to move the target board choice to a common location for each parent SoC selection. Do this in arch/arm/mach-k3.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/Kconfig | 2 +- arch/arm/mach-k3/j721s2/Kconfig | 36 +++++++++++++++++++++++++++++++++ board/ti/j721s2/Kconfig | 27 ------------------------- 3 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 arch/arm/mach-k3/j721s2/Kconfig
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index cd7dc5140ac..06722faf8b6 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -192,6 +192,6 @@ source "arch/arm/mach-k3/am64x/Kconfig" source "arch/arm/mach-k3/am62x/Kconfig" source "arch/arm/mach-k3/am62ax/Kconfig" source "arch/arm/mach-k3/j721e/Kconfig" -source "board/ti/j721s2/Kconfig" +source "arch/arm/mach-k3/j721s2/Kconfig"
endif diff --git a/arch/arm/mach-k3/j721s2/Kconfig b/arch/arm/mach-k3/j721s2/Kconfig new file mode 100644 index 00000000000..8b54c0401b6 --- /dev/null +++ b/arch/arm/mach-k3/j721s2/Kconfig @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis afd@ti.com + +if SOC_K3_J721S2 + +choice + prompt "K3 J721S2 based boards" + optional + +config TARGET_J721S2_A72_EVM + bool "TI K3 based J721S2 EVM running on A72" + select ARM64 + select BOARD_LATE_INIT + imply TI_I2C_BOARD_DETECT + select SYS_DISABLE_DCACHE_OPS + select BINMAN + +config TARGET_J721S2_R5_EVM + bool "TI K3 based J721S2 EVM running on R5" + select CPU_V7R + select SYS_THUMB_BUILD + select K3_LOAD_SYSFW + select RAM + select SPL_RAM + select K3_DDRSS + select BINMAN + imply SYS_K3_SPL_ATF + imply TI_I2C_BOARD_DETECT + +endchoice + +source "board/ti/j721s2/Kconfig" + +endif diff --git a/board/ti/j721s2/Kconfig b/board/ti/j721s2/Kconfig index a4a5d16ba21..40853a8fd66 100644 --- a/board/ti/j721s2/Kconfig +++ b/board/ti/j721s2/Kconfig @@ -3,33 +3,6 @@ # Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/ # David Huang d-huang@ti.com
-choice - prompt "K3 J721S2 board" - depends on SOC_K3_J721S2 - optional - -config TARGET_J721S2_A72_EVM - bool "TI K3 based J721S2 EVM running on A72" - select ARM64 - select BOARD_LATE_INIT - imply TI_I2C_BOARD_DETECT - select SYS_DISABLE_DCACHE_OPS - select BINMAN - -config TARGET_J721S2_R5_EVM - bool "TI K3 based J721S2 EVM running on R5" - select CPU_V7R - select SYS_THUMB_BUILD - select K3_LOAD_SYSFW - select RAM - select SPL_RAM - select K3_DDRSS - select BINMAN - imply SYS_K3_SPL_ATF - imply TI_I2C_BOARD_DETECT - -endchoice - if TARGET_J721S2_A72_EVM
config SYS_BOARD

Hi Andrew,
On 02/11/23 02:05, Andrew Davis wrote:
Currently the K3 selection for TARGET boards does not depend on the SoC for which it is based. This leds to the odd ability to select for instance both SOC_K3_AM625 and TARGET_J721E_A72_EVM.
To fix this the target choice should depend on the matching SOC config.
Signed-off-by: Andrew Davis afd@ti.com
board/siemens/iot2050/Kconfig | 2 +- board/ti/am62ax/Kconfig | 1 + board/ti/am62x/Kconfig | 1 + board/ti/am64x/Kconfig | 1 + board/ti/am65x/Kconfig | 1 + board/ti/j721e/Kconfig | 1 + board/ti/j721s2/Kconfig | 1 + board/toradex/verdin-am62/Kconfig | 1 + 8 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/board/siemens/iot2050/Kconfig b/board/siemens/iot2050/Kconfig index a6170aae807..737cda64744 100644 --- a/board/siemens/iot2050/Kconfig +++ b/board/siemens/iot2050/Kconfig @@ -8,8 +8,8 @@
config TARGET_IOT2050_A53 bool "IOT2050 running on A53"
- depends on SOC_K3_AM654 select ARM64
- select SOC_K3_AM654 select BOARD_LATE_INIT select SYS_DISABLE_DCACHE_OPS select BINMAN
diff --git a/board/ti/am62ax/Kconfig b/board/ti/am62ax/Kconfig index 61f289faccd..30e1a068660 100644 --- a/board/ti/am62ax/Kconfig +++ b/board/ti/am62ax/Kconfig @@ -5,6 +5,7 @@
choice prompt "TI K3 AM62Ax based boards"
depends on SOC_K3_AM62A7 optional
config TARGET_AM62A7_A53_EVM
diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index cd17e939e5a..b4b70337d18 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -5,6 +5,7 @@
choice prompt "TI K3 AM62x based boards"
depends on SOC_K3_AM625 optional
config TARGET_AM625_A53_EVM
diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig index fb596e4adfc..2dbc6197b75 100644 --- a/board/ti/am64x/Kconfig +++ b/board/ti/am64x/Kconfig @@ -4,6 +4,7 @@
choice prompt "K3 AM64 based boards"
depends on SOC_K3_AM642 optional
config TARGET_AM642_A53_EVM
diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig index 5fd19d652a6..7c1bcfc899c 100644 --- a/board/ti/am65x/Kconfig +++ b/board/ti/am65x/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 AM65 based boards"
depends on SOC_K3_AM654 optional
config TARGET_AM654_A53_EVM
diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig index e6cb21f77bd..23867ad8e04 100644 --- a/board/ti/j721e/Kconfig +++ b/board/ti/j721e/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 J721E based boards"
depends on SOC_K3_J721E optional
config TARGET_J721E_A72_EVM
diff --git a/board/ti/j721s2/Kconfig b/board/ti/j721s2/Kconfig index f6d1cb57653..a4a5d16ba21 100644 --- a/board/ti/j721s2/Kconfig +++ b/board/ti/j721s2/Kconfig @@ -5,6 +5,7 @@
choice prompt "K3 J721S2 board"
depends on SOC_K3_J721S2 optional
config TARGET_J721S2_A72_EVM
diff --git a/board/toradex/verdin-am62/Kconfig b/board/toradex/verdin-am62/Kconfig index e7522244070..abc2984f250 100644 --- a/board/toradex/verdin-am62/Kconfig +++ b/board/toradex/verdin-am62/Kconfig @@ -5,6 +5,7 @@
choice prompt "Toradex Verdin AM62 based boards"
depends on SOC_K3_AM625 optional
config TARGET_VERDIN_AM62_A53
Reviewed-by: Neha Malcom Francis n-francis@ti.com

On Wed, Nov 01, 2023 at 03:35:24PM -0500, Andrew Davis wrote:
Currently the K3 selection for TARGET boards does not depend on the SoC for which it is based. This leds to the odd ability to select for instance both SOC_K3_AM625 and TARGET_J721E_A72_EVM.
To fix this the target choice should depend on the matching SOC config.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Neha Malcom Francis n-francis@ti.com
For the series, applied to u-boot/next, thanks!
participants (4)
-
Andrew Davis
-
Francesco Dolcini
-
Neha Malcom Francis
-
Tom Rini