aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-06 10:39:08 -0600
committerSimon Glass <sjg@chromium.org>2020-09-22 12:54:13 -0600
commitc0f1ebe9c1b9745e1cbdc742a11093da2c99a174 (patch)
treea85c305e9f3649c2fc268b586a87726df2b0e72a /tools/binman/ftest.py
parent4ec40a7208db0e3294e266aacd23eddbae13c879 (diff)
downloadu-boot-c0f1ebe9c1b9745e1cbdc742a11093da2c99a174.zip
u-boot-c0f1ebe9c1b9745e1cbdc742a11093da2c99a174.tar.gz
u-boot-c0f1ebe9c1b9745e1cbdc742a11093da2c99a174.tar.bz2
binman: Allow selecting default FIT configuration
Add a new entry argument to the fit entry which allows selection of the default configuration to use. This is the 'default' property in the 'configurations' node. Update the Makefile to pass in the value of DEVICE_TREE or CONFIG_DEFAULT_DEVICE_TREE to provide this information. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py41
1 files changed, 38 insertions, 3 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 78d0e9c..a269a74 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -3602,7 +3602,7 @@ class TestFunctional(unittest.TestCase):
"""
cnode = dtb.GetNode('/configurations')
self.assertIn('default', cnode.props)
- self.assertEqual('config-1', cnode.props['default'].value)
+ self.assertEqual('config-2', cnode.props['default'].value)
name = 'config-%d' % seq
fnode = dtb.GetNode('/configurations/%s' % name)
@@ -3615,9 +3615,10 @@ class TestFunctional(unittest.TestCase):
entry_args = {
'of-list': 'test-fdt1 test-fdt2',
+ 'default-dt': 'test-fdt2',
}
data = self._DoReadFileDtb(
- '170_fit_fdt.dts',
+ '172_fit_fdt.dts',
entry_args=entry_args,
extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):])
@@ -3639,7 +3640,7 @@ class TestFunctional(unittest.TestCase):
def testFitFdtMissingList(self):
"""Test handling of a missing 'of-list' entry arg"""
with self.assertRaises(ValueError) as e:
- self._DoReadFile('170_fit_fdt.dts')
+ self._DoReadFile('172_fit_fdt.dts')
self.assertIn("Generator node requires 'of-list' entry argument",
str(e.exception))
@@ -3657,5 +3658,39 @@ class TestFunctional(unittest.TestCase):
self.assertIn("Generator node requires 'fit,fdt-list' property",
str(e.exception))
+ def testFitFdtEmptyList(self):
+ """Test handling of an empty 'of-list' entry arg"""
+ entry_args = {
+ 'of-list': '',
+ }
+ data = self._DoReadFileDtb('172_fit_fdt.dts', entry_args=entry_args)[0]
+
+ def testFitFdtMissing(self):
+ """Test handling of a missing 'default-dt' entry arg"""
+ entry_args = {
+ 'of-list': 'test-fdt1 test-fdt2',
+ }
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFileDtb(
+ '172_fit_fdt.dts',
+ entry_args=entry_args,
+ extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
+ self.assertIn("Generated 'default' node requires default-dt entry argument",
+ str(e.exception))
+
+ def testFitFdtNotInList(self):
+ """Test handling of a default-dt that is not in the of-list"""
+ entry_args = {
+ 'of-list': 'test-fdt1 test-fdt2',
+ 'default-dt': 'test-fdt3',
+ }
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFileDtb(
+ '172_fit_fdt.dts',
+ entry_args=entry_args,
+ extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
+ self.assertIn("default-dt entry argument 'test-fdt3' not found in fdt list: test-fdt1, test-fdt2",
+ str(e.exception))
+
if __name__ == "__main__":
unittest.main()