summaryrefslogtreecommitdiff
path: root/tools/qconfig.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-11 12:23:25 -0600
committerTom Rini <trini@konsulko.com>2024-10-11 12:23:25 -0600
commit47e544f576699ca4630e20448db6a05178960697 (patch)
treef31951120512ac41f145dc0fcf6b0bbdfe5b9c01 /tools/qconfig.py
parent5d899fc58c44fe5623e31524da2205d8597a53d1 (diff)
parent0220a68c25cbfdfa495927f83abf0b1d4ebd823b (diff)
Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
Diffstat (limited to 'tools/qconfig.py')
-rwxr-xr-xtools/qconfig.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/qconfig.py b/tools/qconfig.py
index 8c2fc9efc5f..058d72cf4bc 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -77,7 +77,7 @@ IGNORE_SYMS = ['DEBUG_SECTION_MISMATCH', 'FTRACE_MCOUNT_RECORD', 'GCOV_KERNEL',
'IS_ENABLED_', 'IS_ENABLED_1', 'IS_ENABLED_2', 'IS_ENABLED_3',
'SPL_', 'TPL_', 'SPL_FOO', 'TPL_FOO', 'TOOLS_FOO',
'ACME', 'SPL_ACME', 'TPL_ACME', 'TRACE_BRANCH_PROFILING',
- 'VAL', '_UNDEFINED', 'SPL_BUILD', ]
+ 'VAL', '_UNDEFINED', 'SPL_BUILD', 'XPL_BUILD', ]
SPL_PREFIXES = ['SPL_', 'TPL_', 'VPL_', 'TOOLS_']
@@ -1175,7 +1175,7 @@ def prefix_config(cfg):
return oper + cfg
-RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)')
+RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(XPL_\)|\$\(PHASE_\))?([A-Za-z0-9_]*)')
RE_IFDEF = re.compile(r'(ifdef|ifndef)')
RE_C_CONFIGS = re.compile(r'CONFIG_([A-Za-z0-9_]*)')
RE_CONFIG_IS = re.compile(r'CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)')
@@ -1186,7 +1186,7 @@ class ConfigUse:
"""Set up a new ConfigUse
Args:
- cfg (str): CONFIG option, without any CONFIG_ or SPL_ prefix
+ cfg (str): CONFIG option, without any CONFIG_ or xPL_ prefix
is_spl (bool): True if this option relates to SPL
fname (str): Makefile filename where the CONFIG option was found
rest (str): Line of the Makefile
@@ -1220,10 +1220,10 @@ def scan_makefiles(fnames):
>>> RE_MK_CONFIGS.search('CONFIG_FRED').groups()
(None, 'FRED')
- >>> RE_MK_CONFIGS.search('CONFIG_$(SPL_)MARY').groups()
- ('$(SPL_)', 'MARY')
- >>> RE_MK_CONFIGS.search('CONFIG_$(SPL_TPL_)MARY').groups()
- ('$(SPL_TPL_)', 'MARY')
+ >>> RE_MK_CONFIGS.search('CONFIG_$(XPL_)MARY').groups()
+ ('$(XPL_)', 'MARY')
+ >>> RE_MK_CONFIGS.search('CONFIG_$(PHASE_)MARY').groups()
+ ('$(PHASE_)', 'MARY')
"""
all_uses = collections.defaultdict(list)
fname_uses = {}
@@ -1319,10 +1319,10 @@ def do_scan_source(path, do_update):
key (ConfigUse): object
value (list of str): matching lines
spl_mode (int): If MODE_SPL, look at source code which implies
- an SPL_ option, but for which there is none;
+ an xPL_ option, but for which there is none;
for MOD_PROPER, look at source code which implies a Proper
- option (i.e. use of CONFIG_IS_ENABLED() or $(SPL_) or
- $(SPL_TPL_) but for which there none;
+ option (i.e. use of CONFIG_IS_ENABLED() or $(XPL_) or
+ $(PHASE_) but for which there none;
if MODE_NORMAL, ignore SPL
Returns:
@@ -1341,7 +1341,7 @@ def do_scan_source(path, do_update):
if spl_mode == MODE_SPL:
check = use.is_spl
- # If it is an SPL symbol, try prepending all SPL_ prefixes to
+ # If it is an SPL symbol, try prepending all xPL_ prefixes to
# find at least one SPL symbol
if use.is_spl:
for prefix in SPL_PREFIXES:
@@ -1354,7 +1354,7 @@ def do_scan_source(path, do_update):
continue
elif spl_mode == MODE_PROPER:
# Try to find the Proper version of this symbol, i.e. without
- # the SPL_ prefix
+ # the xPL_ prefix
proper_name = is_not_proper(name)
if proper_name:
name = proper_name
@@ -1450,7 +1450,7 @@ def do_scan_source(path, do_update):
show_uses(not_found)
spl_not_found |= {is_not_proper(key) or key for key in not_found.keys()}
- print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:')
+ print('\nCONFIG options used as Proper in Makefiles but without a non-xPL_ variant:')
not_found = check_not_found(all_uses, MODE_PROPER)
show_uses(not_found)
proper_not_found |= {not_found.keys()}
@@ -1468,16 +1468,16 @@ def do_scan_source(path, do_update):
show_uses(not_found)
spl_not_found |= {is_not_proper(key) or key for key in not_found.keys()}
- print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:')
+ print('\nCONFIG options used as Proper in source but without a non-xPL_ variant:')
not_found = check_not_found(all_uses, MODE_PROPER)
show_uses(not_found)
proper_not_found |= {not_found.keys()}
- print('\nCONFIG options used as SPL but without an SPL_ variant:')
+ print('\nCONFIG options used as SPL but without an xPL_ variant:')
for item in sorted(spl_not_found):
print(f' {item}')
- print('\nCONFIG options used as Proper but without a non-SPL_ variant:')
+ print('\nCONFIG options used as Proper but without a non-xPL_ variant:')
for item in sorted(proper_not_found):
print(f' {item}')