fdt: Support use of the new python libfdt library
Use the new library if available, while retaining backwards compatibility
with the old library for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 816fdbe..c40b9b6 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -96,6 +96,7 @@
TYPE_INT: a byte-swapped integer stored as a 4-byte string
TYPE_BYTE: a byte stored as a single-byte string
"""
+ bytes = str(bytes)
size = len(bytes)
strings = bytes.split('\0')
is_string = True