Skip to contentSkip to conversation

TPL: Do not allow enabling TPL symbols for non-TPL builds

PATCH Superseded Pali Rohár 2 participants 2 messages May 24, 2022 – Jun 8, 2022 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TPL: Do not allow enabling TPL symbols for non-TPL builds

It does not make sense to enable TPL options when not building TPL binary. So disallow selecting TPL options for non-TPL builds.

---
 common/Kconfig                 | 4 ++++
 drivers/power/acpi_pmc/Kconfig | 1 +
 lib/Kconfig                    | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)
common/Kconfig +4 -0
index 8e59dcef4b8b..ba59edd14673 100644
@@ -89,10 +89,14 @@ config SPL_LOGLEVEL
 
 endif
 
+if TPL
+
 config TPL_LOGLEVEL
 	int
 	default LOGLEVEL
 
+endif
+
 config VPL_LOGLEVEL
 	int "loglevel for VPL"
 	default LOGLEVEL
drivers/power/acpi_pmc/Kconfig +1 -0
index 8b712abc41e9..629acb071427 100644
@@ -18,6 +18,7 @@ config SPL_ACPI_PMC
 
 config TPL_ACPI_PMC
 	bool "Power Manager (x86 PMC) support in TPL"
+	depends on TPL
 	default y if ACPI_PMC
 	help
 	  Enable support for an x86-style power-management controller which
lib/Kconfig +2 -1
index 299381ac80d5..ef1c57a075f6 100644
@@ -249,6 +249,7 @@ config SPL_TINY_MEMSET
 
 config TPL_TINY_MEMSET
 	bool "Use a very small memset() in TPL"
+	depends on TPL
 	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
@@ -779,7 +780,7 @@ config TPL_OF_LIBFDT
 
 config TPL_OF_LIBFDT_ASSUME_MASK
 	hex "Mask of conditions to assume for libfdt"
-	depends on TPL_OF_LIBFDT || FIT
+	depends on TPL_OF_LIBFDT || (TPL && FIT)
 	default 0xff
 	help
 	  Use this to change the assumptions made by libfdt in TPL about the
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Pali Rohár

It does not make sense to enable TPL options when not building TPL binary. So disallow selecting TPL options for non-TPL builds.

I've tried to make sure all of these are covered in:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
where I tried to audit all cases of "config TPL_" that did not then have a depends line on some other TPL symbol.

Signature · 1 line
Tom