[Concept,03/12] buildman: Extract arch fixups from scan() into separate function
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Move the architecture fixup logic (aarch64 and riscv adjustments) into
a new _fixup_arch() method to reduce complexity of scan().
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
tools/buildman/boards.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
@@ -301,6 +301,19 @@ class KconfigScanner:
params['target'] = expect_target
+ self._fixup_arch(params)
+
+ return params, warnings
+
+ def _fixup_arch(self, params):
+ """Fix up architecture names
+
+ Handle cases where the architecture name needs adjustment based on
+ CPU type or other configuration.
+
+ Args:
+ params (dict): Board parameters to update in place
+ """
# fix-up for aarch64
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
params['arch'] = 'aarch64'
@@ -316,8 +329,6 @@ class KconfigScanner:
else:
params['arch'] = 'riscv64'
- return params, warnings
-
class MaintainersDatabase: