UPSTREAM: dummyflasher: add SR2 and SR3 emulation harness

Prepare everything for emulating SR2 and SR3 for chips that have it.

This is needed for accessing SRP1 and WPS bits which are involved in
write protection. The emulated register doesn't affect anything yet
and will be tested by write-protection tests.

BUG=none
BRANCH=none
TEST=check how input value affects status registers of emulated chip

flashrom -V -p dummy:emulate=W25Q128FV,spi_status=0x12 |
        grep 'Initial status register'
flashrom -V -p dummy:emulate=W25Q128FV,spi_status=0x1234 |
        grep 'Initial status register'
flashrom -V -p dummy:emulate=W25Q128FV,spi_status=0x123456 |
        grep 'Initial status register'

Mind that at this point there are no chips that emulate more than one
status register.

Original-Change-Id: I177ae3f068f03380f5b3941d9996a07205672e59
Original-Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/59072
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Thomas Heijligen <src@posteo.de>
(cherry picked from commit fa2cf255ec587f02baf987f21ab6d01de5db8c8e)

Change-Id: I129105822a2da2f6318a24ce333f9cf67f9f4135
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/3641347
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2 files changed
tree: 6bd3d8d3129295b515d48defafafbc72aca9e736
  1. .github/
  2. Documentation/
  3. include/
  4. Makefile.d/
  5. platform/
  6. subprojects/
  7. tests/
  8. util/
  9. .gitattributes
  10. .gitignore
  11. 82802ab.c
  12. action_descriptor.c
  13. action_descriptor.h
  14. amd_imc.c
  15. at45db.c
  16. atahpt.c
  17. atapromise.c
  18. atavia.c
  19. big_lock.c
  20. big_lock.h
  21. bitbang_spi.c
  22. board_enable.c
  23. buspirate_spi.c
  24. cbtable.c
  25. ch341a_spi.c
  26. chipset_enable.c
  27. cli_classic.c
  28. cli_common.c
  29. cli_output.c
  30. COPYING
  31. cros_alias.c
  32. cros_ec.c
  33. cros_ec.h
  34. cros_ec_commands.h
  35. cros_ec_dev.c
  36. custom_baud.c
  37. custom_baud_linux.c
  38. dediprog.c
  39. dep_wp_statusreg.c
  40. dep_writeprotect.c
  41. dep_writeprotect.h
  42. developerbox_spi.c
  43. digilent_spi.c
  44. dmi.c
  45. Doxyfile
  46. drkaiser.c
  47. dummyflasher.c
  48. edi.c
  49. en29lv640b.c
  50. file_lock.c
  51. flashchips.c
  52. flashchips_crosbl.c
  53. flashrom.8.tmpl
  54. flashrom.c
  55. fmap.c
  56. ft2232_spi.c
  57. gfxnvidia.c
  58. helpers.c
  59. hwaccess_physmap.c
  60. hwaccess_x86_io.c
  61. hwaccess_x86_msr.c
  62. i2c_helper_linux.c
  63. ich_descriptors.c
  64. ichspi.c
  65. internal.c
  66. ipc_lock.h
  67. it8212.c
  68. it85spi.c
  69. it87spi.c
  70. jedec.c
  71. jlink_spi.c
  72. layout.c
  73. libflashrom.c
  74. libflashrom.map
  75. linux_mtd.c
  76. linux_spi.c
  77. lspcon_i2c_spi.c
  78. Makefile
  79. Makefile.include
  80. mcp6x_spi.c
  81. mediatek_i2c_spi.c
  82. meson.build
  83. meson_options.txt
  84. mstarddc_spi.c
  85. ni845x_spi.c
  86. nic3com.c
  87. nicintel.c
  88. nicintel_eeprom.c
  89. nicintel_spi.c
  90. nicnatsemi.c
  91. nicrealtek.c
  92. ogp_spi.c
  93. opaque.c
  94. OWNERS
  95. pcidev.c
  96. pickit2_spi.c
  97. pony_spi.c
  98. power.c
  99. power.h
  100. PRESUBMIT.cfg
  101. print.c
  102. print_wiki.c
  103. processor_enable.c
  104. programmer.c
  105. programmer_table.c
  106. raiden_debug_spi.c
  107. rayer_spi.c
  108. README
  109. README.chromiumos
  110. realtek_mst_i2c_spi.c
  111. s25f.c
  112. satamv.c
  113. satasii.c
  114. sb600spi.c
  115. serial.c
  116. serprog.c
  117. sfdp.c
  118. spi.c
  119. spi25.c
  120. spi25_statusreg.c
  121. spi95.c
  122. sst28sf040.c
  123. sst49lfxxxc.c
  124. sst_fwhub.c
  125. stlinkv3_spi.c
  126. stm50.c
  127. udelay.c
  128. usb_device.c
  129. usbblaster_spi.c
  130. usbdev.c
  131. w29ee011.c
  132. w39.c
  133. wbsio_spi.c
  134. writeprotect.c
  135. writeprotect_ranges.c