Signed-off-by: Rasmus Villemoes <rasmus.villem...@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

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";
+                               };
+                       };
+               };
+       };
+};
-- 
2.37.2

Reply via email to