Skip to content

Conversation

@galak
Copy link
Contributor

@galak galak commented Feb 11, 2020

Toying with the idea, so hacked something to show the ability to generate struct's from DT nodes. Not sure if this is useful or not, but wanted to put it out there for thought.

Signed-off-by: Kumar Gala <[email protected]>
@pabigot
Copy link
Contributor

pabigot commented Feb 11, 2020

Might have potential but we need to see how it looks when things are generated, especially for complex node content and non-required properties.

@zephyrbot
Copy link

Some checks failed. Please fix and resubmit.

Gitlint issues

1: UC3 Title does not follow [subsystem]: [subject] (and should not start with literal subsys:): "hack to generate structs"
1: UC6 Body has no content, should at least have 1 line.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@galak
Copy link
Contributor Author

galak commented Feb 11, 2020

Might have potential but we need to see how it looks when things are generated, especially for complex node content and non-required properties.

Yeah, we should really be generating this based on the binding not on the device node itself.

@galak
Copy link
Contributor Author

galak commented Feb 11, 2020

Could see some value for pinmux.

@pabigot
Copy link
Contributor

pabigot commented Feb 11, 2020

Yeah, we should really be generating this based on the binding not on the device node itself.

I didn't realize it wasn't based on the binding. Yes, it should come from the binding and go into some header somewhere that need only be included by modules that need it.

@mbolivar
Copy link
Contributor

Agree that generating structs from a node should come from the binding.

I also hope we can take this new development as a chance to get away from the label property being so central, and find a solution for emitting structures which convert phandles to real pointers to the corresponding struct devices.

@galak galak added area: Devicetree Tooling PR modifies or adds a Device Tree tooling DNM This PR should not be merged (Do Not Merge) labels Feb 13, 2020
@erwango erwango requested a review from tbursztyka March 9, 2020 09:57
@galak galak closed this Apr 7, 2020
@galak galak deleted the dt-hack-struct-gen branch April 7, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Tooling PR modifies or adds a Device Tree tooling DNM This PR should not be merged (Do Not Merge)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants