gooftool: Probe embedded controller by mosys.

Probing embedded controller by superiotool is now deprecated.
mosys will provide same functionality.

BUG=chrome-os-partner:8551
TEST=Manually verified on ZGB, getting "nuvXXX npceXXX" output.
     On platforms without "ec info" command, see NONE result.

Change-Id: I775170b20ff487a43418720308ece063d9ab302a
Reviewed-on: https://gerrit.chromium.org/gerrit/18519
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
diff --git a/probe.py b/probe.py
index b835c8a..6a9e51e 100644
--- a/probe.py
+++ b/probe.py
@@ -515,13 +515,14 @@
 
 @_ComponentProbe('embedded_controller')
 def _ProbeEmbeddedController():
-  """Reformat superiotool output."""
-  cmd_stdout = RunShellCmd('superiotool').stdout
-  # Example cmd output:
-  # 'superiotool r\nFound Nuvoton WPCE775x (id=0x05, rev=0x02) at 0x2e'
-  match = re.findall(r'Found (.*) at', cmd_stdout)
-  return CompactStr(match.pop()) if match else None
-
+  """Reformat mosys output."""
+  # Example mosys command output:
+  # vendor="VENDOR" name="CHIPNAME" fw_version="ECFWVER"
+  ecinfo = re.findall(r'\bvendor="([^"]*)".*\bname="([^"]*)"',
+                      RunShellCmd('mosys -k ec info').stdout)
+  if ecinfo:
+    return CompactStr(*ecinfo)
+  return None
 
 @_ComponentProbe('ethernet')
 def _ProbeEthernet(flimflam):