mirror of
https://xff.cz/git/u-boot/
synced 2025-11-01 19:05:51 +01:00
binman: Support locating an FDT map
Add support for locating an image's Fdt map which is used to determine the contents and structure of the image. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -24,6 +24,7 @@ import command
|
||||
import control
|
||||
import elf
|
||||
import fdt
|
||||
from etype import fdtmap
|
||||
import fdt_util
|
||||
import fmap_util
|
||||
import test_util
|
||||
@@ -2267,6 +2268,20 @@ class TestFunctional(unittest.TestCase):
|
||||
self.assertEqual(len(data), 0x100 + section_size)
|
||||
self.assertEqual(section_size, 0x400 + dtb_size)
|
||||
|
||||
def testFindFdtmap(self):
|
||||
"""Test locating an FDT map in an image"""
|
||||
self._CheckLz4()
|
||||
data = self.data = self._DoReadFileRealDtb('128_decode_image.dts')
|
||||
image = control.images['image']
|
||||
entries = image.GetEntries()
|
||||
entry = entries['fdtmap']
|
||||
self.assertEqual(entry.image_pos, fdtmap.LocateFdtmap(data))
|
||||
|
||||
def testFindFdtmapMissing(self):
|
||||
"""Test failing to locate an FDP map"""
|
||||
data = self._DoReadFile('005_simple.dts')
|
||||
self.assertEqual(None, fdtmap.LocateFdtmap(data))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user