leverage flashrom fast partial read function to speed up VPD read.
Dmitry, this is FYR. After this is committed, the VPD read can be much faster for OOBE to read default locale setting. Hi, David, please kindly review my code. Thanks.
This patch basically re-wrote the flashromRead() and flashromWrite().
In the old code, to handle image on BIOS, we always read the whole flash
chip content and then parse fmap. Since David's CL
) makes flashrom to parse fmap,
we can just call flashrom partial read to get VPD partition.
This reduce the VPD read from 5 secs to less than 1 sec.
fmapNormalizeAreaName() is also refined because we no longer generate
layout file for flashrom. Hence, user must specify the exact partition
name on BIOS fmap, and unfortunately Mario BIOS' partition name has space.
Some comments are also refined.
Another minor improvement is that VPD utility now guesses the EPS base address
by looking at eps->table_address. This is more user-friendly when handling the
small VPD partition slice file: no longer specify -E argument. But still can
use -E argument to overwrite it (with -O option).
TEST=Tested on Z600 and Mario machine.
On Z600, I manually run the below commands:
1. a standalone VPD.bin file
2. Mario BIOS with VPD 1.0 partition
3. Mario BIOS with blank VPD partition
4. old version of VPD 2.0 partition (located at 0x100)
5. new BIOS with SPD data present (at 0x400) and VPD 2.0 (at 0x600)
On Mario machine,
% vpd -i "RO VPD" -O
% vpd -i "RO VPD" -s A=B