summaryrefslogtreecommitdiff
path: root/chip/g/sps_tpm.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-07-24 17:08:19 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-13 23:34:05 +0000
commit36ed861be833df5751c668fdc1b47fb00e3ebada (patch)
treeb2c276900e100a9e9f528186d7bc87f9600e752a /chip/g/sps_tpm.c
parentdf2e760a93885c01bc86d6e5a7099b00df4c824b (diff)
downloadchrome-ec-36ed861be833df5751c668fdc1b47fb00e3ebada.tar.gz
cr50: sps: allow receive registration function set FIFO threshold
The default receive FIFO threshold of 8 (meaning that 9 bytes need to be received before receive IRQ fires) is good for high volume transfers, when the amount of transferred data greatly exceeds the threshold. But in case of TPM transactions, which start with a 4 byte header and then stall while the device processes it, the default threshold guarantees delays on every transaction, as the receiver does not start processing the header until 5 idle bytes are transferred to bring the total number to nine. The suggested solution is to allow to specify the receive FIFO interrupt request threshold at run time, by adding this value to the receive function registration API. BRANCH=none BUG=chrome-os-partner:43025 TEST=verified that spstest still works fine. Change-Id: I92517205a7d0d47893b702efa188eb524fb18a49 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/289331 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip/g/sps_tpm.c')
-rw-r--r--chip/g/sps_tpm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/chip/g/sps_tpm.c b/chip/g/sps_tpm.c
index 5ce79a661f..0dea0ce4ed 100644
--- a/chip/g/sps_tpm.c
+++ b/chip/g/sps_tpm.c
@@ -250,7 +250,11 @@ static void tpm_rx_handler(uint8_t *data, size_t data_size, int cs_disabled)
static void sps_tpm_enable(void)
{
- sps_register_rx_handler(SPS_GENERIC_MODE, tpm_rx_handler);
+ /*
+ * Let's make sure we get an interrupt as soon as the header is
+ * received.
+ */
+ sps_register_rx_handler(SPS_GENERIC_MODE, tpm_rx_handler, 3);
init_new_cycle();
}