diff options
author | Nick Sanders <nsanders@chromium.org> | 2018-08-14 17:44:52 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-15 04:42:49 -0700 |
commit | 428e0323cd3373519cac05389587becf444ec0aa (patch) | |
tree | 797d74ff9e2bafbdc0754d103122c6d46c7ba6e8 | |
parent | a1e04f74c47d003bddd1802ab50b3ac74c2ea875 (diff) | |
download | chrome-ec-428e0323cd3373519cac05389587becf444ec0aa.tar.gz |
servo_micro: enable dma, increase queue size
servo_micro can drop incoming UART chars is there are
unfortunately timed interrupts. We'll add DMA RX and
extra queueing.
BRANCH=servo
BUG=b:80540170,chromium:865478
TEST=stress servo_micro console and ec console. No chars dropped anymore.
Change-Id: I939bec0862c318686a0215ec8081823aa8c35fec
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1175321
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r-- | board/servo_micro/board.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/board/servo_micro/board.c b/board/servo_micro/board.c index a54e5581f8..5887d559ae 100644 --- a/board/servo_micro/board.c +++ b/board/servo_micro/board.c @@ -31,8 +31,8 @@ * Forward UARTs as a USB serial interface. */ -#define USB_STREAM_RX_SIZE 16 -#define USB_STREAM_TX_SIZE 16 +#define USB_STREAM_RX_SIZE 32 +#define USB_STREAM_TX_SIZE 32 /****************************************************************************** * Forward USART2 as a simple USB serial interface. @@ -41,14 +41,17 @@ static struct usart_config const usart2; struct usb_stream_config const usart2_usb; -static struct queue const usart2_to_usb = QUEUE_DIRECT(64, uint8_t, +static struct queue const usart2_to_usb = QUEUE_DIRECT(256, uint8_t, usart2.producer, usart2_usb.consumer); static struct queue const usb_to_usart2 = QUEUE_DIRECT(64, uint8_t, usart2_usb.producer, usart2.consumer); +static struct usart_rx_dma const usart2_rx_dma = + USART_RX_DMA(STM32_DMAC_CH5, 32); + static struct usart_config const usart2 = USART_CONFIG(usart2_hw, - usart_rx_interrupt, + usart2_rx_dma.usart_rx, usart_tx_interrupt, 115200, 0, @@ -73,14 +76,17 @@ USB_STREAM_CONFIG_USART_IFACE(usart2_usb, static struct usart_config const usart3; struct usb_stream_config const usart3_usb; -static struct queue const usart3_to_usb = QUEUE_DIRECT(64, uint8_t, +static struct queue const usart3_to_usb = QUEUE_DIRECT(256, uint8_t, usart3.producer, usart3_usb.consumer); static struct queue const usb_to_usart3 = QUEUE_DIRECT(64, uint8_t, usart3_usb.producer, usart3.consumer); +static struct usart_rx_dma const usart3_rx_dma = + USART_RX_DMA(STM32_DMAC_CH3, 32); + static struct usart_config const usart3 = USART_CONFIG(usart3_hw, - usart_rx_interrupt, + usart3_rx_dma.usart_rx, usart_tx_interrupt, 115200, 0, @@ -105,14 +111,17 @@ USB_STREAM_CONFIG_USART_IFACE(usart3_usb, static struct usart_config const usart4; struct usb_stream_config const usart4_usb; -static struct queue const usart4_to_usb = QUEUE_DIRECT(64, uint8_t, +static struct queue const usart4_to_usb = QUEUE_DIRECT(256, uint8_t, usart4.producer, usart4_usb.consumer); static struct queue const usb_to_usart4 = QUEUE_DIRECT(64, uint8_t, usart4_usb.producer, usart4.consumer); +static struct usart_rx_dma const usart4_rx_dma = + USART_RX_DMA(STM32_DMAC_CH6, 32); + static struct usart_config const usart4 = USART_CONFIG(usart4_hw, - usart_rx_interrupt, + usart4_rx_dma.usart_rx, usart_tx_interrupt, 115200, 0, |