]> git.sur5r.net Git - u-boot/blobdiff - tools/dtoc/fdt_util.py
rockchip: pinctrl: rk3399: add support for the HDMI I2C pins
[u-boot] / tools / dtoc / fdt_util.py
index 3a108381099e613a81fdf62e2f4727b8fb034b31..b9dfae8d0e7b606c28fac252f82afcaef801fe49 100644 (file)
@@ -8,6 +8,7 @@
 
 import os
 import struct
+import sys
 import tempfile
 
 import command
@@ -22,6 +23,10 @@ def fdt32_to_cpu(val):
     Return:
         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]
 
 def EnsureCompiled(fname):