blob: 6b572483e7fe514b34018a2e35716ad7f1c2e0ba [file] [log] [blame]
Simon Glassec564b42016-07-04 11:58:08 -06001#!/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
9import struct
10
Simon Glassec564b42016-07-04 11:58:08 -060011def 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]