summaryrefslogtreecommitdiff
path: root/chip/stm32/usart-stm32f3.c
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2015-07-15 15:03:40 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-21 18:30:40 +0000
commit1e3d00ff7ae32d58ac9c27ef09b22df58e48b1c4 (patch)
tree190ad8a9e3b463fb7acc6068b1cf73f0286baadd /chip/stm32/usart-stm32f3.c
parentff9934264163dd0d7e795f32144c6c1082fdf040 (diff)
downloadchrome-ec-1e3d00ff7ae32d58ac9c27ef09b22df58e48b1c4.tar.gz
USART: Add DMA based transmitter
This adds a new transmission implementation for the multi UART driver. It is a DMA based transmitter that can directly read from the TX queue with zero copy overhead. The DMA channel used as well as the maximum DMA transmission size are configurable per UART at the board level. This also updates the Ryu AP UART to use DMA transmission. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Manually verify that the AP UART forwarding works Change-Id: I3cb27d0f9015043d75a38c12919388afe90dc4af Reviewed-on: https://chromium-review.googlesource.com/286274 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'chip/stm32/usart-stm32f3.c')
-rw-r--r--chip/stm32/usart-stm32f3.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/stm32/usart-stm32f3.c b/chip/stm32/usart-stm32f3.c
index 58eb500b1d..9484fcdbd7 100644
--- a/chip/stm32/usart-stm32f3.c
+++ b/chip/stm32/usart-stm32f3.c
@@ -46,6 +46,11 @@ static struct usart_hw_ops const usart_variant_hw_ops = {
.disable = usart_variant_disable,
};
+void usart_clear_tc(struct usart_config const *config)
+{
+ STM32_USART_ICR(config->hw->base) |= STM32_USART_ICR_TCCF;
+}
+
/*
* USART interrupt bindings. These functions can not be defined as static or
* they will be removed by the linker because of the way that DECLARE_IRQ works.