mbox series

[0/2] stm32 usart add fifo threshold configuration

Message ID 20210406072122.27384-1-erwan.leray@foss.st.com
Headers show
Series stm32 usart add fifo threshold configuration | expand

Message

Erwan LE RAY April 6, 2021, 7:21 a.m. UTC
This series adds the support for two optional DT properties, to configure
RX and TX FIFO thresholds:
 - st,rx-fifo-threshold-bytes
 - st,tx-fifo-threshold-bytes
This replaces hard-coded 8 bytes threshold. No functional change expected
if unspecified (keep 8 as default).

Erwan Le Ray (1):
  dt-bindings: serial: stm32: add fifo threshold configuration

Fabrice Gasnier (1):
  serial: stm32: add fifo threshold configuration

 .../bindings/serial/st,stm32-uart.yaml        | 31 ++++++++++-
 drivers/tty/serial/stm32-usart.c              | 53 ++++++++++++++++---
 drivers/tty/serial/stm32-usart.h              |  8 +--
 3 files changed, 79 insertions(+), 13 deletions(-)

Comments

Rob Herring (Arm) April 9, 2021, 4:17 p.m. UTC | #1
On Tue, Apr 06, 2021 at 09:21:21AM +0200, Erwan Le Ray wrote:
> Add two optional DT properties, to configure RX and TX fifo threshold:
> - st,rx-fifo-threshold-bytes
> - st,tx-fifo-threshold-bytes
> 
> This patch depends on patch ("dt-bindings: serial: Add rx-tx-swap to stm32-usart").
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
> Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
> 
> diff --git a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml
> index c69f8464cdf3..e163449bf39e 100644
> --- a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml
> +++ b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml
> @@ -65,6 +65,22 @@ properties:
>    linux,rs485-enabled-at-boot-time: true
>    rs485-rx-during-tx: true
>  
> +  st,rx-fifo-threshold-bytes:
> +    description:
> +      RX FIFO threshold configuration in bytes.
> +      If value is set to 1, RX FIFO threshold is disabled.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [1, 2, 4, 8, 12, 14, 16]
> +    default: 8
> +
> +  st,tx-fifo-threshold-bytes:
> +    description:
> +      TX FIFO threshold configuration in bytes.
> +      If value is set to 1, TX FIFO threshold is disabled.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [1, 2, 4, 8, 12, 14, 16]
> +    default: 8

We already have 'tx-threshold' for 8250, so reuse that and add 
'rx-threshold'.

Rob