From 539aece516d87084437a38d879a1b91c661209f8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 14 Sep 2018 04:57:22 -0600 Subject: binman: Obtain the list of device trees from the config We always have a device tree for U-Boot proper. But we may also have one for SPL and TPL. Add a new Entry method to find out what DTs an entry has, and use that list when updating DTs. Signed-off-by: Simon Glass --- tools/binman/entry.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools/binman/entry.py') diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 4b87156ff80..e5f557749f6 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -18,6 +18,7 @@ except: have_importlib = False import os +from sets import Set import sys import fdt_util @@ -164,6 +165,20 @@ class Entry(object): def GetDefaultFilename(self): return None + def GetFdtSet(self): + """Get the set of device trees used by this entry + + Returns: + Set containing the filename from this entry, if it is a .dtb, else + an empty set + """ + fname = self.GetDefaultFilename() + # It would be better to use isinstance(self, Entry_blob_dtb) here but + # we cannot access Entry_blob_dtb + if fname and fname.endswith('.dtb'): + return Set([fname]) + return Set() + def AddMissingProperties(self): """Add new properties to the device tree as needed for this entry""" for prop in ['offset', 'size', 'image-pos']: -- cgit v1.2.3