Lines Matching +full:dts +full:- +full:node
5 # SPDX-License-Identifier: GPL-2.0+
9 # python -m unittest func_test.TestFunctional.testHelp
45 Most of these use a sample .dts file to build an image and then check
53 In some cases a 'real' file must be used - these are also supplied in
66 TestFunctional._MakeInputFile('u-boot.bin', U_BOOT_DATA)
67 TestFunctional._MakeInputFile('u-boot.img', U_BOOT_IMG_DATA)
68 TestFunctional._MakeInputFile('spl/u-boot-spl.bin', U_BOOT_SPL_DATA)
72 TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
73 TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA)
74 TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA)
81 TestFunctional._MakeInputFile('u-boot', fd.read())
126 options.pager = 'binman-invalid-pager'
137 fname: Device tree source filename to use (e.g. 05_simple.dts)
139 return self._DoBinman('-p', '-I', self._indir,
140 '-d', self.TestFile(fname))
142 def _SetupDtb(self, fname, outfile='u-boot.dtb'):
143 """Set up a new test device-tree file
149 fname: Filename of .dts file to read
171 Raises an assertion failure if binman returns a non-zero exit code.
174 fname: Device tree source filename to use (e.g. 05_simple.dts)
176 the u-boot-dtb entry. Normally this is not needed and the
186 # Use the compiled test file as the u-boot-dtb input
203 TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
206 """Helper function which discards the device-tree binary"""
267 result = self._RunBinman('-h')
270 """Test that the full help is displayed with -H"""
271 result = self._RunBinman('-H')
278 """Test that the full help is displayed with -H"""
281 result = self._DoBinman('-H')
287 """Test that the basic help is displayed with -h"""
288 result = self._RunBinman('-h')
296 self._SetupDtb('05_simple.dts', 'sandbox/u-boot.dtb')
297 TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA)
298 result = self._DoBinman('-b', 'sandbox')
305 self.assertIn("Must provide a board to process (use -b <board>)",
311 self._RunBinman('-d', 'missing_file')
320 will come from the device-tree compiler (dtc).
323 self._RunBinman('-d', self.TestFile('01_invalid.dts'))
328 """Test that a device tree without a 'binman' node generates an error"""
330 self._DoBinman('-d', self.TestFile('02_missing_node.dts'))
331 self.assertIn("does not have a 'binman' node", str(e.exception))
334 """Test that an empty binman node works OK (i.e. does nothing)"""
335 result = self._RunBinman('-d', self.TestFile('03_empty.dts'))
342 result = self._RunBinman('-d',
343 self.TestFile('04_invalid_entry.dts'))
345 self.assertIn("Unknown entry type 'not-a-valid-type' in node "
346 "'/binman/not-a-valid-type'", str(e.exception))
350 data = self._DoReadFile('05_simple.dts')
358 retcode = self._DoTestFile('06_dual_image.dts')
382 self._DoTestFile('07_bad_align.dts')
383 self.assertIn("Node '/binman/u-boot': Alignment 23 must be a power "
388 retcode = self._DoTestFile('08_pack.dts')
395 # First u-boot
396 self.assertIn('u-boot', entries)
397 entry = entries['u-boot']
401 # Second u-boot, aligned to 16-byte boundary
402 self.assertIn('u-boot-align', entries)
403 entry = entries['u-boot-align']
407 # Third u-boot, size 23 bytes
408 self.assertIn('u-boot-size', entries)
409 entry = entries['u-boot-size']
414 # Fourth u-boot, placed immediate after the above
415 self.assertIn('u-boot-next', entries)
416 entry = entries['u-boot-next']
420 # Fifth u-boot, placed at a fixed position
421 self.assertIn('u-boot-fixed', entries)
422 entry = entries['u-boot-fixed']
430 retcode = self._DoTestFile('09_pack_extra.dts')
438 # First u-boot with padding before and after
439 self.assertIn('u-boot', entries)
440 entry = entries['u-boot']
445 # Second u-boot has an aligned size, but it has no effect
446 self.assertIn('u-boot-align-size-nop', entries)
447 entry = entries['u-boot-align-size-nop']
451 # Third u-boot has an aligned size too
452 self.assertIn('u-boot-align-size', entries)
453 entry = entries['u-boot-align-size']
457 # Fourth u-boot has an aligned end
458 self.assertIn('u-boot-align-end', entries)
459 entry = entries['u-boot-align-end']
463 # Fifth u-boot immediately afterwards
464 self.assertIn('u-boot-align-both', entries)
465 entry = entries['u-boot-align-both']
475 self._DoTestFile('10_pack_align_power2.dts')
476 self.assertIn("Node '/binman/u-boot': Alignment 5 must be a power "
482 self._DoTestFile('11_pack_align_size_power2.dts')
483 self.assertIn("Node '/binman/u-boot': Alignment size 55 must be a "
489 self._DoTestFile('12_pack_inv_align.dts')
490 self.assertIn("Node '/binman/u-boot': Position 0x5 (5) does not match "
496 self._DoTestFile('13_pack_inv_size_align.dts')
497 self.assertIn("Node '/binman/u-boot': Size 0x5 (5) does not match "
498 "align-size 0x4 (4)", str(e.exception))
503 self._DoTestFile('14_pack_overlap.dts')
504 self.assertIn("Node '/binman/u-boot-align': Position 0x3 (3) overlaps "
505 "with previous entry '/binman/u-boot' ending at 0x4 (4)",
511 self._DoTestFile('15_pack_overflow.dts')
512 self.assertIn("Node '/binman/u-boot': Entry contents size is 0x4 (4) "
518 self._DoTestFile('16_pack_image_overflow.dts')
524 retcode = self._DoTestFile('17_pack_image_size.dts')
532 retcode = self._DoTestFile('18_pack_image_align.dts')
541 self._DoTestFile('19_pack_inv_image_align.dts')
543 "align-size 0x8 (8)", str(e.exception))
548 self._DoTestFile('20_pack_inv_image_align_power2.dts')
554 data = self._DoReadFile('21_image_pad.dts')
559 retcode = self._DoTestFile('22_image_name.dts')
562 fname = tools.GetOutputFilename('test-name')
566 fname = tools.GetOutputFilename('test-name.xx')
571 data = self._DoReadFile('23_blob.dts')
576 data = self._DoReadFile('24_sorted.dts')
583 self._DoTestFile('25_pack_zero_size.dts')
584 self.assertIn("Node '/binman/u-boot-spl': Position 0x0 (0) overlaps "
585 "with previous entry '/binman/u-boot' ending at 0x4 (4)",
589 """Test that a device tree can be added to U-Boot"""
590 data = self._DoReadFile('26_pack_u_boot_dtb.dts')
594 """Test that the end-at-4gb property requires a size property"""
596 self._DoTestFile('27_pack_4gb_no_size.dts')
598 "using end-at-4gb", str(e.exception))
601 """Test that the end-at-4gb property checks for position boundaries"""
603 self._DoTestFile('28_pack_4gb_outside.dts')
604 self.assertIn("Node '/binman/u-boot': Position 0x0 (0) is outside "
610 data = self._DoReadFile('29_x86-rom.dts')
618 self._DoTestFile('31_x86-rom-me.dts')
619 self.assertIn("Node '/binman/intel-descriptor': Cannot find FD "
625 self._DoTestFile('30_x86-rom-me-no-desc.dts')
626 self.assertIn("Node '/binman/intel-me': No position set with "
627 "pos-unset: should another entry provide this correct "
632 data = self._DoReadFile('31_x86-rom-me.dts')
637 data = self._DoReadFile('32_intel-vga.dts')
642 data = self._DoReadFile('33_x86-start16.dts')
649 u-boot-nodtb.bin with a microcode pointer inserted at the correct
651 u-boot.dtb with the microcode removed
654 data = self._DoReadFile('34_x86_ucode.dts', True)
664 for node in ucode.subnodes:
665 self.assertFalse(node.props.get('data'))
672 # the /microcode/update@xxx nodes in x86_ucode.dts.
690 u-boot-nodtb.bin with a microcode pointer inserted at the correct
692 u-boot.dtb with the microcode
698 data = self._DoReadFile('35_x86_single_ucode.dts', True)
724 """Test that u-boot.img can be put in a file"""
725 data = self._DoReadFile('36_u_boot_img.dts')
731 self._DoReadFile('37_x86_no_ucode.dts', True)
732 self.assertIn("Node '/binman/u-boot-dtb-with-ucode': No /microcode "
733 "node found in ", str(e.exception))
736 """Test that a missing u-boot-dtb-with-ucode node is detected"""
738 self._DoReadFile('38_x86_ucode_missing_node.dts', True)
739 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find "
740 "microcode region u-boot-dtb-with-ucode", str(e.exception))
743 """Test that a missing u-boot-ucode node is detected"""
745 self._DoReadFile('39_x86_ucode_missing_node2.dts', True)
746 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find "
747 "microcode region u-boot-ucode", str(e.exception))
750 """Test that a U-Boot binary without the microcode symbol is detected"""
754 TestFunctional._MakeInputFile('u-boot', fd.read())
758 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot locate "
759 "_dt_ucode_base_size symbol in u-boot", str(e.exception))
764 TestFunctional._MakeInputFile('u-boot', fd.read())
769 self._DoReadFile('40_x86_ucode_not_in_image.dts', True)
770 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Microcode "
777 TestFunctional._MakeInputFile('u-boot', fd.read())
778 data, dtb = self._DoReadFileDtb('44_x86_optional_ucode.dts', True)
789 self.assertEqual(chr(0) * (0x200 - used_len), third)
794 self._DoReadFile('41_unknown_pos_size.dts', True)
796 "entry 'invalid-entry'", str(e.exception))
800 data = self._DoReadFile('42_intel-fsp.dts')
805 data = self._DoReadFile('43_intel-cmc.dts')