-
Notifications
You must be signed in to change notification settings - Fork 231
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
Codify array values syntax #66
Comments
There's 2 things here I think. Just defining best practice or .dts coding style. That would be good I think, but I don't think that belongs in the spec (though could be an appendix). This is also something tools can check, so I'd rather see tools for this first rather than an appendix for people to ignore. We went down this path effectively trying to enforce some bracketing practice when dtschema relied on bracketing. There's a bunch of patches changing .dts files for that. That hit a roadblock in dtc when I tried to output brackets using the knowledge the dtc checks already has. That was needed when checking of DTBs was needed where we don't have any DTS and any and all bracketing is lost. Anyway, any checks of bracketing are gone, but I would like to see some separate tool do that and other things. A DTS linter essentially (which has come up before: devicetree-org/dt-schema#18). The 2nd thing here sounds like generating #foo-cells based on brackets (or from phandles in the phandle+args style bindings). Like dtschema, that's probably a deadend in dtc. I think it falls into a larger topic of defining a higher level syntax than DTS (or DTSv2 maybe). The systemdt folks are doing some of this I think including just what you described. Take a look at lopper or talk to @zeddii perhaps. |
I was doing the dishes and suddenly had this idea... things like this could be required in a theoretical There are some rough edges (like this one) that could be polished if things got less ambiguous, while retaining compatibility with what's here today. Another thing that immediately comes to mind is going little endian. |
Currently dtc happily eats both:
in the same way as:
so long as the -cells values match.
Requiring the second format (one entry per
<...>
) would allow to dynamically derive-cells
values and reduce boilerplate (by e.g. defaulting to#address-cells == #size-cells == <2>
whenARRAY_SIZE(reg)
is a multiple of 4 etc., while still allowing to manually override it where it's not obvious.The text was updated successfully, but these errors were encountered: