Skip to contentSkip to conversation

LDR format: Kconfig: fix LDR_CPU and drop HAS_LDR

PATCH In review Massimo Pegorer 2 participants 5 messages Nov 13 – Nov 23

lore
Share & tools
lore
#0 lore raw

cover LDR format: Kconfig: fix LDR_CPU and drop HAS_LDR

LDR_CPU has a prompt but depends on HAS_LDR which is prompt-less and never set anywhere. Sounds weird. Instead, make LDR_CPU depend on ARCH_SC5XX which is the only architecture using LDR format, and drop HAS_LDR.

---
Massimo Pegorer (3):
Kconfig: Make LDR_CPU config option depend on ARCH_SC5XX
Kconfig: Improve LDR_CPU prompt and help text
Kconfig: Drop HAS_LDR configuration option

 Kconfig | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

---
base-commit: ff8a9bc41e4e5bdd3406932af5abb4c18064e539
change-id: 20261113-ldr2-f0386fc693e1

Best regards,

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

PATCH 1/3 Kconfig: Make LDR_CPU config option depend on ARCH_SC5XX

The user never has the option to set or change the LDR_CPU value because this configuration option depends on HAS_LDR, which is a prompt-less option never set anywhere, neither in Kconfig nor in defconfig or config fragments. Therefore, the user is never prompted to.

Remove the weird dependency and make LDR_CPU depend on ARCH_SC5XX instead:
this is the only architecture using the LDR format.

Fixes bcdd02328e65 ("build: Revive and update LDR format support")
---
 Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kconfig +1 -1
index c8cfbf5d5de..a049cc80806 100644
@@ -796,7 +796,7 @@ config HAS_LDR
 
 config LDR_CPU
 	string "CPU name to be passed to LDR utility."
-	depends on HAS_LDR
+	depends on ARCH_SC5XX
 	help
 	  Set the CPU name for the -T parameter in the LDR utility.  This is
 	  generally used on processors from Analog Devices, but may be also
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 Kconfig: Improve LDR_CPU prompt and help text

In reply to Massimo Pegorer

Remove the prompt string ending dot. In the help text, emphasize that this configuration option is related to LDR format support.

---
 Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Kconfig +4 -4
index a049cc80806..6381c523a93 100644
@@ -795,12 +795,12 @@ config HAS_LDR
 	  automatically build any additional targets with make or buildman.
 
 config LDR_CPU
-	string "CPU name to be passed to LDR utility."
+	string "CPU name to be passed to LDR utility"
 	depends on ARCH_SC5XX
 	help
-	  Set the CPU name for the -T parameter in the LDR utility.  This is
-	  generally used on processors from Analog Devices, but may be also
-	  be useful for other vendors.
+	  Set the CPU name for the -T parameter in the LDR utility. This is
+	  generally used on processors from Analog Devices, but may also be
+	  useful for other vendors using the LDR format.
 
 source "api/Kconfig"
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 Kconfig: Drop HAS_LDR configuration option

In reply to Massimo Pegorer

This prompt-less option is never used at all.

---
 Kconfig | 6 ------
 1 file changed, 6 deletions(-)
Kconfig +0 -6
index 6381c523a93..93b84a31b0d 100644
@@ -788,12 +788,6 @@ config SYS_CLK_FREQ
 	  A static value for the CPU frequency.  Note that if not required
 	  for a given SoC, this can be left at 0.
 
-config HAS_LDR
-	bool
-	help
-	  Enables building .ldr targets for U-Boot and SPL. This does not
-	  automatically build any additional targets with make or buildman.
-
 config LDR_CPU
 	string "CPU name to be passed to LDR utility"
 	depends on ARCH_SC5XX
Signature · 1 line
2.34.1
Reviewed-by on the v1 series
#4 lore raw
In reply to Massimo Pegorer

Hi Massimo,

Quoted 15 lines · Massimo Pegorer

LDR_CPU has a prompt but depends on HAS_LDR which is prompt-less and never set anywhere. Sounds weird. Instead, make LDR_CPU depend on ARCH_SC5XX which is the only architecture using LDR format, and drop HAS_LDR.

---
Massimo Pegorer (3):
Kconfig: Make LDR_CPU config option depend on ARCH_SC5XX
Kconfig: Improve LDR_CPU prompt and help text
Kconfig: Drop HAS_LDR configuration option

 Kconfig | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
Quoted 8 lines

---
base-commit: ff8a9bc41e4e5bdd3406932af5abb4c18064e539
change-id: 20261113-ldr2-f0386fc693e1

Best regards,
--
Massimo Pegorer <[email protected]>

Thanks for doing this. I saw Tom had HAS_LDR on the list of Kconfig options to clean up a little while back and meant to get around to it, but I've been a bit too busy lately. The regular build works fine, and I agree with the changes, but I don't have the resources to run CI locally to verify that part right now so we'll see if Tom sees any problems there.

Thanks,
Greg