-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
6 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# Copyright (c) 2016 Google, Inc | ||
# Written by Simon Glass <[email protected]> | ||
# | ||
# Entry-type module for Intel Firmware Image Table | ||
# | ||
|
||
import struct | ||
|
||
from blob import Entry_blob | ||
|
||
class Entry_intel_fit(Entry_blob): | ||
"""Intel Firmware Image Table (FIT) | ||
This entry contains a dummy FIT as required by recent Intel CPUs. The FIT | ||
contains information about the firmware and microcode available in the | ||
image. | ||
At present binman only supports a basic FIT with no microcode. | ||
""" | ||
def __init__(self, section, etype, node): | ||
Entry_blob.__init__(self, section, etype, node) | ||
|
||
def ReadNode(self): | ||
"""Force 16-byte alignment as required by FIT pointer""" | ||
Entry_blob.ReadNode(self) | ||
self.align = 16 | ||
|
||
def ObtainContents(self): | ||
data = struct.pack('<8sIHBB', '_FIT_ ', 1, 0x100, 0x80, 0x7d) | ||
self.SetContents(data) | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# Copyright (c) 2016 Google, Inc | ||
# Written by Simon Glass <[email protected]> | ||
# | ||
# Entry-type module for a pointer to an Intel Firmware Image Table | ||
# | ||
|
||
import struct | ||
|
||
from blob import Entry_blob | ||
|
||
class Entry_intel_fit_ptr(Entry_blob): | ||
"""Intel Firmware Image Table (FIT) pointer | ||
This entry contains a pointer to the FIT. It is required to be at address | ||
0xffffffc0 in the image. | ||
""" | ||
def __init__(self, section, etype, node): | ||
Entry_blob.__init__(self, section, etype, node) | ||
if self.HasSibling('intel-fit') is False: | ||
self.Raise("'intel-fit-ptr' section must have an 'intel-fit' sibling") | ||
|
||
def _GetContents(self): | ||
fit_pos = self.GetSiblingImagePos('intel-fit') | ||
return struct.pack('<II', fit_pos or 0, 0) | ||
|
||
def ObtainContents(self): | ||
self.SetContents(self._GetContents()) | ||
return True | ||
|
||
def ProcessContents(self): | ||
"""Write an updated version of the FIT pointer to this entry | ||
This is necessary since image_pos is not available when ObtainContents() | ||
is called, since by then the entries have not been packed in the image. | ||
""" | ||
return self.ProcessContentsUpdate(self._GetContents()) | ||
|
||
def Pack(self, offset): | ||
"""Special pack method to set the offset to the right place""" | ||
return Entry_blob.Pack(self, 0xffffffc0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/dts-v1/; | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
binman { | ||
end-at-4gb; | ||
size = <0x80>; | ||
|
||
u-boot { | ||
}; | ||
|
||
intel-fit { | ||
}; | ||
|
||
intel-fit-ptr { | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/dts-v1/; | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
binman { | ||
end-at-4gb; | ||
size = <0x80>; | ||
|
||
u-boot { | ||
}; | ||
|
||
intel-fit-ptr { | ||
}; | ||
}; | ||
}; |