summaryrefslogtreecommitdiff
path: root/util/ectool.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-07-27 11:13:45 +0100
committerGerrit <chrome-bot@google.com>2012-09-17 10:10:14 -0700
commit78474d4eeb29537e7fd0ca071cf0a78a464e5f90 (patch)
tree014ddf606179598537106a3bebfb5f8245f8b378 /util/ectool.c
parentb4d73d3c72d5773e39812ba069dfff12d6da71c1 (diff)
downloadchrome-ec-78474d4eeb29537e7fd0ca071cf0a78a464e5f90.tar.gz
spi: Rewrite driver for new protocol, better performance
The old spi driver has atrophied in various ways. It doesn't support the new protocol and does not build either. Rewrite the driver to: - Use dma for reception (rather than just reception) - This makes message reception more robust and allows us to process the new multi-byte commands - Add timeouts for rx and tx so that we don't wait forever - Increase buffer sizes to deal with new larger messages - Always send a preamble byte regardless of SPI clock speed (previously above 10MHz we sometimes miss this) - Use the NSS line to delineate transactions. When it drops, a transaction is starting. When it rises the transaction is immediately terminates regardless of state. This keeps the AP and EC in sync even in the event of timeouts, bus errors and other oddities. - Implement the new protocol which has a checksum, version byte, etc - Set up tx dma in advance and kick it when ready, thus ensuring that a message body is always attached immediately after the preamble - Use the new host_cmd_handle_args structure, which makes things much easier for us, since we don't need globals, and can use the send_response handler to know when a slow command is complete. - Handle the new type of 'slow' commands properly BUG=chrome-os-partner:10533 TEST=manual build and boot to kernel on snow Change-Id: I11767d1a6f045a86f6c9a0b4b1e943b660e4da33 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/32076 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util/ectool.c')
0 files changed, 0 insertions, 0 deletions