-
Notifications
You must be signed in to change notification settings - Fork 7.4k
dts: edtlib: Turn Node.instance_no into more flexible EDT.compat2nodes #21592
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
Conversation
CC @nandojve |
Bit arbitrary that |
Nice! This is a missing common point for Now it will be nice to have a
to
It's just a dream! |
Add a dictionary EDT.compat2nodes that maps each compatible that appears on some enabled node to a list of enabled nodes that implement the compatible. For example, EDT.compat2nodes["foo"] is a list of all enabled nodes whose 'compatible' includes "foo". The old Node.instance_no functionality can easily be implemented in terms of EDT.compat2nodes, so get rid of Node.instance_no. EDT.compat2nodes is more powerful and easier to understand. Simplify main() in gen_defines.py a bit by using EDT.compat2nodes to generate the DT_COMPAT_<compatible> existence macros. The behavior is slightly different now, as DT_COMPAT_<compatible> is generated for enabled nodes that don't have a binding as well, but that might be an improvement overall, and probably doesn't hurt. EDT.compat2nodes will make the implementation of the new $(dt_compat_get_str) preprocessor function in zephyrproject-rtos#21560 cleaner and simpler. That was the original motivation. Signed-off-by: Ulf Magnusson <[email protected]>
c03cbe7
to
b63db3b
Compare
All checks passed. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
Rebased and improved version: #22250 |
Add a dictionary EDT.compat2nodes that maps each compatible that appears
on some enabled node to a list of enabled nodes that implement the
compatible. For example, EDT.compat2nodes["foo"] is a list of all
enabled nodes whose 'compatible' includes "foo".
The old Node.instance_no functionality can easily be implemented in
terms of EDT.compat2nodes, so get rid of Node.instance_no.
EDT.compat2nodes is more powerful and easier to understand.
Simplify main() in gen_defines.py a bit by using EDT.compat2nodes to
generate the DT_COMPAT_ existence macros. The behavior is
slightly different now, as DT_COMPAT_ is generated for
enabled nodes that don't have a binding as well, but that might be an
improvement overall, and probably doesn't hurt.
EDT.compat2nodes will make the implementation of the new
$(dt_compat_get_str) preprocessor function in
#21560 cleaner and
simpler. That was the original motivation.