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
tree: 34799bb9003ab107a19cc4b49627358950a41ec9
  1. .github/
  2. bindings/
  3. doc/
  4. flashchips/
  5. include/
  6. meson_cross/
  7. platform/
  8. scripts/
  9. subprojects/
  10. tests/
  11. util/
  12. .gitattributes
  13. .gitignore
  14. 82802ab.c
  15. action_descriptor.c
  16. action_descriptor.h
  17. amd_imc.c
  18. asm106x.c
  19. at45db.c
  20. atahpt.c
  21. atapromise.c
  22. atavia.c
  23. big_lock.c
  24. big_lock.h
  25. bitbang_spi.c
  26. board_enable.c
  27. buspirate_spi.c
  28. cbtable.c
  29. ch341a_spi.c
  30. ch347_spi.c
  31. chipset_enable.c
  32. cli_classic.c
  33. cli_common.c
  34. cli_getopt.c
  35. cli_output.c
  36. COPYING
  37. cros_ec.c
  38. cros_ec_commands.h
  39. custom_baud.c
  40. custom_baud_darwin.c
  41. custom_baud_linux.c
  42. dediprog.c
  43. developerbox_spi.c
  44. digilent_spi.c
  45. DIR_METADATA
  46. dirtyjtag_spi.c
  47. dmi.c
  48. Doxyfile
  49. drkaiser.c
  50. dummyflasher.c
  51. edi.c
  52. en29lv640b.c
  53. erasure_layout.c
  54. file_lock.c
  55. flashchips.c
  56. flashchips_crosbl.c
  57. flashrom.c
  58. fmap.c
  59. ft2232_spi.c
  60. gfxnvidia.c
  61. helpers.c
  62. helpers_fileio.c
  63. hwaccess_physmap.c
  64. hwaccess_x86_io.c
  65. hwaccess_x86_msr.c
  66. i2c_helper_linux.c
  67. ich_descriptors.c
  68. ichspi.c
  69. internal.c
  70. internal_par.c
  71. ipc_lock.h
  72. it8212.c
  73. it87spi.c
  74. jedec.c
  75. jlink_spi.c
  76. known_boards.c
  77. layout.c
  78. libflashrom.c
  79. libflashrom.map
  80. linux_mtd.c
  81. linux_spi.c
  82. MAINTAINERS
  83. mcp6x_spi.c
  84. mediatek_i2c_spi.c
  85. meson.build
  86. meson_options.txt
  87. mstarddc_spi.c
  88. ni845x_spi.c
  89. nic3com.c
  90. nicintel.c
  91. nicintel_eeprom.c
  92. nicintel_spi.c
  93. nicnatsemi.c
  94. nicrealtek.c
  95. ogp_spi.c
  96. opaque.c
  97. OWNERS
  98. parade_lspcon.c
  99. parallel.c
  100. pcidev.c
  101. pickit2_spi.c
  102. pony_spi.c
  103. power.c
  104. power.h
  105. PRESUBMIT.cfg
  106. print.c
  107. printlock.c
  108. processor_enable.c
  109. programmer.c
  110. programmer_table.c
  111. raiden_debug_spi.c
  112. rayer_spi.c
  113. README.chromiumos
  114. README.rst
  115. realtek_mst_i2c_spi.c
  116. s25f.c
  117. satamv.c
  118. satasii.c
  119. sb600spi.c
  120. serial.c
  121. serprog.c
  122. sfdp.c
  123. spi.c
  124. spi25.c
  125. spi25_statusreg.c
  126. spi95.c
  127. sst28sf040.c
  128. sst49lfxxxc.c
  129. sst_fwhub.c
  130. stlinkv3_spi.c
  131. stm50.c
  132. superio.c
  133. test_build.sh
  134. udelay.c
  135. udelay_dos.c
  136. unblocked_terms.txt
  137. usb_device.c
  138. usbblaster_spi.c
  139. usbdev.c
  140. VERSION
  141. w29ee011.c
  142. w39.c
  143. wbsio_spi.c
  144. writeprotect.c
  145. writeprotect_ranges.c