Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Afm 8 k #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion intelprot/bmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def build_pfm_afm_in_update_capsule(self):
# create "pfm_afm_in_update_cap.bin" file included in recovery capsule
self.pfm_afm_in_update_cap = "{}-pfm_afm_in_update_cap.bin".format(self.platform_name)
if os.stat(self.pfm_unsigned).st_size < 0x1000:
read_afm_size = 0x1000
read_afm_size = os.stat(self.afm_active_capsule).st_size
padding_size = (self.afm_addr - self.pfm_offset) - (self.pfm_size + 0x400)
with open(self.pfm_afm_in_update_cap, 'wb') as f1, \
open(self.pfm_signed, 'rb') as f2, open(self.afm_active_capsule, 'rb') as f3:
Expand Down
4 changes: 3 additions & 1 deletion intelprot/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
BLK0_MAGIC_TAG = 0xB6EAFD19

AFM_CAP_SIZE = 128*1024 # 128KB total size
AFM_ALIGN_SIZE = 4*1024 # 4KB aligned for each device AFM
AFM_ALIGN_SIZE = 8*1024 # 8KB aligned for each device AFM
AFM_SIGN_SIZE = 1024 # 1KB blocksign size
AFM_CAP_TAG = 0x8883CE1D # AFM Magic/TAG
AFM_SPI_TYPE = 0x3 # AFM SPI_TYPE
Expand Down Expand Up @@ -955,6 +955,8 @@ def pack_device_measurement(self, dev_name):
lst_idx_meas_data = self.manifest['afm_data'][dev_name]["measurement"][idx]["measurement"]
idx_meas_hexstr =''.join(lst_idx_meas_data)
meas_size = int(self.manifest['afm_data'][dev_name]["measurement"][idx]["meas_value_size"], 0)
number_of_possible_measurement = int(self.manifest['afm_data'][dev_name]["measurement"][idx]["number_of_possible_measurement"], 0)
meas_size *= number_of_possible_measurement
#print("\n**** idx={}, idx_meas_hexstr={} \n".format(idx, idx_meas_hexstr))
#print("\n**** len(idx_meas_hexstr)={}, meas_size = {}".format(len(idx_meas_hexstr), meas_size))
afm_dev_meas += struct.pack("%ds"%(meas_size), bytes.fromhex(idx_meas_hexstr))
Expand Down