From: Simon Glass <sjg@chromium.org>
Date: Sat, 24 Aug 2019 13:22:47 +0000 (-0600)
Subject: binman: Correct use of 'replace' in IFWI tests
X-Git-Tag: v2025.01-rc5-pxa1908~2744^2~54
X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/html/index.html?a=commitdiff_plain;h=3da9ce8dd44399dfca4b0639101f5154dbbaa93f;p=u-boot.git

binman: Correct use of 'replace' in IFWI tests

At present the Intel IFWI entry uses 'replace' without the 'ifwi-' prefix.
This is a fairly generic name which might conflict with the main Entry
base class at some point, if more features are added. Add a prefix.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/tools/binman/README.entries b/tools/binman/README.entries
index 0f0e367d02..11c55fd8c8 100644
--- a/tools/binman/README.entries
+++ b/tools/binman/README.entries
@@ -432,6 +432,12 @@ The contents of the IFWI are specified by the subnodes of the IFWI node.
 Each subnode describes an entry which is placed into the IFWFI with a given
 sub-partition (and optional entry name).
 
+Properties for subnodes:
+    ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP"
+    ifwi-entry - entry name t use, e.g. "IBBL"
+    ifwi-replace - if present, indicates that the item should be replaced
+        in the IFWI. Otherwise it is added.
+
 See README.x86 for information about x86 binary blobs.
 
 
diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py
index 9cbdf3698a..f3745f7a8c 100644
--- a/tools/binman/etype/intel_ifwi.py
+++ b/tools/binman/etype/intel_ifwi.py
@@ -36,6 +36,12 @@ class Entry_intel_ifwi(Entry_blob):
     Each subnode describes an entry which is placed into the IFWFI with a given
     sub-partition (and optional entry name).
 
+    Properties for subnodes:
+        ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP"
+        ifwi-entry - entry name t use, e.g. "IBBL"
+        ifwi-replace - if present, indicates that the item should be replaced
+            in the IFWI. Otherwise it is added.
+
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
@@ -95,7 +101,7 @@ class Entry_intel_ifwi(Entry_blob):
         for node in self._node.subnodes:
             entry = Entry.Create(self.section, node)
             entry.ReadNode()
-            entry._ifwi_replace = fdt_util.GetBool(node, 'replace')
+            entry._ifwi_replace = fdt_util.GetBool(node, 'ifwi-replace')
             entry._ifwi_subpart = fdt_util.GetString(node, 'ifwi-subpart')
             entry._ifwi_entry_name = fdt_util.GetString(node, 'ifwi-entry')
             self._ifwi_entries[entry._ifwi_subpart] = entry
diff --git a/tools/binman/test/111_x86-rom-ifwi.dts b/tools/binman/test/111_x86-rom-ifwi.dts
index 63b5972cc8..c0ba4f2ea4 100644
--- a/tools/binman/test/111_x86-rom-ifwi.dts
+++ b/tools/binman/test/111_x86-rom-ifwi.dts
@@ -20,7 +20,7 @@
 			convert-fit;
 
 			u-boot-tpl {
-				replace;
+				ifwi-replace;
 				ifwi-subpart = "IBBP";
 				ifwi-entry = "IBBL";
 			};
diff --git a/tools/binman/test/112_x86-rom-ifwi-nodesc.dts b/tools/binman/test/112_x86-rom-ifwi-nodesc.dts
index 21ec4654ff..0874440ab5 100644
--- a/tools/binman/test/112_x86-rom-ifwi-nodesc.dts
+++ b/tools/binman/test/112_x86-rom-ifwi-nodesc.dts
@@ -19,7 +19,7 @@
 			filename = "ifwi.bin";
 
 			u-boot-tpl {
-				replace;
+				ifwi-replace;
 				ifwi-subpart = "IBBP";
 				ifwi-entry = "IBBL";
 			};
diff --git a/tools/binman/test/113_x86-rom-ifwi-nodata.dts b/tools/binman/test/113_x86-rom-ifwi-nodata.dts
index 62486fd990..82a4bc8cdd 100644
--- a/tools/binman/test/113_x86-rom-ifwi-nodata.dts
+++ b/tools/binman/test/113_x86-rom-ifwi-nodata.dts
@@ -20,7 +20,7 @@
 
 			_testing {
 				return-unknown-contents;
-				replace;
+				ifwi-replace;
 				ifwi-subpart = "IBBP";
 				ifwi-entry = "IBBL";
 			};