Skip to content

Commit 9848437

Browse files
committed
scripts: list_boards: drop HWMv1 code
Fixes #97017 Support for HWMv1 was removed in Zephyr 4.2.0 Signed-off-by: Guðni Már Gilbert <[email protected]>
1 parent 7529e2e commit 9848437

File tree

1 file changed

+1
-108
lines changed

1 file changed

+1
-108
lines changed

scripts/list_boards.py

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
import argparse
77
import difflib
8-
import itertools
98
import sys
10-
from collections import Counter, defaultdict
9+
from collections import Counter
1110
from dataclasses import dataclass, field
1211
from pathlib import Path
1312

@@ -152,81 +151,6 @@ def from_qualifier(self, qualifiers):
152151
return node
153152

154153

155-
def board_key(board):
156-
return board.name
157-
158-
159-
def find_arch2boards(args):
160-
arch2board_set = find_arch2board_set(args)
161-
return {arch: sorted(arch2board_set[arch], key=board_key)
162-
for arch in arch2board_set}
163-
164-
165-
def find_boards(args):
166-
return sorted(itertools.chain(*find_arch2board_set(args).values()),
167-
key=board_key)
168-
169-
170-
def find_arch2board_set(args):
171-
arches = sorted(find_arches(args))
172-
ret = defaultdict(set)
173-
174-
for root in unique_paths(args.board_roots):
175-
for arch, boards in find_arch2board_set_in(root, arches, args.board_dir).items():
176-
if args.board is not None:
177-
ret[arch] |= {b for b in boards if b.name == args.board}
178-
else:
179-
ret[arch] |= boards
180-
181-
return ret
182-
183-
184-
def find_arches(args):
185-
arch_set = set()
186-
187-
for root in unique_paths(args.arch_roots):
188-
arch_set |= find_arches_in(root)
189-
190-
return arch_set
191-
192-
193-
def find_arches_in(root):
194-
ret = set()
195-
arch = root / 'arch'
196-
common = arch / 'common'
197-
198-
if not arch.is_dir():
199-
return ret
200-
201-
for maybe_arch in arch.iterdir():
202-
if not maybe_arch.is_dir() or maybe_arch == common:
203-
continue
204-
ret.add(maybe_arch.name)
205-
206-
return ret
207-
208-
209-
def find_arch2board_set_in(root, arches, board_dir):
210-
ret = defaultdict(set)
211-
boards = root / 'boards'
212-
213-
for arch in arches:
214-
if not (boards / arch).is_dir():
215-
continue
216-
for maybe_board in (boards / arch).iterdir():
217-
if not maybe_board.is_dir():
218-
continue
219-
if board_dir and maybe_board not in board_dir:
220-
continue
221-
for maybe_defconfig in maybe_board.iterdir():
222-
file_name = maybe_defconfig.name
223-
if file_name.endswith('_defconfig') and not (maybe_board / BOARD_YML).is_file():
224-
board_name = file_name[:-len('_defconfig')]
225-
ret[arch].add(Board(board_name, maybe_board, 'v1', arch=arch))
226-
227-
return ret
228-
229-
230154
def load_v2_boards(board_name, board_yml, systems):
231155
boards = {}
232156
board_extensions = []
@@ -426,37 +350,6 @@ def notfound(x):
426350
print(f'{b.name}')
427351

428352

429-
def dump_boards(args):
430-
arch2boards = find_arch2boards(args)
431-
for arch, boards in arch2boards.items():
432-
if args.fuzzy_match is not None:
433-
close_boards = difflib.get_close_matches(args.fuzzy_match, [b.name for b in boards])
434-
if not close_boards:
435-
continue
436-
boards = [b for b in boards if b.name in close_boards]
437-
if args.cmakeformat is None:
438-
print(f'{arch}:')
439-
for board in boards:
440-
if args.cmakeformat is not None:
441-
info = args.cmakeformat.format(
442-
NAME='NAME;' + board.name,
443-
DIR='DIR;' + str(board.dir.as_posix()),
444-
HWM='HWM;' + board.hwm,
445-
VENDOR='VENDOR;NOTFOUND',
446-
REVISION_DEFAULT='REVISION_DEFAULT;NOTFOUND',
447-
REVISION_FORMAT='REVISION_FORMAT;NOTFOUND',
448-
REVISION_EXACT='REVISION_EXACT;NOTFOUND',
449-
REVISIONS='REVISIONS;NOTFOUND',
450-
VARIANT_DEFAULT='VARIANT_DEFAULT;NOTFOUND',
451-
SOCS='SOCS;',
452-
QUALIFIERS='QUALIFIERS;'
453-
)
454-
print(info)
455-
else:
456-
print(f' {board.name}')
457-
458-
459353
if __name__ == '__main__':
460354
args = parse_args()
461-
dump_boards(args)
462355
dump_v2_boards(args)

0 commit comments

Comments
 (0)