U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>,
	Brian Ruley <brian.ruley@gehealthcare.com>,
	Paul HENRYS <paul.henrys_ext@softathome.com>,
	Rasmus Villemoes <ravi@prevas.dk>, Simon Glass <sjg@chromium.org>,
	Tim Harvey <tharvey@gateworks.com>, Tom Rini <trini@konsulko.com>
Subject: [PATCH] binman: Fill in most of the imx8mimage and imx8mcst tests
Date: Sun,  5 Jan 2025 21:36:42 +0100	[thread overview]
Message-ID: <20250105203714.158480-1-marex@denx.de> (raw)

Rename the test .dts and tests and include the M suffix to indicate
those tests are for i.MX8M, not for i.MX8, which is a different SoC.

Update 339_nxp_imx8m.dts, add testNxpImx8MImageMkimageMissing and
update nxp_imx8mimage.py test to bring nxp_imx8mimage test to 100% .

Add 343..345_nxp_imx8m.dts, add matching tests and update nxp_imx8mcst.py
to bring CST tests to 97% . It is not clear how to test the CST output
file to reach 100%.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Brian Ruley <brian.ruley@gehealthcare.com>
Cc: Paul HENRYS <paul.henrys_ext@softathome.com>
Cc: Rasmus Villemoes <ravi@prevas.dk>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
 tools/binman/etype/nxp_imx8mcst.py            |  4 --
 tools/binman/etype/nxp_imx8mimage.py          |  4 --
 tools/binman/ftest.py                         | 42 +++++++++++++++++--
 .../{339_nxp_imx8.dts => 339_nxp_imx8m.dts}   |  3 ++
 tools/binman/test/343_nxp_imx8m.dts           | 26 ++++++++++++
 tools/binman/test/344_nxp_imx8m.dts           | 28 +++++++++++++
 tools/binman/test/345_nxp_imx8m.dts           | 19 +++++++++
 7 files changed, 115 insertions(+), 11 deletions(-)
 rename tools/binman/test/{339_nxp_imx8.dts => 339_nxp_imx8m.dts} (93%)
 create mode 100644 tools/binman/test/343_nxp_imx8m.dts
 create mode 100644 tools/binman/test/344_nxp_imx8m.dts
 create mode 100644 tools/binman/test/345_nxp_imx8m.dts

diff --git a/tools/binman/etype/nxp_imx8mcst.py b/tools/binman/etype/nxp_imx8mcst.py
index dd9f226b751..c36a8f68971 100644
--- a/tools/binman/etype/nxp_imx8mcst.py
+++ b/tools/binman/etype/nxp_imx8mcst.py
@@ -181,10 +181,6 @@ class Entry_nxp_imx8mcst(Entry_mkimage):
         upto = 0x00
         for entry in super().GetEntries().values():
             entry.SetOffsetSize(upto, None)
-
-            # Give up if any entries lack a size
-            if entry.size is None:
-                return
             upto += entry.size
 
         Entry_section.SetImagePos(self, image_pos)
diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
index 8ad177b3b65..8d14e16154a 100644
--- a/tools/binman/etype/nxp_imx8mimage.py
+++ b/tools/binman/etype/nxp_imx8mimage.py
@@ -66,10 +66,6 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
         upto = 0x00
         for entry in super().GetEntries().values():
             entry.SetOffsetSize(upto, None)
-
-            # Give up if any entries lack a size
-            if entry.size is None:
-                return
             upto += entry.size
 
         Entry_section.SetImagePos(self, image_pos)
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index a553ca9e564..467f24a85d5 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -7822,9 +7822,45 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
         self.assertIn('Symbol-writing: no value for /binman/section/u-boot',
                       out)
 
-    def testNxpImx8Image(self):
-        """Test that binman can produce an iMX8 image"""
-        self._DoTestFile('339_nxp_imx8.dts')
+    def testNxpImx8MImage(self):
+        """Test that binman can produce an iMX8M image"""
+        self._DoTestFile('339_nxp_imx8m.dts')
+
+    def testNxpImx8MImageMkimageMissing(self):
+        """Test that binman can produce an iMX8M image"""
+        with test_util.capture_sys_output() as (_, stderr):
+            self._DoTestFile('339_nxp_imx8m.dts',
+                             force_missing_bintools='mkimage')
+        err = stderr.getvalue()
+        self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage")
+
+    def testNxpImx8MCSTSPL(self):
+        """Test that binman can sign an iMX8M SPL image"""
+        self._DoTestFile('343_nxp_imx8m.dts')
+
+    def testNxpImx8MCSTFIT(self):
+        """Test that binman can sign an iMX8M FIT image"""
+        self._DoTestFile('344_nxp_imx8m.dts')
+
+    def testNxpImx8MCSTUnknown(self):
+        """Test that binman can sign an iMX8M Unknown image"""
+        self._DoTestFile('345_nxp_imx8m.dts')
+
+    def testNxpImx8MCSTMkimageMissing(self):
+        """Test that binman can sign an iMX8M image"""
+        with test_util.capture_sys_output() as (_, stderr):
+            self._DoTestFile('343_nxp_imx8m.dts',
+                             force_missing_bintools='mkimage')
+        err = stderr.getvalue()
+        self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage")
+
+    def testNxpImx8MCSTtoolMissing(self):
+        """Test that binman can sign an iMX8M image"""
+        with test_util.capture_sys_output() as (_, stderr):
+            self._DoTestFile('343_nxp_imx8m.dts',
+                             force_missing_bintools='cst')
+        err = stderr.getvalue()
+        self.assertRegex(err, "Image 'image'.*missing bintools.*: cst")
 
     def testFitSignSimple(self):
         """Test that image with FIT and signature nodes can be signed"""
