[PATCH 1/2] dt-bindings: dmaengine: Add SpacemiT K1 PDMA request numbers

Conor Dooley conor at kernel.org
Mon Jun 8 10:33:31 PDT 2026


On Sun, Jun 07, 2026 at 01:41:30PM -0400, Guodong Xu wrote:
> Add a dt-bindings header that gives symbolic names to the SpacemiT K1
> PDMA request lines of the non-secure peripherals. Device trees can use
> these K1_PDMA_* macros instead of magic numbers.
> 
> Point the spacemit,k1-pdma binding's #dma-cells description at the new
> header.
> 
> Signed-off-by: Guodong Xu <docular.xu at gmail.com>
> ---
>  .../devicetree/bindings/dma/spacemit,k1-pdma.yaml  |  4 +-
>  include/dt-bindings/dma/spacemit,k1-pdma.h         | 56 ++++++++++++++++++++++
>  2 files changed, 59 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml b/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml
> index ec06235baf5ca..0d4ac9849e27b 100644
> --- a/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml
> +++ b/Documentation/devicetree/bindings/dma/spacemit,k1-pdma.yaml
> @@ -35,7 +35,9 @@ properties:
>    '#dma-cells':
>      const: 1
>      description:
> -      The DMA request number for the peripheral device.
> +      The single cell is the DMA request number for the peripheral device.
> +      See <dt-bindings/dma/spacemit,k1-pdma.h> for the list of valid request
> +      numbers.
>  
>  required:
>    - compatible
> diff --git a/include/dt-bindings/dma/spacemit,k1-pdma.h b/include/dt-bindings/dma/spacemit,k1-pdma.h

Why does this need to be in a binding when there is no use of this in
the driver? May as well be a header, particularly if these are numbers
with a set meaning that are lifted from the TRM, rather than made up
numbers to make a driver work. The former seems likely, given you're
indexing from 3 not 0.

> new file mode 100644
> index 0000000000000..491976516550a
> --- /dev/null
> +++ b/include/dt-bindings/dma/spacemit,k1-pdma.h
> @@ -0,0 +1,56 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * This header provides DMA request number for non-secure peripherals of
> + * SpacemiT K1 PDMA.
> + *
> + * Copyright (c) 2026 Guodong Xu <docular.xu at gmail.com>
> + */
> +
> +#ifndef _DT_BINDINGS_DMA_SPACEMIT_K1_PDMA_H_
> +#define _DT_BINDINGS_DMA_SPACEMIT_K1_PDMA_H_
> +
> +#define K1_PDMA_UART0_TX	3
> +#define K1_PDMA_UART0_RX	4
> +#define K1_PDMA_UART2_TX	5
> +#define K1_PDMA_UART2_RX	6
> +#define K1_PDMA_UART3_TX	7
> +#define K1_PDMA_UART3_RX	8
> +#define K1_PDMA_UART4_TX	9
> +#define K1_PDMA_UART4_RX	10
> +#define K1_PDMA_I2C0_TX		11
> +#define K1_PDMA_I2C0_RX		12
> +#define K1_PDMA_I2C1_TX		13
> +#define K1_PDMA_I2C1_RX		14
> +#define K1_PDMA_I2C2_TX		15
> +#define K1_PDMA_I2C2_RX		16
> +#define K1_PDMA_I2C4_TX		17
> +#define K1_PDMA_I2C4_RX		18
> +#define K1_PDMA_SPI3_TX		19
> +#define K1_PDMA_SPI3_RX		20
> +#define K1_PDMA_I2S0_TX		21
> +#define K1_PDMA_I2S0_RX		22
> +#define K1_PDMA_I2S1_TX		23
> +#define K1_PDMA_I2S1_RX		24
> +#define K1_PDMA_UART5_TX	25
> +#define K1_PDMA_UART5_RX	26
> +#define K1_PDMA_UART6_TX	27
> +#define K1_PDMA_UART6_RX	28
> +#define K1_PDMA_UART7_TX	29
> +#define K1_PDMA_UART7_RX	30
> +#define K1_PDMA_UART8_TX	31
> +#define K1_PDMA_UART8_RX	32
> +#define K1_PDMA_UART9_TX	33
> +#define K1_PDMA_UART9_RX	34
> +#define K1_PDMA_I2C5_TX		35
> +#define K1_PDMA_I2C5_RX		36
> +#define K1_PDMA_I2C6_TX		37
> +#define K1_PDMA_I2C6_RX		38
> +#define K1_PDMA_I2C7_TX		39
> +#define K1_PDMA_I2C7_RX		40
> +#define K1_PDMA_I2C8_TX		41
> +#define K1_PDMA_I2C8_RX		42
> +#define K1_PDMA_CAN0_RX		43
> +#define K1_PDMA_QSPI_RX		44
> +#define K1_PDMA_QSPI_TX		45
> +
> +#endif /* _DT_BINDINGS_DMA_SPACEMIT_K1_PDMA_H_ */
> 
> -- 
> 2.43.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20260608/f1f34e46/attachment.sig>


More information about the linux-riscv mailing list