stm32: serial Allow configuring Rx DMA buffer size

This commit is contained in:
David Sidrane 2017-05-06 05:16:21 -10:00
parent c5cd006bd2
commit b62ef579c8
2 changed files with 19 additions and 2 deletions

View File

@ -6165,6 +6165,19 @@ if STM32_SERIALDRIVER
comment "Serial Driver Configuration"
config STM32_SERIAL_RXDMA_BUFFER_SIZE
int "Rx DMA buffer size"
default 32
range 32 4096
depends on USART1_RXDMA || USART2_RXDMA || USART3_RXDMA || UART4_RXDMA || UART5_RXDMA || USART6_RXDMA || UART7_RXDMA || UART8_RXDMA
---help---
The DMA buffer size when using RX DMA to emulate a FIFO.
When streaming data, the generic serial layer will be called
every time the FIFO receives half or this number of bytes.
Value given here will be rounded up to next multiple of 4 bytes.
config SERIAL_DISABLE_REORDERING
bool "Disable reordering of ttySx devices."
depends on STM32_USART1 || STM32_USART2 || STM32_USART3 || STM32_UART4 || STM32_UART5 || STM32_USART6 || STM32_UART7 || STM32_UART8

View File

@ -182,8 +182,12 @@
* When streaming data, the generic serial layer will be called
* every time the FIFO receives half this number of bytes.
*/
# define RXDMA_BUFFER_SIZE 32
# if !defined(CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE)
# define CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE 32
# endif
# define RXDMA_MUTIPLE 4
# define RXDMA_BUFFER_SIZE ((CONFIG_STM32_SERIAL_RXDMA_BUFFER_SIZE \
+ RXDMA_MUTIPLE) & ~RXDMA_MUTIPLE)
/* DMA priority */