* Overlay syntactic sugar clarification @ 2018-01-09 5:36 Kyle Evans [not found] ` <CACNAnaFASS-1dC4Vp7JbwEjtF0vbAxOP248AtPabPLhZ_MHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Kyle Evans @ 2018-01-09 5:36 UTC (permalink / raw) To: David Gibson; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA Hello! I see the syntactic sugar patch was merged in late September this year. I have some resulting questions: 1.) Are there plans to deprecate the handcrafted fragment syntax? I find it somewhat useful for hacking things into /soc (via target-path) for development since this node is often not labelled, so it's probably a good idea to ask this up front. =) 2.) Is it expected and/or OK that the output/behavior of this dtc(1) gets kind of funky when combining handcrafted fragments with these generated fragments? "funky" ranges from outright errors to silently merging a handcrafted fragment into a generated fragment in a way that yields an overlay that you're definitely not expecting. If this isn't a supported use-case, then I suppose this is OK. I ask because I recently implemented this syntax into our BSDL dtc, and naturally in my work I had it generate fragments for these nodes, merge them all into one /, and renumber any handcrafted fragments based on their position and the "fragment delta" (highest generated auto-fragment at that point). The reasoning being that there's likely no good way to merge a manual fragment with one of these auto-fragments, and with our implementation is was almost easier to do this than it is to just discard the handcrafted if we start out with the sugary versions. Thanks, Kyle Evans ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CACNAnaFASS-1dC4Vp7JbwEjtF0vbAxOP248AtPabPLhZ_MHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Overlay syntactic sugar clarification [not found] ` <CACNAnaFASS-1dC4Vp7JbwEjtF0vbAxOP248AtPabPLhZ_MHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-01-09 16:50 ` Kyle Evans 2018-01-10 8:43 ` David Gibson 1 sibling, 0 replies; 3+ messages in thread From: Kyle Evans @ 2018-01-09 16:50 UTC (permalink / raw) To: David Gibson; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA On Mon, Jan 8, 2018 at 11:36 PM, Kyle Evans <kevans-h+KGxgPPiopAfugRpC6u6w@public.gmane.org> wrote: > Hello! > > I see the syntactic sugar patch was merged in late September this > year. I have some resulting questions: > > 1.) Are there plans to deprecate the handcrafted fragment syntax? I > find it somewhat useful for hacking things into /soc (via target-path) > for development since this node is often not labelled, so it's > probably a good idea to ask this up front. =) > > 2.) Is it expected and/or OK that the output/behavior of this dtc(1) > gets kind of funky when combining handcrafted fragments with these > generated fragments? > > "funky" ranges from outright errors to silently merging a handcrafted > fragment into a generated fragment in a way that yields an overlay > that you're definitely not expecting. If this isn't a supported > use-case, then I suppose this is OK. > > I ask because I recently implemented this syntax into our BSDL dtc, > and naturally in my work I had it generate fragments for these nodes, > merge them all into one /, and renumber any handcrafted fragments > based on their position and the "fragment delta" (highest generated > auto-fragment at that point). > > The reasoning being that there's likely no good way to merge a manual > fragment with one of these auto-fragments, and with our implementation > is was almost easier to do this than it is to just discard the > handcrafted if we start out with the sugary versions. > > Thanks, > > Kyle Evans To be clear, I've tarred up three example DTS [1], with simple targets and property changes to demonstrate what I'm talking about. Files with the .reverse suffix have been added to show the results so that you don't necessarily need to compile/reverse them yourselves, but feel free to do so of course. =) example1 merges the explicit fragment@0 with the &a node appearing before it, clobbering the target to &b from the explicit fragment. example2 is a "working" example; &a takes the fragment@0 as expected and is merged with the root from the explicit fragment@1. example3 has fragment@2 explicitly defined, then later &d tries to take fragment@2 and dtc throws an error about the duplicate definitions. I don't expect this will be a practical problem for anyone, just thought it should be noted. Thanks, Kyle Evans [1] https://people.freebsd.org/~kevans/gpldtc/examples.tar ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Overlay syntactic sugar clarification [not found] ` <CACNAnaFASS-1dC4Vp7JbwEjtF0vbAxOP248AtPabPLhZ_MHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2018-01-09 16:50 ` Kyle Evans @ 2018-01-10 8:43 ` David Gibson 1 sibling, 0 replies; 3+ messages in thread From: David Gibson @ 2018-01-10 8:43 UTC (permalink / raw) To: Kyle Evans; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 2394 bytes --] On Mon, Jan 08, 2018 at 11:36:57PM -0600, Kyle Evans wrote: > Hello! > > I see the syntactic sugar patch was merged in late September this > year. I have some resulting questions: > > 1.) Are there plans to deprecate the handcrafted fragment syntax? I > find it somewhat useful for hacking things into /soc (via target-path) > for development since this node is often not labelled, so it's > probably a good idea to ask this up front. =) Hrm, I'd say we plan to "deprecate" in the sense of it not being the encouraged method. It's not really possible to actually remove support, since the overlay format is just a special form of a dtb. > 2.) Is it expected and/or OK that the output/behavior of this dtc(1) > gets kind of funky when combining handcrafted fragments with these > generated fragments? > > "funky" ranges from outright errors to silently merging a handcrafted > fragment into a generated fragment in a way that yields an overlay > that you're definitely not expecting. If this isn't a supported > use-case, then I suppose this is OK. Hm. So, I don't think we need to particularly accomodate mixed forms. But then, making it possible for the user to reason about what's going to happen even it odd circumstances is always better as much as possible. > I ask because I recently implemented this syntax into our BSDL dtc, > and naturally in my work I had it generate fragments for these nodes, > merge them all into one /, and renumber any handcrafted fragments > based on their position and the "fragment delta" (highest generated > auto-fragment at that point). The only reason I can see to use handcrafted fragments is to have great control over what's there. Renumbering hand written fragments seems to go against that. Allocating generated fragments to avoid handcrafted ones, or simply erroring sounds like a better idea. > The reasoning being that there's likely no good way to merge a manual > fragment with one of these auto-fragments, and with our implementation > is was almost easier to do this than it is to just discard the > handcrafted if we start out with the sugary versions. > > Thanks, > > Kyle Evans -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-10 8:43 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-01-09 5:36 Overlay syntactic sugar clarification Kyle Evans [not found] ` <CACNAnaFASS-1dC4Vp7JbwEjtF0vbAxOP248AtPabPLhZ_MHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2018-01-09 16:50 ` Kyle Evans 2018-01-10 8:43 ` David Gibson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).