Open MrVan opened 3 years ago
having that it would be great and I'm totally for it. But being a huge change for Zephyr I think that needs to be discussed. So I'm tagging a few people that can have something to say about this. @pabigot @nashif @ioannisg @mbolivar-nordic @galak
I don't think this makes sense in general as the reason we generate code/defines from devicetree is size / footprint for the majority of systems that utilize Zephyr.
So having a DTB and the associated code to parse it at runtime is overhead that isn't acceptable for those systems.
As we need to maintain support for a non-runtime devicetree usage, not sure what supporting runtime devicetree would get us?
This could be useful for more complex applications. Once we start supporting devices that are left off on startup, and only turned on by the application, a natural extension is to support that with runtime configuration of available devices ("DT overlays" the way Linux supports them through an API).
Using DTB for describing those devices makes more sense than coming up with a home-grown solution.
So having a DTB and the associated code to parse it at runtime is overhead that isn't acceptable for those systems.
Agree, but nothing prevents us to have both the solutions in place right? For example having a small DT in-memory parsing library to link only when needed.
Agree, but nothing prevents us to have both the solutions in place right? For example having a small DT in-memory parsing library to link only when needed.
Agreed, would like to see a proposal as to what that might look like. What the benefits would be, etc.
Agree, but nothing prevents us to have both the solutions in place right? For example having a small DT in-memory parsing library to link only when needed.
define "small" :) But yes, I do agree with the ability to do that as long as it's always opt-in. It's a bit like userspace support, which is a feature that makes little sense in the smallest devices but can be very useful on the more powerful ones.
There's a few components here:
In exchange, you gain "easy" support for a family of related boards.
Note a few limitations (some surmountable):
All told? I understand why e.g. Linux does it; for the usecases I'm interested in, I doubt you'd use runtime devicetree support. It's way overkill for e.g. "hey, I want to change this one feature of this one driver across these two boards", or "hey, I want to only boot up the e.g. I2C driver if this board has something attached to I2C", and comes at a cost.
I don't have an issue with Zephyr adding optional runtime devicetree support, so long as the support is actually optional, and doesn't come at a cost of compile-time devicetree support. (Or, to elaborate on that a little. One "classic" failure mode of such things is the "old" feature rapidly becomes a second-class citizen because many things gratuitously rely on the New Shiny feature.)
(I am mildly concerned about tying post-boot driver configuration to runtime DTS, for instance.)
I think we all agree this could never be made mandatory even if it gets implemented.
I don't have any uses for runtime DT parsing personally and I would be quite concerned about potential extra complexity if we introduce it as an option. However, I'd be open to seeing how it works if someone has an RFC.
And this will make life easier when porting drivers to Zephyr.
If they are Linux drivers, you can't copy the code anyway for license reasons. I know some BSDs use DT as well but I'm honestly not convinced that this should be a goal. The zephyr device model is so different that I'm not sure I see how the DT conversion is really the hard part here.
Hi @galak,
This issue, marked as an RFC, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.
Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.
@MrVan you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.
Thanks!
The current Zephyr driver use compiling time device tree info. To make it flexible, I am thinking the support for runtime parsing device tree for aarch64 which is more powerful. And this will make life easier when porting drivers to Zephyr.
@carlocaione @sandeepbrcm @jharris-intel