aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-10-25 17:48:56 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-10-25 18:11:41 +1100
commite16101408667e23d6d841003bbf07cd345d9d034 (patch)
tree681814d197dfd02bbcf64e96a815be39fb1ce7a2 /hw/fsp
parent7b0d3155c9dd71cd8d7afcec9dbbeebc22bd77bf (diff)
downloadskiboot-e16101408667e23d6d841003bbf07cd345d9d034.zip
skiboot-e16101408667e23d6d841003bbf07cd345d9d034.tar.gz
skiboot-e16101408667e23d6d841003bbf07cd345d9d034.tar.bz2
flash: rework flash_load_resource to correctly read FFS/STB
This fixes the previous reverts of loading the CAPP partition with STB headers (which broke CAPP partitions without STB headers). The new logic fixes both CAPP partition loading with STB headers *and* addresses a long standing bug due to differing interpretations of FFS. The f_part utility that *constructs* PNOR files just sets actualSize=totalSize no matter on what the size of the partition is. Prior to this patch, skiboot would always load actualSize, leading to longer than needed IPL. The pflash utility updates actualSize, so no developer has really ever noticed this, apart from maybe an inkling that it's odd that a freshly baked PNOR from op-build takes ever so slightly longer to boot than one that has had individual partitions pflashed in. With this patch, we now compute actualSize. For partitions with a STB header, we take the payload size from the STB header. For partitions that don't have a STB header, we compute the size either by parsing the ELF header or by looking at the subpartition header and computing it. We now need to read the entire partition for partitions with subpartitions so that we pass consistent values to be measured as part of Trusted Boot. As of this patch, the actualSize field in FFS is *not* relied on for partition size, we determine it from the content of the partition. However, this patch *will* break loading of partitions that are not ELF and do not contain subpartitions. Luckily, nothing in-tree makes use of that. Fixes: f0a23e4fadcdc49f134e122fa134f183f2e172f7 Based-on-patch-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/fsp')
0 files changed, 0 insertions, 0 deletions