Skip to content

Commit 86b72ee

Browse files
kartbenhenrikbrixandersen
authored andcommitted
doc: extensions: boards: extract socs information
Store soc(s) information for each board in the catalog, as well as populate a tree structure for the full list of family->series->soc. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent c552930 commit 86b72ee

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

doc/_scripts/gen_boards_catalog.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from collections import namedtuple
66
from pathlib import Path
77

8-
import list_boards
8+
import list_boards, list_hardware
99
import pykwalify
1010
import yaml
1111
import zephyr_module
@@ -15,6 +15,7 @@
1515

1616
logger = logging.getLogger(__name__)
1717

18+
1819
def guess_file_from_patterns(directory, patterns, name, extensions):
1920
for pattern in patterns:
2021
for ext in extensions:
@@ -77,6 +78,7 @@ def get_catalog():
7778
)
7879

7980
boards = list_boards.find_v2_boards(args_find_boards)
81+
systems = list_hardware.find_v2_systems(args_find_boards)
8082
board_catalog = {}
8183

8284
for board in boards:
@@ -99,6 +101,7 @@ def get_catalog():
99101
except Exception as e:
100102
logger.error(f"Error parsing twister file {twister_file}: {e}")
101103

104+
socs = {soc.name for soc in board.socs}
102105
full_name = board.full_name or board.name
103106
doc_page = guess_doc_page(board)
104107

@@ -107,7 +110,14 @@ def get_catalog():
107110
"doc_page": doc_page.relative_to(ZEPHYR_BASE).as_posix() if doc_page else None,
108111
"vendor": vendor,
109112
"archs": list(archs),
113+
"socs": list(socs),
110114
"image": guess_image(board),
111115
}
112116

113-
return {"boards": board_catalog, "vendors": vnd_lookup.vnd2vendor}
117+
socs_hierarchy = {}
118+
for soc in systems.get_socs():
119+
family = soc.family or "<no family>"
120+
series = soc.series or "<no series>"
121+
socs_hierarchy.setdefault(family, {}).setdefault(series, []).append(soc.name)
122+
123+
return {"boards": board_catalog, "vendors": vnd_lookup.vnd2vendor, "socs": socs_hierarchy}

0 commit comments

Comments
 (0)