]> git.sur5r.net Git - u-boot/blob - tools/dtoc/fdt_util.py
6b572483e7fe514b34018a2e35716ad7f1c2e0ba
[u-boot] / tools / dtoc / fdt_util.py
1 #!/usr/bin/python
2 #
3 # Copyright (C) 2016 Google, Inc
4 # Written by Simon Glass <sjg@chromium.org>
5 #
6 # SPDX-License-Identifier:      GPL-2.0+
7 #
8
9 import struct
10
11 def fdt32_to_cpu(val):
12     """Convert a device tree cell to an integer
13
14     Args:
15         Value to convert (4-character string representing the cell value)
16
17     Return:
18         A native-endian integer value
19     """
20     return struct.unpack(">I", val)[0]