dtoc: Update fdt_util for Python 3
authorSimon Glass <sjg@chromium.org>
Sat, 18 May 2019 04:00:42 +0000 (22:00 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:58 +0000 (16:52 -0600)
commit209a55976bd2aa4ba7e70b263a70fa14dd0c7675
tree872800b2c6f115a022135c900bb1adc5c41bfc8f
parentb5f0dafd4b66f8fde3c968ec20186bc8465558b8
dtoc: Update fdt_util for Python 3

Since we are now using the bytes type in Python 3, the conversion in
fdt32_to_cpu() is not necessary, so drop it.

Also use 'int' instead of 'long' to convert the integer value, since
'long' is not present in Python 3.

With this, test_fdt passes with both Python 2 and 3:

PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt python \
./tools/dtoc/test_fdt -t

PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman python3 \
./tools/dtoc/test_fdt -t

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/fdt_util.py
tools/dtoc/test_fdt.py