[PATCH 149/149] common/spl/spl_ram: Remove unused default

Tom Rini trini at konsulko.com
Sun Dec 4 16:14:20 CET 2022


We ask for CONFIG_SPL_LOAD_FIT_ADDRESS in Kconfig, so we cannot define
it in C as a fall-back. However, this option previously was buried under
"if ... endif" Kconfig logic. Rework a number of config options to now
have more robust dependency lines so that we can ask this address when
needed. With that done, we can remove the fallback in spl_ram.c.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 boot/Kconfig         | 29 +++++++++++++++--------------
 common/spl/spl_ram.c |  4 ----
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/boot/Kconfig b/boot/Kconfig
index 668270cc6605..65613a01491d 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -36,10 +36,9 @@ config TIMESTAMP
 	  loaded that does not, the message 'Wrong FIT format: no timestamp'
 	  is shown.
 
-if FIT
-
 config FIT_EXTERNAL_OFFSET
 	hex "FIT external data offset"
+	depends on FIT
 	default 0x0
 	help
 	  This specifies a data offset in fit image.
@@ -50,6 +49,7 @@ config FIT_EXTERNAL_OFFSET
 
 config FIT_FULL_CHECK
 	bool "Do a full check of the FIT before using it"
+	depends on FIT
 	default y
 	help
 	  Enable this do a full check of the FIT to make sure it is valid. This
@@ -59,7 +59,7 @@ config FIT_FULL_CHECK
 
 config FIT_SIGNATURE
 	bool "Enable signature verification of FIT uImages"
-	depends on DM
+	depends on DM && FIT
 	select HASH
 	imply RSA
 	imply RSA_VERIFY
@@ -97,7 +97,7 @@ config FIT_RSASSA_PSS
 
 config FIT_CIPHER
 	bool "Enable ciphering data in a FIT uImages"
-	depends on DM
+	depends on DM && FIT
 	select AES
 	help
 	  Enable the feature of data ciphering/unciphering in the tool mkimage
@@ -105,6 +105,7 @@ config FIT_CIPHER
 
 config FIT_VERBOSE
 	bool "Show verbose messages when FIT images fail"
+	depends on FIT
 	help
 	  Generally a system will have valid FIT images so debug messages
 	  are a waste of code space. If you are debugging your images then
@@ -113,6 +114,7 @@ config FIT_VERBOSE
 
 config FIT_BEST_MATCH
 	bool "Select the best match for the kernel device tree"
+	depends on FIT
 	help
 	  When no configuration is explicitly selected, default to the
 	  one whose fdt's compatibility field best matches that of
@@ -122,6 +124,7 @@ config FIT_BEST_MATCH
 
 config FIT_IMAGE_POST_PROCESS
 	bool "Enable post-processing of FIT artifacts after loading by U-Boot"
+	depends on FIT
 	depends on TI_SECURE_DEVICE || SOCFPGA_SECURE_VAB_AUTH
 	default y if TI_SECURE_DEVICE
 	help
@@ -137,15 +140,14 @@ config FIT_IMAGE_POST_PROCESS
 
 config FIT_PRINT
         bool "Support FIT printing"
+	depends on FIT
         default y
         help
           Support printing the content of the fitImage in a verbose manner.
 
-if SPL
-
 config SPL_FIT
 	bool "Support Flattened Image Tree within SPL"
-	depends on SPL
+	depends on SPL && FIT
 	select SPL_HASH
 	select SPL_OF_LIBFDT
 
@@ -157,13 +159,13 @@ config SPL_FIT_PRINT
 
 config SPL_FIT_FULL_CHECK
 	bool "Do a full check of the FIT before using it"
+	depends on SPL_FIT
 	help
 	  Enable this do a full check of the FIT to make sure it is valid. This
 	  helps to protect against carefully crafted FITs which take advantage
 	  of bugs or omissions in the code. This includes a bad structure,
 	  multiple root nodes and the like.
 
-
 config SPL_FIT_SIGNATURE
 	bool "Enable signature verification of FIT firmware within SPL"
 	depends on SPL_DM
@@ -196,6 +198,7 @@ config SPL_FIT_RSASSA_PSS
 
 config SPL_LOAD_FIT
 	bool "Enable SPL loading U-Boot as a FIT (basic fitImage features)"
+	depends on SPL && FIT
 	select SPL_FIT
 	help
 	  Normally with the SPL framework a legacy image is generated as part
@@ -217,7 +220,7 @@ config SPL_LOAD_FIT
 
 config SPL_LOAD_FIT_ADDRESS
 	hex "load address of fit image"
-	depends on SPL_LOAD_FIT
+	depends on SPL_LOAD_FIT || SPL_RAM_SUPPORT || TPL_RAM_SUPPORT
 	default 0x0
 	help
 	  Specify the load address of the fit image that will be loaded
@@ -243,6 +246,7 @@ config SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ
 
 config SPL_LOAD_FIT_FULL
 	bool "Enable SPL loading U-Boot as a FIT (full fitImage features)"
+	depends on FIT
 	select SPL_FIT
 	help
 	  Normally with the SPL framework a legacy image is generated as part
@@ -277,7 +281,8 @@ config SPL_FIT_SOURCE
 
 config USE_SPL_FIT_GENERATOR
 	bool "Use a script to generate the .its script"
-	default y if SPL_FIT && (!ARCH_SUNXI && !RISCV)
+	depends on SPL_FIT
+	default y if !ARCH_SUNXI && !RISCV
 
 config SPL_FIT_GENERATOR
 	string ".its file generator script for U-Boot FIT image"
@@ -290,8 +295,6 @@ config SPL_FIT_GENERATOR
 	  passed a list of supported device tree file stub names to
 	  include in the generated image.
 
-endif # SPL
-
 if VPL
 
 config VPL_FIT
@@ -342,8 +345,6 @@ config VPL_FIT_SIGNATURE_MAX_SIZE
 
 endif # VPL
 
-endif # FIT
-
 config PXE_UTILS
 	bool
 	select MENU
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 2b1ac191523a..5753bd228f77 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -17,10 +17,6 @@
 #include <spl.h>
 #include <linux/libfdt.h>
 
-#ifndef CONFIG_SPL_LOAD_FIT_ADDRESS
-# define CONFIG_SPL_LOAD_FIT_ADDRESS	0
-#endif
-
 static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,
 			       ulong count, void *buf)
 {
-- 
2.25.1



More information about the U-Boot mailing list