[PATCH] WIP: binman: expand test coverage to nxpimx8mcst

Brian Ruley brian.ruley at gehealthcare.com
Mon Oct 7 15:01:09 CEST 2024


Add coverage for IMX8M code siging. Create PKI tree and other assets
required by `cst' using `hab4_pki_tree.sh' script in `cst_3.4.1' [1].

[1] https://www.nxp.com/webapp/Download?colCode=IMX_CST_TOOL_NEW

Signed-off-by: Brian Ruley <brian.ruley at gehealthcare.com>
---
 tools/binman/ftest.py                   |  4 ++
 tools/binman/test/336_nxp_imx8mcst.dts  | 58 +++++++++++++++++++++++++
 tools/binman/test/cst/keys/key_pass.txt |  2 +
 3 files changed, 64 insertions(+)
 create mode 100644 tools/binman/test/336_nxp_imx8mcst.dts
 create mode 100644 tools/binman/test/cst/keys/key_pass.txt

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 93f3d22cf5..f1c052a7f8 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -7690,6 +7690,10 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
             # Make sure the other node is gone
             self.assertIsNone(dtb.GetNode('/node/other-node'))
 
+    def testNxpImx8mCst(self):
+        """Test that binman can sign an iMX8M image"""
+        self._DoTestFile('336_nxp_imx8mcst.dts')
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/336_nxp_imx8mcst.dts b/tools/binman/test/336_nxp_imx8mcst.dts
new file mode 100644
index 0000000000..6cfefdae2a
--- /dev/null
+++ b/tools/binman/test/336_nxp_imx8mcst.dts
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		nxp-imx8mcst {
+			args;	/* Needed by mkimage etype superclass */
+			filename = "test-fit.signed.bin";
+			nxp,loader-address = <0x10>;
+            nxp,srk-table = "tools/binman/test/cst/crts/SRK_table.bin";
+            nxp,img-crt = "tools/binman/test/cst/crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem";
+            nxp,csf-crt = "tools/binman/test/cst/crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem";
+
+            fit {
+                description = "test desc";
+			    filename = "test-fit.itb";
+                #address-cells = <1>;
+
+                images {
+                    u-boot {
+                        description = "test u-boot";
+                        type = "standalone";
+                        arch = "arm64";
+                        os = "u-boot";
+                        compression = "none";
+                        load = <00000000>;
+                        entry = <00000000>;
+
+                        u-boot-nodtb {
+                        };
+                    };
+
+                    fdt-1 {
+                        description = "test fdt";
+                        type = "flat_dt";
+                        compression = "none";
+
+                        u-boot-dtb {
+                        };
+                    };
+                };
+
+                configurations {
+                    default = "config-1";
+                    config-1 {
+                        description = "test config";
+                        fdt = "fdt-1";
+                        firmware = "u-boot";
+                    };
+                };
+            };
+        };
+	};
+};
diff --git a/tools/binman/test/cst/keys/key_pass.txt b/tools/binman/test/cst/keys/key_pass.txt
new file mode 100644
index 0000000000..dec2cbe1fa
--- /dev/null
+++ b/tools/binman/test/cst/keys/key_pass.txt
@@ -0,0 +1,2 @@
+test
+test
-- 
2.39.5



More information about the U-Boot mailing list