devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Subject: Re: DTC failure on /memreserve/ if moved after /include/
Date: Tue, 3 May 2011 11:01:28 +1000	[thread overview]
Message-ID: <20110503010128.GA3361@yookeroo> (raw)
In-Reply-To: <E1QH0Jd-0004yN-6V-CYoMK+44s/E@public.gmane.org>

On Mon, May 02, 2011 at 04:06:01PM -0500, Jon Loeliger wrote:
> > The following from tegra-harmony.dts compiles fine:
> > 
> >     /dts-v1/;
> > 
> >     /memreserve/ 0x1c000000 0x04000000;
> >     /include/ "tegra250.dts"
> > 
> >     / {
> > 
> > However, if I re-order this as follows:
> > 
> >     /dts-v1/;
> >     /include/ "tegra250.dts"
> > 
> >     /memreserve/ 0x1c000000 0x04000000;
> > 
> >     / {
> > 
> > Then dtc fails:
> >
> > Is this a dtc bug, or does the DTS syntax actually disallow this?
> 
> 
> Correct.  The grammar is explicitly:
> 
>     sourcefile:
> 	      DT_V1 ';' memreserves devicetree
> 	    ;
> 
>     memreserves:
> 	      /* empty */
> 	    | memreserve memreserves
> 	    ;
> 
>     memreserve:
> 	      DT_MEMRESERVE addr addr ';'
> 
> 
> and then much later devicetree leads to...:
> 
> 
>     propdata:
> 	      propdataprefix DT_STRING
> 	    | propdataprefix '<' celllist '>'
> 	    | propdataprefix '[' bytestring ']'
> 	    | propdataprefix DT_REF
> 	    | propdataprefix DT_INCBIN '(' DT_STRING ',' addr ',' addr ')'
> 
> where INCBIN is the include mechanism.

Uh, no, incbin is different.  /include/ is processed at the lexical
level and can appear in any order.

What matters here is not the /include/ per se, but what appears in the
included file.  I imagine it has some device tree content, and
/memreserve/ can't appear after that.

-- 
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

  parent reply	other threads:[~2011-05-03  1:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 18:54 DTC failure on /memreserve/ if moved after /include/ Stephen Warren
     [not found] ` <74CDBE0F657A3D45AFBB94109FB122FF0497F1B1BF-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-02 20:13   ` Grant Likely
2011-05-02 21:06   ` Jon Loeliger
     [not found]     ` <E1QH0Jd-0004yN-6V-CYoMK+44s/E@public.gmane.org>
2011-05-03  1:01       ` David Gibson [this message]
2011-05-03 13:48         ` Jon Loeliger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110503010128.GA3361@yookeroo \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).