mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-11 16:37:42 -04:00
Add support for YAML encoded output
YAML encoded DT is useful for validation of DTs using binding schemas. The YAML encoding is an intermediate format used for validation and is therefore subject to change as needed. The YAML output is dependent on DTS input with type information preserved. Signed-off-by: Grant Likely <grant.likely@arm.com> [robh: make YAML support optional, build fixes, Travis CI test, preserve type information in paths and phandles] Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
361b5e7d80
commit
c86da84d30
9 changed files with 307 additions and 2 deletions
|
|
@ -568,6 +568,14 @@ dtc_tests () {
|
|||
run_wrap_test cmp $tree $tree.test.dts
|
||||
done
|
||||
|
||||
# Check -Oyaml output
|
||||
if pkg-config --exists yaml-0.1; then
|
||||
for tree in type-preservation; do
|
||||
run_dtc_test -I dts -O yaml -o $tree.test.dt.yaml $tree.dts
|
||||
run_wrap_test cmp $tree.dt.yaml $tree.test.dt.yaml
|
||||
done
|
||||
fi
|
||||
|
||||
# Check version conversions
|
||||
for tree in test_tree1.dtb ; do
|
||||
for aver in 1 2 3 16 17; do
|
||||
|
|
|
|||
20
tests/type-preservation.dt.yaml
Normal file
20
tests/type-preservation.dt.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- '#address-cells': [[0x1]]
|
||||
'#size-cells': [[0x0]]
|
||||
subnode@1:
|
||||
compatible: ["subnode1"]
|
||||
reg: [[0x1]]
|
||||
int-array: [[0x0, 0x1], [0x2, 0x3]]
|
||||
int8: [!u8 [0x56]]
|
||||
int8-array: [!u8 [0x0, 0x12, 0x34, 0x56]]
|
||||
int16: [!u16 [0x3210]]
|
||||
int16-array: [!u16 [0x1234, 0x5678, 0x90ab, 0xcdef]]
|
||||
int16-matrix: [!u16 [0x1234, 0x5678], [0x90ab, 0xcdef]]
|
||||
int64: [!u64 [0x200000000]]
|
||||
int64-array: [!u64 [0x100000000, 0x0]]
|
||||
a-string-with-nulls: ["foo\0bar", "baz"]
|
||||
subsubnode:
|
||||
compatible: ["subsubnode1", "subsubnode"]
|
||||
subsubsubnode:
|
||||
compatible: ["subsubsubnode1", [0x1234], "subsubsubnode"]
|
||||
...
|
||||
Loading…
Add table
Add a link
Reference in a new issue