summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-11-25 20:15:54 -0700
committerSimon Glass <sjg@chromium.org>2016-12-20 08:09:55 +1300
commitc49deb837cb1ba0a64869fcb4fabac11d3e94ae0 (patch)
treef479e174f9aeb0af444699812698fd733c951b5b /tools
parente0ff85513858246e5378e4e3676ef6128452c4f6 (diff)
binman: Add support for u-boot.img as an input binary
Add an entry type for u-boot.img (a legacy U-Boot image) and a simple test. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/etype/u_boot_img.py17
-rw-r--r--tools/binman/func_test.py5
-rw-r--r--tools/binman/test/36_u_boot_img.dts11
3 files changed, 33 insertions, 0 deletions
diff --git a/tools/binman/etype/u_boot_img.py b/tools/binman/etype/u_boot_img.py
new file mode 100644
index 0000000000..744f1b471a
--- /dev/null
+++ b/tools/binman/etype/u_boot_img.py
@@ -0,0 +1,17 @@
+# Copyright (c) 2016 Google, Inc
+# Written by Simon Glass <sjg@chromium.org>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Entry-type module for U-Boot binary
+#
+
+from entry import Entry
+from blob import Entry_blob
+
+class Entry_u_boot_img(Entry_blob):
+ def __init__(self, image, etype, node):
+ Entry_blob.__init__(self, image, etype, node)
+
+ def GetDefaultFilename(self):
+ return 'u-boot.img'
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 341957b59f..8dd118b7c2 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -713,3 +713,8 @@ class TestFunctional(unittest.TestCase):
first = data[:len(U_BOOT_NODTB_DATA)]
self.assertEqual('nodtb with microcode' + pos_and_size +
' somewhere in here', first)
+
+ def testUBootImg(self):
+ """Test that u-boot.img can be put in a file"""
+ data = self._DoReadFile('36_u_boot_img.dts')
+ self.assertEqual(U_BOOT_IMG_DATA, data)
diff --git a/tools/binman/test/36_u_boot_img.dts b/tools/binman/test/36_u_boot_img.dts
new file mode 100644
index 0000000000..aa5a3fe481
--- /dev/null
+++ b/tools/binman/test/36_u_boot_img.dts
@@ -0,0 +1,11 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ u-boot-img {
+ };
+ };
+};