mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-02 04:21:32 +00:00
dtoc: Update dtb_platdata to support Python 3
The only change needed is to update get_value() to support the 'bytes' type correctly with Python 3. With this the dtoc unit tests pass with both Python 2 and 3: PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt python \ ./tools/dtoc/dtoc -t PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman python3 \ ./tools/dtoc/dtoc -t Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
209a55976b
commit
9b044f7e3d
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ import sys
|
||||||
|
|
||||||
import fdt
|
import fdt
|
||||||
import fdt_util
|
import fdt_util
|
||||||
|
import tools
|
||||||
|
|
||||||
# When we see these properties we ignore them - i.e. do not create a structure member
|
# When we see these properties we ignore them - i.e. do not create a structure member
|
||||||
PROP_IGNORE_LIST = [
|
PROP_IGNORE_LIST = [
|
||||||
|
@ -99,7 +100,7 @@ def get_value(ftype, value):
|
||||||
if ftype == fdt.TYPE_INT:
|
if ftype == fdt.TYPE_INT:
|
||||||
return '%#x' % fdt_util.fdt32_to_cpu(value)
|
return '%#x' % fdt_util.fdt32_to_cpu(value)
|
||||||
elif ftype == fdt.TYPE_BYTE:
|
elif ftype == fdt.TYPE_BYTE:
|
||||||
return '%#x' % ord(value[0])
|
return '%#x' % tools.ToByte(value[0])
|
||||||
elif ftype == fdt.TYPE_STRING:
|
elif ftype == fdt.TYPE_STRING:
|
||||||
return '"%s"' % value
|
return '"%s"' % value
|
||||||
elif ftype == fdt.TYPE_BOOL:
|
elif ftype == fdt.TYPE_BOOL:
|
||||||
|
|
Loading…
Add table
Reference in a new issue