spl: Ensure all SPL symbols in Kconfig have some SPL dependency

Tighten up symbol dependencies in a number of places.  Ensure that a SPL
specific option has at least a direct dependency on SPL.  In places
where it's clear that we depend on something more specific, use that
dependency instead.  This means in a very small number of places we can
drop redundant dependencies.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/lib/Kconfig b/lib/Kconfig
index c9f9ddc..7dd777b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -239,6 +239,7 @@
 
 config SPL_TINY_MEMSET
 	bool "Use a very small memset() in SPL"
+	depends on SPL
 	help
 	  The faster memset() is the arch-specific one (if available) enabled
 	  by CONFIG_USE_ARCH_MEMSET. If that is not enabled, we can still get
@@ -557,6 +558,7 @@
 
 config SPL_MD5
 	bool "Support MD5 algorithm in SPL"
+	depends on SPL
 	help
 	  This option enables MD5 support in SPL. MD5 is an algorithm designed
 	  in 1991 that produces a 16-byte digest (or checksum) from its input
@@ -643,6 +645,7 @@
 
 config SPL_LZ4
 	bool "Enable LZ4 decompression support in SPL"
+	depends on SPL
 	help
 	  This enables support for the LZ4 decompression algorithm in SPL. LZ4
 	  is a lossless data compression algorithm that is focused on
@@ -651,6 +654,7 @@
 
 config SPL_LZMA
 	bool "Enable LZMA decompression support for SPL build"
+	depends on SPL
 	help
 	  This enables support for LZMA compression algorithm for SPL boot.
 
@@ -662,6 +666,7 @@
 
 config SPL_LZO
 	bool "Enable LZO decompression support in SPL"
+	depends on SPL
 	help
 	  This enables support for LZO compression algorithm in the SPL.
 
@@ -678,6 +683,7 @@
 
 config SPL_ZSTD
 	bool "Enable Zstandard decompression support in SPL"
+	depends on SPL
 	select XXHASH
 	help
 	  This enables Zstandard decompression library in the SPL.
@@ -750,7 +756,7 @@
 
 config SPL_OF_LIBFDT_ASSUME_MASK
 	hex "Mask of conditions to assume for libfdt"
-	depends on SPL_OF_LIBFDT || FIT
+	depends on SPL_OF_LIBFDT || (FIT && SPL)
 	default 0xff
 	help
 	  Use this to change the assumptions made by libfdt in SPL about the
diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 1c04a7e..152eb2a 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -28,7 +28,7 @@
 
 config SPL_ASYMMETRIC_PUBLIC_KEY_SUBTYPE
 	bool "Asymmetric public-key crypto algorithm subtype within SPL"
-	depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+	depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE && SPL
 	help
 	  This option provides support for asymmetric public key type handling in the SPL.
 	  If signature generation and/or verification are to be used,
@@ -48,7 +48,7 @@
 
 config SPL_RSA_PUBLIC_KEY_PARSER
 	bool "RSA public key parser within SPL"
-	depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+	depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE && SPL
 	select SPL_ASN1_DECODER
 	select ASN1_COMPILER
 	select SPL_OID_REGISTRY
diff --git a/lib/ecdsa/Kconfig b/lib/ecdsa/Kconfig
index a95c4ff..5c3d67d 100644
--- a/lib/ecdsa/Kconfig
+++ b/lib/ecdsa/Kconfig
@@ -17,6 +17,7 @@
 
 config SPL_ECDSA_VERIFY
 	bool "Enable ECDSA verification support in SPL"
+	depends on SPL
 	help
 	  Allow ECDSA signatures to be recognized and verified in SPL.
 
diff --git a/lib/rsa/Kconfig b/lib/rsa/Kconfig
index b773f17..9033384 100644
--- a/lib/rsa/Kconfig
+++ b/lib/rsa/Kconfig
@@ -18,6 +18,7 @@
 
 config SPL_RSA
 	bool "Use RSA Library within SPL"
+	depends on SPL
 
 config SPL_RSA_VERIFY
 	bool