Alter grammar to allow multiple /dts-v1/ tags

This patch allows dtc to accept multiple /dts-v1/ tags (provided they're
all at the beginning of the input), rather than giving a syntax error.

This makes it more convenient to include one .dts file from another without
having to be careful that the /dts-v1/ tag is in exactly one of them.

We a couple of existing testcases to take advantage of this, which
simplifies them slightly.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2014-06-02 15:23:40 +10:00
parent d71d25d760
commit c4cb12e193
4 changed files with 52 additions and 48 deletions

View file

@ -101,13 +101,18 @@ extern bool treesource_error;
%%
sourcefile:
DT_V1 ';' memreserves devicetree
v1tag memreserves devicetree
{
the_boot_info = build_boot_info($3, $4,
guess_boot_cpuid($4));
the_boot_info = build_boot_info($2, $3,
guess_boot_cpuid($3));
}
;
v1tag:
DT_V1 ';'
| DT_V1 ';' v1tag
;
memreserves:
/* empty */
{