aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/dtoc/fdt_util.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py
index e6d523b..b9dfae8 100644
--- a/tools/dtoc/fdt_util.py
+++ b/tools/dtoc/fdt_util.py
@@ -24,6 +24,8 @@ def fdt32_to_cpu(val):
A native-endian integer value
"""
if sys.version_info > (3, 0):
+ if isinstance(val, bytes):
+ val = val.decode('utf-8')
val = val.encode('raw_unicode_escape')
return struct.unpack('>I', val)[0]