devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DTC failure on /memreserve/ if moved after /include/
@ 2011-05-02 18:54 Stephen Warren
       [not found] ` <74CDBE0F657A3D45AFBB94109FB122FF0497F1B1BF-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2011-05-02 18:54 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

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:

      DTC     arch/arm/boot/tegra-harmony.dtb
    DTC: dts->dtb  on file "arch/arm/boot/dts/tegra-harmony.dts"
    Error: arch/arm/boot/dts/tegra-harmony.dts:4.1-13 syntax error
    FATAL ERROR: Unable to parse input tree
    make[1]: *** [arch/arm/boot/tegra-harmony.dtb] Error 1

Is this a dtc bug, or does the DTS syntax actually disallow this?

Thanks.

-- 
nvpublic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DTC failure on /memreserve/ if moved after /include/
       [not found] ` <74CDBE0F657A3D45AFBB94109FB122FF0497F1B1BF-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2011-05-02 20:13   ` Grant Likely
  2011-05-02 21:06   ` Jon Loeliger
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Likely @ 2011-05-02 20:13 UTC (permalink / raw)
  To: Stephen Warren; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

cc'ing David Gibson and Jon Loeliger who both can do a better job of
answering this question.

g.


On Mon, May 2, 2011 at 12:54 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> 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:
>
>      DTC     arch/arm/boot/tegra-harmony.dtb
>    DTC: dts->dtb  on file "arch/arm/boot/dts/tegra-harmony.dts"
>    Error: arch/arm/boot/dts/tegra-harmony.dts:4.1-13 syntax error
>    FATAL ERROR: Unable to parse input tree
>    make[1]: *** [arch/arm/boot/tegra-harmony.dtb] Error 1
>
> Is this a dtc bug, or does the DTS syntax actually disallow this?
>
> Thanks.
>
> --
> nvpublic
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DTC failure on /memreserve/ if moved after /include/
       [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>
  1 sibling, 1 reply; 5+ messages in thread
From: Jon Loeliger @ 2011-05-02 21:06 UTC (permalink / raw)
  To: Stephen Warren; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

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

jdl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DTC failure on /memreserve/ if moved after /include/
       [not found]     ` <E1QH0Jd-0004yN-6V-CYoMK+44s/E@public.gmane.org>
@ 2011-05-03  1:01       ` David Gibson
  2011-05-03 13:48         ` Jon Loeliger
  0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2011-05-03  1:01 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DTC failure on /memreserve/ if moved after /include/
  2011-05-03  1:01       ` David Gibson
@ 2011-05-03 13:48         ` Jon Loeliger
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Loeliger @ 2011-05-03 13:48 UTC (permalink / raw)
  To: David Gibson; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

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

Crap.  Got confused.  Sorry.

jdl

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-03 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-05-03 13:48         ` Jon Loeliger

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