diff options
author | Simon Glass <sjg@chromium.org> | 2019-08-24 07:22:50 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-10-15 08:40:02 -0600 |
commit | 5af1207ec96e101e893605c0074205472f794982 (patch) | |
tree | 44591fc66eb9d21437e70c511880100f522264a0 /tools/binman/ftest.py | |
parent | 5e239183f62cc3740bf775e5204591cea5bf02ae (diff) | |
download | u-boot-5af1207ec96e101e893605c0074205472f794982.tar.gz |
binman: Add support for Intel FIT
A Firmware Image Table (FIT) is a data structure defined by Intel which
contains information about various things needed by the SoC, such as
microcode.
Add support for this entry as well as the pointer to it. The contents of
FIT are fixed at present. Future work is needed to support adding
microcode, etc.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 04127faa6f..080599fee3 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -3264,6 +3264,26 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('146_x86_reset16_tpl.dts') self.assertEqual(X86_RESET16_TPL_DATA, data[:len(X86_RESET16_TPL_DATA)]) + def testPackIntelFit(self): + """Test that an image with an Intel FIT and pointer can be created""" + data = self._DoReadFile('147_intel_fit.dts') + self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) + fit = data[16:32]; + self.assertEqual(b'_FIT_ \x01\x00\x00\x00\x00\x01\x80}' , fit) + ptr = struct.unpack('<i', data[0x40:0x44])[0] + + image = control.images['image'] + entries = image.GetEntries() + expected_ptr = entries['intel-fit'].image_pos - (1 << 32) + self.assertEqual(expected_ptr, ptr) + + def testPackIntelFitMissing(self): + """Test detection of a FIT pointer with not FIT region""" + with self.assertRaises(ValueError) as e: + self._DoReadFile('148_intel_fit_missing.dts') + self.assertIn("'intel-fit-ptr' section must have an 'intel-fit' sibling", + str(e.exception)) + if __name__ == "__main__": unittest.main() |