Skip to content
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

phandle property uniqueness #37

Closed
andreeaflorescu opened this issue Sep 1, 2021 · 1 comment
Closed

phandle property uniqueness #37

andreeaflorescu opened this issue Sep 1, 2021 · 1 comment

Comments

@andreeaflorescu
Copy link
Member

The phandle property can be used to reference another node within the FDT uniquely: https://devicetree-specification.readthedocs.io/en/stable/devicetree-basics.html?#phandle

Right now we are not checking the uniqueness of the phandle, and I think there are a few things that we can do:

  • create a public API for retrieving a unique phandle, similar to what is implemented in libfdt: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/scripts/dtc/libfdt/fdt_ro.c#L114
  • add support for the phandle property; we could for example offer an API for setting the phandle of a node (once we clean up the abstractions to have a clear ownership between nodes & properties), and in the set function we can check for uniqueness. This would imply denying adding properties with the name phandle, or just check the name of the property, and in case it is phandle, check for uniqueness. It looks like this adds branching in the code, and we should discuss if we just want to go ahead with documenting this, or enforcing it.
@andreeaflorescu
Copy link
Member Author

Fixed by #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant