faft: Support EC write protect on non-Chrome-EC devices

On non-Chrome-EC devices, we use flashrom as a single interface to set
write protection for different chips. This CL supports this function
such that we can run suite:faft_ec_wp on non-Chrome-EC devices.

BUG=chrome-os-partner:15835
TEST=mock the flashrom in DUT and run suite:faft_ec_wp, see it executed.

Change-Id: I0745a2cf05656ba84099847d3eb63c924027fd90
Reviewed-on: https://gerrit.chromium.org/gerrit/38363
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/client/cros/faft_client.py b/client/cros/faft_client.py
index ecf7cff..5717ff9 100755
--- a/client/cros/faft_client.py
+++ b/client/cros/faft_client.py
@@ -675,6 +675,20 @@
         self._ec_handler.dump_whole(ec_path)
 
 
+    def set_EC_write_protect(self, enable):
+        """Enable write protect of the EC flash chip.
+
+        Args:
+            enable: True if activating EC write protect. Otherwise, False.
+        """
+        self._chromeos_interface.log('Requesting set EC write protect to %s' %
+                                     ('enable' if enable else 'disable'))
+        if enable:
+            self._ec_handler.enable_write_protect()
+        else:
+            self._ec_handler.disable_write_protect()
+
+
     def run_cgpt_test_loop(self):
         """Run the CgptState test loop. The tst logic is handled in the client.