cgpt.py: Use --fast-verify when writing with flashrom
This patch makes the script generated by cgpt.py use flashrom's
--fast-verify option to make writing to SPI NOR flash much faster in
generating the partition table for raw NAND devices.
BUG=chromium:444117
TEST=copy-pasted the generated write_base_table function and ran it on a
Storm with NAND rework, finding it to be much faster (seconds vs
minutes).
Change-Id: I0e8fd0cca63e7fcb510a82dba79c9099fa53ec7f
Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/243319
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/build_library/cgpt.py b/build_library/cgpt.py
index 9c76e19..e612f93 100755
--- a/build_library/cgpt.py
+++ b/build_library/cgpt.py
@@ -676,7 +676,7 @@
lines += ['${GPT} show ${target}']
if _HasExternalGpt(partitions):
- lines += ['flashrom -w -iRW_GPT:${gptfile}']
+ lines += ['flashrom -w -iRW_GPT:${gptfile} --fast-verify']
sfile.write('%s\n}\n' % '\n '.join(lines))
@@ -1225,7 +1225,7 @@
if 'bytes' not in metadata:
return
capacity = metadata['bytes']
- erase_block_size = metadata.get('erase_block_size', 0);
+ erase_block_size = metadata.get('erase_block_size', 0)
total = sum(partition['bytes'] +
erase_block_size * partition.get('reserved_erase_blocks', 0)
for partition in partitions if partition.get('num') != 'metadata')