-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
DT: accept standard syntax for phandle in chosen node #21623
Comments
There's no special handling for properties in Seems to be used with path references in Linux too. See e.g.
|
There's no On the |
Added support for a |
@ulfalizer, thank you for the fast response. I applied #21625 to Zephyr and also use the changed edtlib.py for code generation. It works, thanks! I now use the path type in the 'chosen' binding:
Out of curiosity I tested the following chosen node:
I works too. I assume it only works because the EDT.chosen_node() helper is never called for "stdout-path", which is okay for me because the non Zephyr properties in the chosen node are only used in code generation. |
Yup, the type is only checked if |
Add binding support for a 'path' property type, for properties that are assigned node paths. Usually, paths are assigned with path references like 'foo = &label' (common in /chosen), but plain strings are accepted as well as long as they're valid paths. The 'path' type is mostly for completeness at this point, but might be useful for zephyrproject-rtos#21623. The support is there already in dtlib. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add binding support for a 'path' property type, for properties that are assigned node paths. Usually, paths are assigned with path references like 'foo = &label' (common in /chosen), but plain strings are accepted as well as long as they're valid paths. The 'path' type is mostly for completeness at this point, but might be useful for #21623. The support is there already in dtlib. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
#21625 works for me. Will go on with the idea to attach a default binding to the chosen node. |
Is your enhancement proposal related to a problem? Please describe.
I am using a modified edtlib to preprocess the DT for code generation. The modified variant can attach a binding to the chosen node. This is mostly for error detection but also to create some chosen properties for OOT usage.
The edtlib normal node handling, which is enforced by using the binding for chosen, expects standard syntax for a phandle.
Zephyr edtlib/dtlib expects a special syntax in the chosen node (which IMO is not in line with the device tree specification):
The Zephyr build process uses the unmodified edtlib and bails out while in kconfig:
Describe the solution you'd like
Make the DT chosen node accept standard syntax for phandle.
Ideally treat the chosen node as a normal node with an (automagically) attached binding. Change the device tree to use standard syntax in chosen nodes. This allows all types of values in the chosen node; not only phandles as it is the case currently.
Additional context
Modifications to edtlib that allows the /chosen node to be handled as a normal node with a compatible 'chosen' binding:
In Node class:
In edtlib.py on global scope:
The 'chosen' binding:
The text was updated successfully, but these errors were encountered: