This commit improves board handling for boards in HWMv2.
On a CMake rerun, then BOARD_DIR is passed to `list_boards.py` which
is extended to take such parameter.
This allows to run `list_boards.py` whenever CMake reruns without the
penalty of searching for all board.yml files, as only the board.yml of
the current BOARD_DIR is processed.
This allows `list_boards.py` to be invoked and from there obtain list
of valid revisions and board identifiers for further board validation.
This removes the need for caching additional CMake variables related to
the board identifier and revision and thereby remove the risk of
settings becoming out of sync as only the board provided by user is
needed.
This work further ensure that use-cases described in #50536 is still
supported.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
When printing with --cmakeformat format specifier then dir output should
be printed as posix path, that is with forward slashes '/'.
This will make output compatible with CMake path style.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
To un-block continuing of soc and board porting then move all socs and
boards which have not yet been ported to boards_legacy / soc_legacy
folders.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Make 'default' and 'revisions' fields optional for custom revisions.
When using custom revision format, then board author must create a
revision.cmake file for revision handling, in which case revisions
don't need to be specified in the board.yml file.
Therefore make 'default' and 'revisions' fields optional in the schema
and implement custom yaml validation which can validate that 'default'
and 'revisions' are specified for all other revision formats.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Using extend instead of append to correctly extend the list of valid
board identifiers.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Extending board output with SoC information.
This provides the possibility to print all SoCs present for boards in
new hw model.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Extend list_boards.py and update boards CMake module to handle HWMv2.
list_boards.py is extended to support board.yml file in each board
folder with various information related to the board, such as vendor,
soc, cpucluster, variants, revisions.
The HWMv2 removes the requirement for a _defconfig file.
It also unifies how board revisions, cpusets, etc is defined which again
provides an option for cleaner build system implementation for handling
of boards and their integration to the build system.
The CMake boards.cmake module is updated to take advantage of the
improved design.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Remove ZEPHYR_BASE as default root in list_boards.py.
This allows list_boards.py to be used to only print boards at given
root(s) without printing Zephyr default boards.
Secondly it remove the need in list_boards.py to have any knowledge of
ZEPHYR_BASE.
The `west boards` command already has ZEPHYR_BASE knowledge and can
easily add ZEPHYR_BASE to the list of roots it is already constructing,
thus removing the need for knowing that ZEPHYR_BASE is always added.
Update boards.cmake to pass ZEPHYR_BASE as an additional arch root, as
arch.cmake has not yet been processed,which means ZEPHYR_BASE is missing
in ARCH_ROOT list at this point in time.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Out-of-tree boards directory is likely to have boards within subset of
architectures (e.g. only 'arm' boards) that are supported by Zephyr.
Currently script iterates over all architectures and tries to list
contents of boards/<arch>/, which might not be existing. This results in
'FileNotFoundError' exception:
Traceback (most recent call last):
File "/project/zephyr/scripts/list_boards.py", line 113, in <module>
dump_boards(find_arch2boards(parse_args()))
File "/project/zephyr/scripts/list_boards.py", line 32, in \
find_arch2boards
arch2board_set = find_arch2board_set(args)
File "/project/zephyr/scripts/list_boards.py", line 45, in \
find_arch2board_set
for arch, boards in find_arch2board_set_in(root, arches).items():
File "/project/zephyr/scripts/list_boards.py", line 78, in \
find_arch2board_set_in
for maybe_board in (boards / arch).iterdir():
File "/usr/lib/python3.9/pathlib.py", line 1149, in iterdir
for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: \
'/project/app/boards/arc'
Simply ignore missing boards/<arch>/ directories and skip to the next
arch.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This script is essentially a Python rewrite of the CMake code we're
using to print boards in cmake/boards.cmake, plus some extra features.
Having this in Python will simplify some later adjustments to our
'usage' build system target in ways that will make its output easier
to read, while simultaneously making 'west boards' more useful.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>