Merge tag 'u-boot-rockchip-20200501' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / tools / binman / etype / intel_fit.py
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
8 import struct
9
10 from binman.etype.blob import Entry_blob
11
12 class Entry_intel_fit(Entry_blob):
13     """Intel Firmware Image Table (FIT)
14
15     This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
16     contains information about the firmware and microcode available in the
17     image.
18
19     At present binman only supports a basic FIT with no microcode.
20     """
21     def __init__(self, section, etype, node):
22         Entry_blob.__init__(self, section, etype, node)
23
24     def ReadNode(self):
25         """Force 16-byte alignment as required by FIT pointer"""
26         Entry_blob.ReadNode(self)
27         self.align = 16
28
29     def ObtainContents(self):
30         data = struct.pack('<8sIHBB', b'_FIT_   ', 1, 0x100, 0x80, 0x7d)
31         self.SetContents(data)
32         return True