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
Signed-off-by: Gabe Black <firstname.lastname@example.org>
Reviewed-by: Hung-Te Lin <email@example.com>
Tested-by: Gabe Black <firstname.lastname@example.org>
Commit-Queue: Gabe Black <email@example.com>
3 files changed