summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-18 20:24:58 +1300
committerSimon Glass <sjg@chromium.org>2021-03-26 17:03:09 +1300
commitd26efc89b11a41d2ef402cac47a3d4a55577084b (patch)
tree07ad2fe3b848894f08d442c9408df0f8fff4dbc3 /tools/binman/ftest.py
parent77a64e08e2c8238998e4f5ea014b0c9fd1043b1b (diff)
binman: Add support for u-boot-tpl-bss-bad
This entry holds the padding between the end of of TPL binary and the end of BSS. This region must be left empty so that the devicetree can be appended correctly and remain accessible without interfering with BSS. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 684e507e6ed..d1bf64ce271 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -4262,6 +4262,22 @@ class TestFunctional(unittest.TestCase):
self.assertEqual(U_BOOT_TPL_NODTB_DATA,
data[:len(U_BOOT_TPL_NODTB_DATA)])
+ def testTplBssPad(self):
+ """Test that we can pad TPL's BSS with zeros"""
+ # ELF file with a '__bss_size' symbol
+ self._SetupTplElf()
+ data = self._DoReadFile('193_tpl_bss_pad.dts')
+ self.assertEqual(U_BOOT_TPL_DATA + tools.GetBytes(0, 10) + U_BOOT_DATA,
+ data)
+
+ def testTplBssPadMissing(self):
+ """Test that a missing symbol is detected"""
+ self._SetupTplElf('u_boot_ucode_ptr')
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFile('193_tpl_bss_pad.dts')
+ self.assertIn('Expected __bss_size symbol in tpl/u-boot-tpl',
+ str(e.exception))
+
if __name__ == "__main__":
unittest.main()