Skip to contentSkip to conversation

arm: mack-k3: Kconfig: Hide remoteproc configuration options

PATCH New Massimo Pegorer 1 participant 3 messages Nov 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover arm: mack-k3: Kconfig: Hide remoteproc configuration options

Looking at the recent Marek's patch [1], I was wondering what the purpose of the K3_REMOTEPROC_XXX configuration options in the mach-k3 Kconfig file is. I came to [2] and related revisions. I figured out that they help to provide a default optimal remoteproc configuration based on SoC type. However, having them visible and selectable/unselectable to the user can lead to unexpected configurations, and cause confusion. Instead, if they are not visible, they do what is required (provide default optimal remoteproc configuration) with no side effects.

There are other ways to achieve the same result, of course, such as with imply statements under config SOC_K3_XXX, but this does not seem to be the style of mach-k3 Konfig file, so I preferred to keep the original approach.

[1] https://lore.kernel.org/u-boot/[email protected]/
[2] https://lore.kernel.org/u-boot/[email protected]/

---
Massimo Pegorer (2):
arm: mack-k3: Kconfig: Hide remoteproc configuration options
arm: mack-k3: Kconfig: Keep SoC dependecies sorted and readable

 arch/arm/mach-k3/Kconfig | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

---
base-commit: 3cb2cbbc75aa7fe2391f662607d6b2f46c1292a7
change-id: 20261112-remoteproc-3b5a8be38d63

Best regards,

Signature · 1 line
Massimo Pegorer <[email protected]>
#1 lore raw

PATCH 1/2 arm: mack-k3: Kconfig: Hide remoteproc configuration options

The K3_REMOTEPROC_XXX config options purpose is to imply the corresponding REMOTEPROC_TI_K3_XXX ones. Having almost the same settings in different configuration menus, does not help the user, and it can easily lead to unexpected configurations due to weak reverse dependency driven by imply. Moreover, the REMOTEPROC config option selection can cause the related code to be built in forcibly even if not needed (any K3_REMOTEPROC_XXX selected but all REMOTEPROC_TI_K3_XX unselected).

Dropping the prompt attribute makes these options not-visible and thus they cannot be set/unset by the user. Anyway, they continue to imply when required, providing the optimal remoteproc configuration on a case by case basis. It is left to the user to just play with REMOTEPROC_TI_K3_XXX to select what he really wants in the configuration. Moving REMOTEPROC from select to imply allows the user to unselect it if not needed, too.

---
 arch/arm/mach-k3/Kconfig | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)
arch/arm/mach-k3/Kconfig +8 -16
index bc02368a04d..36580f27d48 100644
@@ -175,32 +175,24 @@ config NR_DRAM_BANKS
 	default 2
 
 config K3_REMOTEPROC_R5F
-	bool "Enable K3 Remoteproc driver for R5F"
-	depends on ARM64
-	select REMOTEPROC
+	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_AM654 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_AM62P5 || SOC_K3_AM642)
+	imply REMOTEPROC
 	imply REMOTEPROC_TI_K3_R5F
-	default y if (SOC_K3_AM62A7 || SOC_K3_AM654 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_AM62P5 || SOC_K3_AM642)
 
 config K3_REMOTEPROC_DSP
-	bool "Enable K3 Remoteproc driver for DSP"
-	depends on ARM64
-	select REMOTEPROC
+	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S)
+	imply REMOTEPROC
 	imply REMOTEPROC_TI_K3_DSP
-	default y if (SOC_K3_AM62A7 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S)
 
 config K3_REMOTEPROC_M4F
-	bool "Enable K3 Remoteproc driver for M4F"
-	depends on ARM64
-	select REMOTEPROC
+	def_bool y if ARM64 && (SOC_K3_AM625 || SOC_K3_AM642)
+	imply REMOTEPROC
 	imply REMOTEPROC_TI_K3_M4F
-	default y if (SOC_K3_AM625 || SOC_K3_AM642)
 
 config K3_REMOTEPROC_PRU
-	bool "Enable K3 Remoteproc driver for PRU"
-	depends on ARM64
-	select REMOTEPROC
+	def_bool y if ARM64 && (SOC_K3_AM642 || SOC_K3_AM654)
+	imply REMOTEPROC
 	imply REMOTEPROC_TI_PRU
-	default y if (SOC_K3_AM642 || SOC_K3_AM654)
 
 config K3_HSM_FW
 	bool "Package firmware for HSM core"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 arm: mack-k3: Kconfig: Keep SoC dependecies sorted and readable

In reply to Massimo Pegorer

Keeping config option dependencies from SoC respectful of the original SoCs sorted list, and breaking them into more shorter lines, helps the readability comparison and maintenance.

---
 arch/arm/mach-k3/Kconfig | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-k3/Kconfig +7 -3
index 36580f27d48..a44e3e43bbd 100644
@@ -175,12 +175,16 @@ config NR_DRAM_BANKS
 	default 2
 
 config K3_REMOTEPROC_R5F
-	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_AM654 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_AM62P5 || SOC_K3_AM642)
+	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_AM62P5 || \
+				SOC_K3_AM642 || SOC_K3_AM654 || \
+				SOC_K3_J721E || SOC_K3_J721S2 || \
+				SOC_K3_J722S || SOC_K3_J784S4)
 	imply REMOTEPROC
 	imply REMOTEPROC_TI_K3_R5F
 
 config K3_REMOTEPROC_DSP
-	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_J721E || SOC_K3_J784S4 || SOC_K3_J721S2 || SOC_K3_J722S)
+	def_bool y if ARM64 && (SOC_K3_AM62A7 || SOC_K3_J721E || \
+				SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4)
 	imply REMOTEPROC
 	imply REMOTEPROC_TI_K3_DSP
 
@@ -196,7 +200,7 @@ config K3_REMOTEPROC_PRU
 
 config K3_HSM_FW
 	bool "Package firmware for HSM core"
-	depends on (SOC_K3_J721S2 || SOC_K3_J784S4 || SOC_K3_J722S)
+	depends on (SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4)
 	help
 	  Enabling this will indicate that the system has a HSM (High Security
 	  Module) M4 Core and the firmware for the core is available. When
Signature · 1 line
2.34.1