CHROMIUM: cli_classic: refactor to make downstreaming WP easier

Refactor cli_classic so that all code specific to the deprecated
WP implementation is contained in a new dep_wp_cli() function.

This commit also integrates some of the changes from the upstream patch
that adds the new writeprotect CLI:
https://review.coreboot.org/c/flashrom/+/58738.

Notably, the dep_wp_cli() function signature also matches the wp_cli()
signature in the upstream patch to make incremental migration easier.
See go/flashrom-wp for additional details about the migration.

BUG=b:182223106
TEST=flashrom --wp-{enable,disable,range,status,list} on kasumi DUT
BRANCH=none

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