DTC failure on /memreserve/ if moved after /include/
David Gibson
david at gibson.dropbear.id.au
Tue May 3 11:01:28 EST 2011
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
More information about the devicetree-discuss
mailing list