clk: fixed-rate: Enable DM_FLAG_PRE_RELOC flag
[platform/kernel/u-boot.git] / tools / binman / etype / blob_ext.py
1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
4 #
5 # Entry-type module for external blobs, not built by U-Boot
6 #
7
8 import os
9
10 from binman.etype.blob import Entry_blob
11 from dtoc import fdt_util
12 from patman import tools
13 from patman import tout
14
15 class Entry_blob_ext(Entry_blob):
16     """Entry containing an externally built binary blob
17
18     Note: This should not be used by itself. It is normally used as a parent
19     class by other entry types.
20
21     If the file providing this blob is missing, binman can optionally ignore it
22     and produce a broken image with a warning.
23
24     See 'blob' for Properties / Entry arguments.
25     """
26     def __init__(self, section, etype, node):
27         Entry_blob.__init__(self, section, etype, node)
28         self.external = True
29
30     def ObtainContents(self):
31         self._filename = self.GetDefaultFilename()
32         self._pathname = tools.GetInputFilename(self._filename,
33                                                 self.section.GetAllowMissing())
34         # Allow the file to be missing
35         if not self._pathname:
36             self.SetContents(b'')
37             self.missing = True
38             return True
39         return super().ObtainContents()