diff --git a/tools/binman/test/339_nxp_imx8.dts b/tools/binman/test/339_nxp_imx8m.dts
similarity index 93%
rename from tools/binman/test/339_nxp_imx8.dts
rename to tools/binman/test/339_nxp_imx8m.dts
index cb512ae9aa2..2c8f4bee5b7 100644
--- a/tools/binman/test/339_nxp_imx8.dts
+++ b/tools/binman/test/339_nxp_imx8m.dts
@@ -12,6 +12,9 @@
 			nxp,boot-from = "sd";
 			nxp,rom-version = <1>;
 			nxp,loader-address = <0x10>;
+
+			section {
+			};
 		};
 	};
 };
diff --git a/tools/binman/test/343_nxp_imx8m.dts b/tools/binman/test/343_nxp_imx8m.dts
new file mode 100644
index 00000000000..5e76a97641b
--- /dev/null
+++ b/tools/binman/test/343_nxp_imx8m.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		nxp-imx8mcst {
+			args;	/* TODO: Needed by mkimage etype superclass */
+			nxp,loader-address = <0x12340000>;
+			nxp,unlock;
+
+			nxp-imx8mimage {
+				args;	/* TODO: Needed by mkimage etype superclass */
+				nxp,boot-from = "sd";
+				nxp,rom-version = <1>;
+				nxp,loader-address = <0x10>;
+
+				section {
+				};
+			};
+		};
+	};
+};
diff --git a/tools/binman/test/344_nxp_imx8m.dts b/tools/binman/test/344_nxp_imx8m.dts
new file mode 100644
index 00000000000..c38267bb815
--- /dev/null
+++ b/tools/binman/test/344_nxp_imx8m.dts
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		nxp-imx8mcst {
+			nxp,loader-address = <0x12340000>;
+			nxp,fast-auth;
+			offset = <0x58000>;
+			args;	/* Needed by mkimage etype superclass */
+
+			fit {
+				description = "test desc";
+				#address-cells = <1>;
+
+				images {
+				};
+
+				configurations {
+				};
+			};
+		};
+	};
+};
diff --git a/tools/binman/test/345_nxp_imx8m.dts b/tools/binman/test/345_nxp_imx8m.dts
new file mode 100644
index 00000000000..0ed6e3ca9d0
--- /dev/null
+++ b/tools/binman/test/345_nxp_imx8m.dts
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		nxp-imx8mcst {
+			nxp,loader-address = <0x12340000>;
+			offset = <0x58000>;
+			args;	/* Needed by mkimage etype superclass */
+
+			u-boot {
+			};
+		};
+	};
+};
-- 
2.45.2


             reply	other threads:[~2025-01-05 20:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-05 20:36 Marek Vasut [this message]
2025-01-06 14:38 ` [PATCH] binman: Fill in most of the imx8mimage and imx8mcst tests Simon Glass
2025-01-06 20:50   ` Marek Vasut
2025-01-07  3:50     ` Simon Glass
2025-01-07 10:39       ` Marek Vasut
2025-01-09 14:10         ` Simon Glass
2025-01-10 11:02           ` Fabio Estevam
2025-02-05 10:19           ` Marek Vasut
2025-02-06 12:42             ` Simon Glass
2025-02-06 20:40               ` Marek Vasut
2025-02-07  0:49                 ` Simon Glass
2025-02-08 21:19                   ` Marek Vasut
2025-02-15 13:38                     ` Simon Glass
2025-02-15 14:55                       ` Marek Vasut
2025-03-06 23:30                         ` Simon Glass
2025-03-07  0:04                           ` Marek Vasut
2025-03-07  2:18                             ` Simon Glass
2025-03-07  5:42                               ` Marek Vasut
2025-03-12  0:41                                 ` Fabio Estevam
2025-03-19 23:54                                   ` Marek Vasut
2025-03-20  3:40                                     ` Simon Glass
2025-03-20  4:05                                       ` Marek Vasut
2025-03-28 11:42                                         ` Simon Glass
2025-03-28 13:23                                           ` Fabio Estevam
2025-03-31 14:43                                             ` Leonard Anderweit
2025-03-31 18:18                                               ` Fabio Estevam
2025-03-31 18:31                                                 ` Tom Rini
2025-05-05 12:28                                                   ` Fabio Estevam
2025-05-05 14:46                                                     ` Tom Rini
2025-03-30 22:11                                           ` Marek Vasut
2025-03-31  1:18                                             ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250105203714.158480-1-marex@denx.de \
    --to=marex@denx.de \
    --cc=brian.ruley@gehealthcare.com \
    --cc=paul.henrys_ext@softathome.com \
    --cc=ravi@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox