CHROMIUM: cros_ec: Fix the unspecified jump error
This CL fix the bug that EC flashing with -i --noverify-all always fails
and enhances error reporting for unspecified EC jumps.
Key changes:
1. Explicit error for unspecified jump failure in cros_ec_jump_copy():
When cros_ec_jump_copy() is called with an unspecified target and cannot
determine a suitable target from fwcopy due to unsuccessful
parse_fmap(), it returns the error code without any message. Add the
corresponding error message to provide clearer diagnostics.
2. Enhance FMAP parsing robustness in cros_ec_prepare()
If the FMAP is not include in the layout with `-i` while writing with
`--no-verify-all`, the `img` sent to cros_ec_prepare() will not include
any valid FMAP, which is critical for understanding firmware layout in
parse_fmap(). Add a fallback to read FMAP from ROM to enhance the
robustness.
BUG=b:419110112
BUG=b:419479383
TEST=emerge-brox flashrom
TEST= flashrom -p ec -w -i RO_FRID:ro_frid.bin --noverify-all pass
Change-Id: If6a8f3687c9e55e700b75a94ad5241cf9f2f66f0
Signed-off-by: Hsuan Ting Chen <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/6578991
Reviewed-by: Jian-Jia Su <[email protected]>
1 file changed