-
Notifications
You must be signed in to change notification settings - Fork 56
lopper: assists: gen_domain_dts: Ensure correct serial is used #667
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
Open
bentheredonethat
wants to merge
1
commit into
devicetree-org:master
Choose a base branch
from
bentheredonethat:gen-domain-zeph-chosen-serial
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeddii : the requirement here is to have a different serial for Zephyr and Linux should it be derived from domain yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better phrasing is: should the serial device be specified in the domain (whether it is in yaml or not isn't the important part) ?
It could be in the access_list, and if so, we could then make sure that the domain_access assist pruned out unreferenced serial devices. Which may not be the key question here, since from the patch description, it more sounds like the chosen node needs to be updated to match the serial. If so, that is something that could be done in the more generic assists.
But I need more information on the complete flow, as just looking at this change to the assist, isn't giving me enough context to say whether or not we can do something generically for this (which is the preference).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zeddii i think we agree
I want to (a) declare the serial in the access list and (b) then have whichever plugin setups zephyr DT (in this case gen domain plugin) then read the existing serial node and set u the chosen:zephyr properties correctly.
I checked and @sstabellini was OK with the domain access approach. Note that even if we do that, this logic or something similar is needed to ensure the chosen node gets in correctly.
Thanks
CC @kedareswararao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bentheredonethat may i know the end to end case that you are trying to fix here. Do you have domain.yaml in this flow?
For example you have 2 uarts present in the SDT and chosen node in SDT has uart0. Now, in the domains yaml, if one uart(i.e uart0) is assigned to Linux domain and uart1 is assigned to Zephyr domain, are you trying to update chosen node with uart1 in zephyr dt? is my understanding correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivadur : what's your take on this? could you please provide your inputs here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. so thinking on this more. Do the other serial devices carry through to the domain DTS ? i.e. is there one active one and others in the final ?
The reason I ask, is that passing special flags or making special key-value pairs in the domains.yaml ends up making things inflexible over time.
Similar to other things that we've done, if there was only one serial device that went through, we could just prune out all unreferenced serial devices (consistent with other processing), and then the OS specific assist would know that the serial left in the device tree (or domain, since we maintain that in the SDT) needs to be promoted / made available to the OS .. so for linux that would be putting it into the chosen node, and other OSs would do os-specirfic things.
If that doesn't work, the next question is: if we know the serial we want to the point where we can put it into the domains.yaml, what is the relationship to the SDT ? i.e. can we find the node in the SDT and just update the chosen node directly ?
Barring that, something more generic in the assist like simply a "chosen;" property being found (so just an empty chosen key value pair in the domains.yaml or just chosen; in dts) means that whatever node this is, should be copied into the chosen node. But that binds us to linux and chosen, which is less than ideal.
lops can also easily handle this and be more flexible, remember lops should be considered and not just drive everything into assists.
Going back to the "chosen" property I mentioned, something more generic like "copy_to: chosen" would allow us to generically tag a node/property and copy it to somewhere else (in this case chosen), but again, lops can also do that quite easily.
Sorry for the slow reply, I wasn't sure if you were waiting on me to answer or not!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivadur yes exactly
there are 2 UARTs for a given domain so we need way to define the chosen node properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivadur the thing is - even if we use domain-access as is - there are default chosen node values coming through - for linux from the SDT
We need someway to have the domain-configured chosen values for the zephr domain DT now