1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2018 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for U-Boot device tree files
10 from entry import Entry
11 from blob import Entry_blob
13 class Entry_blob_dtb(Entry_blob):
14 """A blob that holds a device tree
16 This is a blob containing a device tree. The contents of the blob are
17 obtained from the list of available device-tree files, managed by the
20 def __init__(self, section, etype, node):
21 Entry_blob.__init__(self, section, etype, node)
23 def ObtainContents(self):
24 """Get the device-tree from the list held by the 'state' module"""
25 self._filename = self.GetDefaultFilename()
26 self._pathname, data = state.GetFdtContents(self._filename)
27 self.SetContents(data)
30 def ProcessContents(self):
31 """Re-read the DTB contents so that we get any calculated properties"""
32 _, data = state.GetFdtContents(self._filename)
33 self.SetContents(data)