-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Scaling of board overlay mechanism #90750
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
Comments
This is a good solution for most STM32 boards. |
the overlay usually have 3 type of contents:
so I do not think the soc is a good place to go, instead if you looking above, the good place will be item 1 and 2 goes to board |
This issue is very meta and involves every aspect of zephyr I suspect:
Some of the tests/samples with the most overlays used to deal with different HW directly in the test code using ifdefs (we have some of those tests still), at some point we moved to overlays and removed some of the complexity from the tests, however, IMO this was just a stopgap and we move the problem somewhere else. Looking at many of those overlays you notice lots of duplicatiion and some patterns that we should resolve and fix somewhere else I think so we do not have to add an overlay for each board in each test. Beside DTS, there is Kconfig part which is suffers against the same problem. Soc overlays would reduce the number of files if the number of files was the problem, however we need to look at further abstraction or some common "language" when dealing with drivers and peripherals without having to provide a DTS/Kconfig overlay for every single other board. More thoughts/input would be appreciated, need more people looking at this. |
For the comparator build_all tests, I created multiple "soc specific" overlays and included them for a range of boards which contain the socs I care about: zephyr/tests/drivers/build_all/comparator/testcase.yaml Lines 17 to 52 in 11c543e
this could be extended to point to an "soc specific" CONF file as well. Its not the pretties thing, but its functional :) (ignore the duplicate nrf54l one, that was not intended) |
Agreed.
@hakehuang Could you please elaborate a bit on this suggestion? |
|
How will this reduce the number of overlay files needed? |
This comment has been minimized.
This comment has been minimized.
take this commit as example, |
This would also work for RP2040, and RP235xx SoCs. It's also been proposed before, e.g. use some heirachy of directories, e.g.:
At the moment I misuse(?) the pre-processor, and #include one overlay from the others. |
Uh oh!
There was an error while loading. Please reload this page.
Is your enhancement proposal related to a problem? Please describe.
There are thousands of overlay files located under sample/* and tests/* ... */boards/. E.g. https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/uart/uart_async_api/boards (142 files)
https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/dma/chan_blen_transfer/boards (173 files).
Every time someone wants to add a support of such tests on another board they have to add extra board specific overlays. In many cases such overlays are yet another copy of the same file, just with a different name.
Such mechanism doesn't scale.
Additional context
We discussed the toping during testing wg meetings and we don't know how it can be changed. Maybe there won't be a single solution, but a combination of several, including rework of some tests. One approach is proposed by @hakehuang which allows for reuse of the same overlay files by multiple boards, at the cost of adding entries in test yaml responsible for mapping such boards with more general overlays https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/uart/uart_async_api/testcase.yaml#L87. However, it can significantly increase complexity of test yaml resulting with tests with hundreds of namespaced configs.
Other idea is to move some implementation of overlays to a board/soc/variant/more general level, as a kind of an extension, that could be added (and reused) whenever such overlay is requested by tests?
We might also need to rethink of how overlays are applied, possibly using SoC overlays or feature-based overlays instead of board-specific ones.
As a testing working group we wanted to flag the issue of "exploding" overlays and ask other maintainers for their take on it and possible solutions.
The text was updated successfully, but these errors were encountered: