CrosEC: Add support for talking to the EC over SPI using protocol version 2.

The only devices which communicate with the EC over SPI also support protocol
version 3, but we don't yet support version 3 in depthcharge at all and this
is a reasonable stepping stone in that direction.

There are two oustanding issues with the SPI interface. First, transactions
with the EC can't be too close together or it gets tripped up at the start of
the later transaction and never responds. Second, when writing a new EC image
as part of EC software sync, bytes are occasionally dropped. We haven't yet
determined whether those bytes were send correctly but lost by the EC, or of
they were never sent in the first place somehow.

TEST=Built and booted on Pit with this driver and EC software sync enabled.
Saw that the EC was initialized successfully and commands to it completed as

Change-Id: I43b97cb728a0c4fa0eaa9dd3710a92389b2a8085
Signed-off-by: Gabe Black <>
Reviewed-by: Hung-Te Lin <>
Tested-by: Gabe Black <>
Commit-Queue: Gabe Black <>
3 files changed
tree: 15b2c553c7bee475c01703b145a053bac879f0f2
  1. .gitignore
  2. Kconfig
  3. Makefile
  5. PRESUBMIT.cfg
  6. board/
  7. src/
  8. util/