New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduction of board and SoC scheme v2. #50305
Introduction of board and SoC scheme v2. #50305
Conversation
2f0343b
to
8013734
Compare
Still outside my area of expertise, but this scheme I like much better than N-thousand-line PRs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejlmand it would be nice if "board scheme v2" didn't require a boards/ARCH/boardname hierarchy so that we wouldn't have to hack around the zephyr file system standard for targets with multiple architectures on a single SoC/PCB.
A very good point indeed, and I assume same comment applies to SoC tree. To others reading this, please give a 👍 if you think scheme v2 should actually get rid of This would especially make sense for boards with multiple SoCs of different archs, or multicore SoCs where different cores might be of different archs. |
It does. |
for those who have been long enough here, you will remember the days we had to pass |
No, that's what I'm saying should be changed for the v2 hardware scheme. We have known this has been a problem for years: 0d811b9#diff-cc856e9b347fddf6d5a472d1330e1e71e805aee2e66a48b9251b528af7f390f8R290 Decoupling "board" and "soc" from "arch" is exactly what I am suggesting. An SoC can have CPU clusters with as many different architectures as the vendor wants to cram in there, so any target board can too. |
Link is not working well; I'm trying to reference this part of the old getting started:
|
Maybe use this link to the old docs instead: https://docs.zephyrproject.org/1.14.1/getting_started/index.html#board-misnomer |
@mbolivar-nordic While i'm agreeing a lot with your statement, I also like the structure of multiple levels, as a form of filtering. Have you considered if everything should be at top-level or we should have another structure ? One requirement for the v2 scheme is to be self-contained. Now, because the v2 scheme must be self-contained, then that also means we could easily extend Such a possibility would imo make it acceptable to have all boards and SoCs at a single level, as there is now an option to easily filter boards. Note 1: This was not an original use-case, but a use-case that will be possible in the v2 scheme, but I will need to take a look at the arch v2 scheme, as that has not initially been part of this work. Note 2: Today addressing a specific core on a SoC is defined as a independent board, like
|
8013734
to
741436c
Compare
This is tested here, #50356, with an invalid defined board v2, and the result:
|
in zephyr we are using SoC in the wrong way. The way it is now, it represents just one IP that is tied to one architecture. An SoC with two different IP blocks with different architectures would be a superset in this case, a system.... |
Toolchain WG summary:
|
thought more about all of this. In the ideal world and looking down the path of supporting products with multi-arch SoCs, an SoC (as we have it today) would be just contained and part of a |
correct, and i'm trying to design this, including thoughts on scalability. We basically want a common tree (to make maintaining boards / SoC easier and cleaner), and in the highlevel system (sysbuild) be able to specify just the board (system). The highlevel (sysbuild) will then pass specific information down to the individual build stages, for example build Zephyr sample N with toolchain X, for core A, build sample M, toolchain Y, core B, etc. But it should still be possible to directly request a build of sample N, toolchain X, core A. Therefore we want common knowledge shared in the tree, and not scattered around. |
... and I'm trying to help on the devicetree side using system devicetree, which I'll send an RFC about soon. |
On Mon, Sep 19 2022, Torsten Tejlmand Rasmussen wrote:
> Decoupling "board" and "soc" from "arch" is exactly what I am suggesting. An SoC can have CPU clusters with as many different architectures as the vendor wants to cram in there, so any target board can too.
@mbolivar-nordic While i'm agreeing a lot with your statement, I also like the structure of multiple levels, as a form of filtering.
This means a user can look only at arm, riscv, x86 based boards.
Have you considered if everything should be at top-level or we should have another structure ?
Vendor based, like `boards/intel/<intel-boards>`.
That may make sense for some vendors, but we risk n-vendor folders just containing a single board, which also leads to mess.
I agree, it's a tricky problem to solve. I just think we should not
enforce this false ARCH-based hierarchy in v2.
|
@tejlmand may not be a bad idea having some smartness in |
Is it unreasonable to mix v1 and v2 up under top root |
I'd personally migrate all socs/boards while in the collab branch, and make |
Frankly that'd be ideal if the two don't have to coexist. Would it be an option to migrate all upstream boards in one swipe and keep supporting existing out-of-tree boards with no changes? I'm assuming this will use the two-release deperacation timeline right? |
dfa9749
to
139498f
Compare
I think too much smartness in I've added a
Boards in old format will have an empty identifiers string, but I don't think we should care to much for those, especially not if we'll make the transition for all boards in the collab branch. So only thing left to decide is the default format string to use. Currently that is:
|
it is, especially as some Kconfig files in old mode are sourced inside choices. If we do soc / board transition for everything in Zephyr tree (and allow old format in oot repos), then we can move everything from |
139498f
to
4527306
Compare
Hw model v2 scheme offers SoC and maintainers the possibility to define promptless SoCs settings which must be selected by the board Kconfig. Having a board doing `select SOC_<name>` is a much cleaner approach then selecting the SoC in a configuration file. It furthermore removes the need to present all SoCs in choice groups, as the SoC is now an internal setting to Kconfig. This further has the benefit of not presenting users, especially new-comers to Zephyr, with SoC selection options in menuconfig which has potential to cause confusion. It moves the SOC, SOC_SERIES, and SOC_FAMILY from arch/Kconfig into the soc Kconfig tree, where they rightfully belongs. With hw model v2, BOARD name is now passed from the build system to Kconfig which ensures that the board name used in CMake is always in sync with the board name used in Kconfig for hw model v2. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
…SoCs The list_hardware.py script parses archs.yml in all <arch-root>/arch folders and soc.yml in all <soc-root>/soc sub-folders. The archs.yml and soc.yml are introduced with hw model v2. Hw model v2 removes the need for architecture knowledge of the SoCs, and as part of this makes multi-arch and multi-core SoCs possible. Hw model v2 also allows for greater flexibility in arch and SoC organization as they can be organized freely. As example SoCs can be organized by vendors, architecture, or any other way as the socs.yml contains the path to the location of the SoC, instead of relying on a specific arch. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Existing Zephyr architectures are already self-contained and thereby HWMv2 compliant. Add all existing architectures to archs.yml. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Introduce dedicated arch and soc hw model v2 CMake module files. Rename existing arch and soc cmake file to have a `_v1` post fix. This help to identify the purpose of each of those files and thus a cleaner implementation. 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>
This commit updates twister testplan.py to handle HWMv2 boards. It does so by switching to use list_boards.py to obtain a list of folders containing <board>.yaml files for processing instead of a global globbing of sub-folders under boards. With HWMv2, boards can be organized more freely, meaning that a fixed glob hierarchy is no longer safe. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit extends compliance check to include a KconfigBoardV2 check. This check verifies that a v2 scheme board / SoC does not contain references outside the Kconfig trees. The check is invoked as: `check_compliance.py -m KconfigBoardV2` Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit introduces support for Zephyr hw model v2 in the arch Kconfig tree. The hw model v2 requires Kconfig trees to be self-contained, meaning that the have no Kconfig references outside the tree itself. For hw model v2, the architecture of a board / SoC is not known until the Kconfig tree and config file has been parsed. There provide a new arch/Kconfig.v2 file to support loading of all arch Kconfigs. Hw model v1 is now placed in arch/Kconfig.v1 and includes only the arch Kconfig files determined by the arch of the board. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit move the renesas_rzt2m SoC to soc/v2 and adopt HWMv2. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit updates Renesas Starter Kit+ for RZ/T2M board to use HWMv2. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit move the arm mps3 SoC to soc/v2 and adopt HWMv2. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit updates arm mps3 an547 board to use HWMv2. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit updates testcase.yaml and sample.yaml to use mps3/an547 identifier which replaces former mps3_an547 board name. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
4527306
to
5b103a3
Compare
4a54736
into
zephyrproject-rtos:collab-hwm
This PR introduces a board and SoC scheme v2.
Fixes #51831
The benefits of board and SoC scheme v2 are:
BOARD
setting from CMakeBOARD
is passed from CMake --> Kconfig to the wayBOARD_REVISION
is handledzephyr/main
today then the SoC is set in a config file instead of being selected directly by the board.This can be confusing to new-comers, as they might wonder if an SoC can be changed because all SoCs in Zephyr appears in a choice menu in
menuconfig
Changing an SoC without a pristine build is not supported or tested, so no reason to expose such options directly to users.
select
other settings that it requires and not expect all those settings being defined in config files.Note, there is no requirement for existing boards or SoCs to be updated to v2, but if a board and SoC want to benefit from above, then they can of course be updated.
Draft PR until all above requirements has been implemented.