summaryrefslogtreecommitdiff
path: root/chip/stm32/registers.h
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@chromium.org>2020-05-31 21:53:15 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-24 02:33:04 +0000
commit7d4f4bf3ea9b002f5935ba0b98698999cd9d94e7 (patch)
tree91ef5d64edf8d9b73b505516efdc6bc132b7f51d /chip/stm32/registers.h
parentef356b8e6b9fcf665e67a9599323ad0af74eea08 (diff)
downloadchrome-ec-7d4f4bf3ea9b002f5935ba0b98698999cd9d94e7.tar.gz
servo: Adds USB SPI protocol V2 commands and responses
Adds the USB SPI protocol V2, this protocol supports larger SPI transfers that are delivered in multiple USB packets. This enables us to perform 2 optimizations on the USB SPI transfer speed for large USB packets: * USB packets can be grouped together reducing the total number of packets exchanged. The host can write multiple data sections sequentially without the device responding with a packet for each one. Going the other direction, the host can continue to poll the device for data until the transmission is complete. * Only a single SPI transaction is required, this eliminates overhead in setting up and getting data from SPI transactions. Benchmark results show a typical 35% improvement in performance on Servo Micro platforms with these changes on operations which involve large SPI transfers reading or writing from the flash. Signed-off-by: Brian Nemec <bnemec@chromium.org> Blocked on upstream changes to flashrom: Depends-On:https://review.coreboot.org/c/flashrom/+/41533 BUG=b:139058552 BRANCH=servo TEST=Tested with Servo Micro with the reading, erase, write, and verify operations with updated copies of flashrom. Change-Id: I04b6cf8449e32cc1b75d3501939958887eb57f5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2224765 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org>
Diffstat (limited to 'chip/stm32/registers.h')
-rw-r--r--chip/stm32/registers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h
index 97f2f7d127..ea6b2db84a 100644
--- a/chip/stm32/registers.h
+++ b/chip/stm32/registers.h
@@ -436,8 +436,9 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define EP_STATUS_OUT 0x0100
-#define EP_TX_RX_MASK (EP_TX_MASK | EP_RX_MASK)
+#define EP_TX_RX_MASK (EP_TX_MASK | EP_RX_MASK)
#define EP_TX_RX_VALID (EP_TX_VALID | EP_RX_VALID)
+#define EP_TX_RX_NAK (EP_TX_NAK | EP_RX_NAK)
#define STM32_TOGGLE_EP(n, mask, val, flags) \
STM32_USB_EP(n) = (((STM32_USB_EP(n) & (EP_MASK | (mask))) \