intel_fit.py 943 B

1234567891011121314151617181920212223242526272829303132
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Copyright (c) 2016 Google, Inc
  3. # Written by Simon Glass <sjg@chromium.org>
  4. #
  5. # Entry-type module for Intel Firmware Image Table
  6. #
  7. import struct
  8. from binman.etype.blob_ext import Entry_blob_ext
  9. class Entry_intel_fit(Entry_blob_ext):
  10. """Intel Firmware Image Table (FIT)
  11. This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
  12. contains information about the firmware and microcode available in the
  13. image.
  14. At present binman only supports a basic FIT with no microcode.
  15. """
  16. def __init__(self, section, etype, node):
  17. super().__init__(section, etype, node)
  18. def ReadNode(self):
  19. """Force 16-byte alignment as required by FIT pointer"""
  20. super().ReadNode()
  21. self.align = 16
  22. def ObtainContents(self):
  23. data = struct.pack('<8sIHBB', b'_FIT_ ', 1, 0x100, 0x80, 0x7d)
  24. self.SetContents(data)
  25. return True