diff mbox series

[3/4] tools: binman: add test case for fit, align without fit, external-offset

Message ID 20230919113705.109639-4-rasmus.villemoes@prevas.dk
State Deferred
Delegated to: Simon Glass
Headers show
Series mkimage: also honour -B even without external data | expand

Commit Message

Rasmus Villemoes Sept. 19, 2023, 11:37 a.m. UTC
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 tools/binman/ftest.py               | 10 +++++
 tools/binman/test/311_fit_align.dts | 58 +++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
 create mode 100644 tools/binman/test/311_fit_align.dts

Comments

Simon Glass Sept. 21, 2023, 1:03 a.m. UTC | #1
On Tue, 19 Sept 2023 at 05:37, Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  tools/binman/ftest.py               | 10 +++++
>  tools/binman/test/311_fit_align.dts | 58 +++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+)
>  create mode 100644 tools/binman/test/311_fit_align.dts
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index d26e7511f7..a3c465b3d3 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -7216,5 +7216,15 @@  fdt         fdtmap                Extract the devicetree blob from the fdtmap
         self.assertRegex(err,
                          "Image 'image'.*missing bintools.*: bootgen")
 
+    def testFitAlign(self):
+        """Test a FIT image with a fit,align property"""
+        data = self._DoReadFile('311_fit_align.dts')
+        self.assertEqual(2048, len(data))
+
+        dtb = fdt.Fdt.FromData(data)
+        dtb.Scan()
+
+        self.assertEqual(2048, dtb._fdt_obj.totalsize())
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/311_fit_align.dts b/tools/binman/test/311_fit_align.dts
new file mode 100644
index 0000000000..4a9b95b8df
--- /dev/null
+++ b/tools/binman/test/311_fit_align.dts
@@ -0,0 +1,58 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		fit {
+			description = "test desc";
+			#address-cells = <1>;
+			fit,align = <2048>;
+
+			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 {
+					};
+				};
+
+				fdt-2 {
+					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";
+				};
+			};
+		};
+	};
+};