blob: 54a3ef2e46e97bd4338f6571cdc2179322f9a710 [file] [log] [blame]
Simon Glassba482582016-07-25 18:59:02 -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
9# Bring in either the normal fdt library (which relies on libfdt) or the
10# fallback one (which uses fdtget and is slower). Both provide the same
11# interface for this file to use.
Simon Glass160a7662017-05-27 07:38:26 -060012import fdt_normal
Simon Glassba482582016-07-25 18:59:02 -060013
Simon Glass160a7662017-05-27 07:38:26 -060014def FdtScan(fname):
Simon Glassba482582016-07-25 18:59:02 -060015 """Returns a new Fdt object from the implementation we are using"""
Simon Glass160a7662017-05-27 07:38:26 -060016 dtb = fdt_normal.FdtNormal(fname)
Simon Glassba482582016-07-25 18:59:02 -060017 dtb.Scan()
18 return dtb