aboutsummaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
authorPantelis Antoniou <pantelis.antoniou@konsulko.com>2016-12-07 14:48:18 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-12-09 13:26:39 +1100
commit20f29d8d41f6d1bd2fbe466aa5676026eb012832 (patch)
tree1a988fa4e9da16bca01af7f43b99b75912142373 /dtc-parser.y
parenta2c92cac53f806e6c1936c1c522a6c24a5ec7199 (diff)
downloaddtc-20f29d8d41f6d1bd2fbe466aa5676026eb012832.zip
dtc-20f29d8d41f6d1bd2fbe466aa5676026eb012832.tar.gz
dtc-20f29d8d41f6d1bd2fbe466aa5676026eb012832.tar.bz2
dtc: Plugin and fixup support
This patch enable the generation of symbols & local fixup information for trees compiled with the -@ (--symbols) option. Using this patch labels in the tree and their users emit information in __symbols__ and __local_fixups__ nodes. The __fixups__ node make possible the dynamic resolution of phandle references which are present in the plugin tree but lie in the tree that are applying the overlay against. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y28
1 files changed, 25 insertions, 3 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index 14aaf2e..27d358f 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -19,6 +19,7 @@
*/
%{
#include <stdio.h>
+#include <inttypes.h>
#include "dtc.h"
#include "srcpos.h"
@@ -52,9 +53,11 @@ extern bool treesource_error;
struct node *nodelist;
struct reserve_info *re;
uint64_t integer;
+ unsigned int flags;
}
%token DT_V1
+%token DT_PLUGIN
%token DT_MEMRESERVE
%token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
%token DT_BITS
@@ -71,6 +74,8 @@ extern bool treesource_error;
%type <data> propdata
%type <data> propdataprefix
+%type <flags> versioninfo
+%type <flags> plugindecl
%type <re> memreserve
%type <re> memreserves
%type <array> arrayprefix
@@ -101,16 +106,33 @@ extern bool treesource_error;
%%
sourcefile:
- v1tag memreserves devicetree
+ versioninfo plugindecl memreserves devicetree
{
- the_boot_info = build_boot_info($2, $3,
- guess_boot_cpuid($3));
+ the_boot_info = build_boot_info($1 | $2, $3, $4,
+ guess_boot_cpuid($4));
+ }
+ ;
+
+versioninfo:
+ v1tag
+ {
+ $$ = DTSF_V1;
}
;
v1tag:
DT_V1 ';'
| DT_V1 ';' v1tag
+
+plugindecl:
+ DT_PLUGIN ';'
+ {
+ $$ = DTSF_PLUGIN;
+ }
+ | /* empty */
+ {
+ $$ = 0;
+ }
;
memreserves: