diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-11-07 11:17:17 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-11-08 11:14:07 -0600 |
commit | 9138db565adeb2fbba3181fb589f1c9a3f818dde (patch) | |
tree | 35b08ec37d66bf2ff242103c580214a4f9ebadec /dtc-parser.y | |
parent | 9ed27a2aac6f7bbbb16d48854763a6d79f6a9857 (diff) | |
download | dtc-9138db565adeb2fbba3181fb589f1c9a3f818dde.zip dtc-9138db565adeb2fbba3181fb589f1c9a3f818dde.tar.gz dtc-9138db565adeb2fbba3181fb589f1c9a3f818dde.tar.bz2 |
dtc: Switch dtc to C-style literals
dtc: Switch dtc to C-style literals
This patch introduces a new version of dts file, distinguished from
older files by starting with the special token /dts-v1/. dts files in
the new version take C-style literals instead of the old bare hex or
OF-style base notation. In addition, the "range" for of memreserve entries
(/memreserve/ f0000-fffff) is no longer recognized in the new format.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r-- | dtc-parser.y | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/dtc-parser.y b/dtc-parser.y index 5ac3db7..d998bfe 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -48,9 +48,11 @@ extern struct boot_info *the_boot_info; struct reserve_info *re; } +%token DT_V1 %token DT_MEMRESERVE %token <propnodename> DT_PROPNODENAME %token <literal> DT_LITERAL +%token <literal> DT_LEGACYLITERAL %token <cbase> DT_BASE %token <byte> DT_BYTE %token <data> DT_STRING @@ -61,6 +63,8 @@ extern struct boot_info *the_boot_info; %type <data> propdataprefix %type <re> memreserve %type <re> memreserves +%type <re> v0_memreserve +%type <re> v0_memreserves %type <addr> addr %type <data> celllist %type <cbase> cellbase @@ -78,7 +82,11 @@ extern struct boot_info *the_boot_info; %% sourcefile: - memreserves devicetree + DT_V1 ';' memreserves devicetree + { + the_boot_info = build_boot_info($3, $4); + } + | v0_memreserves devicetree { the_boot_info = build_boot_info($1, $2); } @@ -100,6 +108,24 @@ memreserve: { $$ = build_reserve_entry($3, $4, $1); } + ; + +v0_memreserves: + /* empty */ + { + $$ = NULL; + } + | v0_memreserve v0_memreserves + { + $$ = chain_reserve_entry($1, $2); + }; + ; + +v0_memreserve: + memreserve + { + $$ = $1; + } | label DT_MEMRESERVE addr '-' addr ';' { $$ = build_reserve_entry($3, $5 - $3 + 1, $1); @@ -109,6 +135,10 @@ memreserve: addr: DT_LITERAL { + $$ = eval_literal($1, 0, 64); + } + | DT_LEGACYLITERAL + { $$ = eval_literal($1, 16, 64); } ; @@ -211,7 +241,11 @@ cellbase: ; cellval: - cellbase DT_LITERAL + DT_LITERAL + { + $$ = eval_literal($1, 0, 32); + } + | cellbase DT_LEGACYLITERAL { $$ = eval_literal($2, $1, 32); } |