From b7a3e7dc31c55855e0b7e455460b888e6b7d4012 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Thu, 23 Jan 2020 10:17:00 +0100 Subject: [PATCH] dts: bindings: dma add support for controller This patch introduces the periph to/from memory dma transfer define new values for dma cells on client side Signed-off-by: Francois Ramu --- dts/bindings/dma/st,stm32-dma.yaml | 5 +++++ include/dt-bindings/dma/stm32_dma.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/dts/bindings/dma/st,stm32-dma.yaml b/dts/bindings/dma/st,stm32-dma.yaml index b014fb1baa0..7fd8d84b09b 100644 --- a/dts/bindings/dma/st,stm32-dma.yaml +++ b/dts/bindings/dma/st,stm32-dma.yaml @@ -24,6 +24,11 @@ properties: # Parameter syntax of stm32 follows the dma client dts syntax # in the Linux kernel declared in # https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/plain/Bindings/dma/stm32-dma.txt +# +# channel: DMA channel +# slot: DMA stream of the DMA channel for DMA V1 or for DMA V2 with MUX peripheral request else NA +# channel-config: configuration of the selected DMA channel +# features: fifo threshold if relevant for DMA V1 or TBD for DMA V2 dma-cells: - channel diff --git a/include/dt-bindings/dma/stm32_dma.h b/include/dt-bindings/dma/stm32_dma.h index 623012a021a..5d8d90b99db 100644 --- a/include/dt-bindings/dma/stm32_dma.h +++ b/include/dt-bindings/dma/stm32_dma.h @@ -4,8 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ /* macros for channel-config */ +#define STM32_DMA_CONFIG_DIRECTION(config) (config & 0x3 << 6) #define STM32_DMA_CONFIG_PERIPH_ADDR_INC(config) (config & 0x1 << 9) #define STM32_DMA_CONFIG_MEM_ADDR_INC(config) (config & 0x1 << 10) +#define STM32_DMA_CONFIG_PERIPH_DATA_SIZE(config) (config & (0x3 << 11)) +#define STM32_DMA_CONFIG_MEM_DATA_SIZE(config) (config & (0x3 << 13)) #define STM32_DMA_CONFIG_PERIPH_INC_FIXED(config) (config & 0x1 << 15) #define STM32_DMA_CONFIG_PRIORITY(config) ((config >> 16) & 0x3)