aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:23:31 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:05 -0600
commit4bdd30055ca3a9096f462177758b97e55c15f1e7 (patch)
tree82a457491e4be44ee87e32ff890b681f4a7a600f /tools/binman/etype
parent726e2961291dec2c46d773866c5923210c3bac0f (diff)
downloadu-boot-4bdd30055ca3a9096f462177758b97e55c15f1e7.zip
u-boot-4bdd30055ca3a9096f462177758b97e55c15f1e7.tar.gz
u-boot-4bdd30055ca3a9096f462177758b97e55c15f1e7.tar.bz2
binman: Adjust GetFdt() to be keyed by etype
At present the FDTs are keyed by their default filename (not their actual filename). It seems easier to key by the entry type, since this is always the same for each FDT type. To do this, add a new Entry method called GetFdtEtype(). This is necessary since some entry types contain a device tree which are not the simple three entry types 'u-boot-dtb', 'u-boot-spl' or 'u-boot-tpl'. The code already returns a dict for GetFdt(). Update the value of that dict to include the filename so that existing code can work. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype')
-rw-r--r--tools/binman/etype/blob_dtb.py16
-rw-r--r--tools/binman/etype/u_boot_dtb.py3
-rw-r--r--tools/binman/etype/u_boot_dtb_with_ucode.py3
-rw-r--r--tools/binman/etype/u_boot_spl_dtb.py3
-rw-r--r--tools/binman/etype/u_boot_tpl_dtb.py3
-rw-r--r--tools/binman/etype/u_boot_tpl_dtb_with_ucode.py3
6 files changed, 29 insertions, 2 deletions
diff --git a/tools/binman/etype/blob_dtb.py b/tools/binman/etype/blob_dtb.py
index b70c3d3..b9ccf9a 100644
--- a/tools/binman/etype/blob_dtb.py
+++ b/tools/binman/etype/blob_dtb.py
@@ -32,12 +32,24 @@ class Entry_blob_dtb(Entry_blob):
data = self.CompressData(indata)
return self.ProcessContentsUpdate(data)
+ def GetFdtEtype(self):
+ """Get the entry type of this device tree
+
+ This can be 'u-boot-dtb', 'u-boot-spl-dtb' or 'u-boot-tpl-dtb'
+ Returns:
+ Entry type if any, e.g. 'u-boot-dtb'
+ """
+ return None
+
def GetFdts(self):
"""Get the device trees used by this entry
Returns:
Dict:
key: Filename from this entry (without the path)
- value: Fdt object for this dtb, or None if not available
+ value: Tuple:
+ Fdt object for this dtb, or None if not available
+ Filename of file containing this dtb
"""
- return {self.GetDefaultFilename(): None}
+ fname = self.GetDefaultFilename()
+ return {self.GetFdtEtype(): [self, fname]}
diff --git a/tools/binman/etype/u_boot_dtb.py b/tools/binman/etype/u_boot_dtb.py
index 6263c4e..6c805a6 100644
--- a/tools/binman/etype/u_boot_dtb.py
+++ b/tools/binman/etype/u_boot_dtb.py
@@ -26,3 +26,6 @@ class Entry_u_boot_dtb(Entry_blob_dtb):
def GetDefaultFilename(self):
return 'u-boot.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-dtb'
diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py b/tools/binman/etype/u_boot_dtb_with_ucode.py
index 9224004..ff7f804 100644
--- a/tools/binman/etype/u_boot_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_dtb_with_ucode.py
@@ -36,6 +36,9 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb):
def GetDefaultFilename(self):
return 'u-boot.dtb'
+ def GetFdtEtype(self):
+ return 'u-boot-dtb'
+
def ProcessFdt(self, fdt):
# So the module can be loaded without it
import fdt
diff --git a/tools/binman/etype/u_boot_spl_dtb.py b/tools/binman/etype/u_boot_spl_dtb.py
index e735464..1bcd449 100644
--- a/tools/binman/etype/u_boot_spl_dtb.py
+++ b/tools/binman/etype/u_boot_spl_dtb.py
@@ -23,3 +23,6 @@ class Entry_u_boot_spl_dtb(Entry_blob_dtb):
def GetDefaultFilename(self):
return 'spl/u-boot-spl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-spl-dtb'
diff --git a/tools/binman/etype/u_boot_tpl_dtb.py b/tools/binman/etype/u_boot_tpl_dtb.py
index bdeb0f7..81a3970 100644
--- a/tools/binman/etype/u_boot_tpl_dtb.py
+++ b/tools/binman/etype/u_boot_tpl_dtb.py
@@ -23,3 +23,6 @@ class Entry_u_boot_tpl_dtb(Entry_blob_dtb):
def GetDefaultFilename(self):
return 'tpl/u-boot-tpl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-tpl-dtb'
diff --git a/tools/binman/etype/u_boot_tpl_dtb_with_ucode.py b/tools/binman/etype/u_boot_tpl_dtb_with_ucode.py
index 71e04fc..ce19a49 100644
--- a/tools/binman/etype/u_boot_tpl_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_tpl_dtb_with_ucode.py
@@ -23,3 +23,6 @@ class Entry_u_boot_tpl_dtb_with_ucode(Entry_u_boot_dtb_with_ucode):
def GetDefaultFilename(self):
return 'tpl/u-boot-tpl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-tpl-dtb'