diff --git a/dts/arm/nxp/nxp_k6x.dtsi b/dts/arm/nxp/nxp_k6x.dtsi index 8951629245..066d910c0a 100644 --- a/dts/arm/nxp/nxp_k6x.dtsi +++ b/dts/arm/nxp/nxp_k6x.dtsi @@ -511,6 +511,25 @@ #address-cells = <1>; #size-cells = <0>; }; + + edma0: dma-controller@40008000 { + #dma-cells = <2>; + compatible = "nxp,mcux-edma"; + dma-channels = <16>; + dma-requests = <64>; + nxp,mem2mem; + reg = <0x40008000 0x1000>, + <0x40021000 0x1000>; + interrupts = <0 0>, <1 0>, <2 0>, <3 0>, + <4 0>, <5 0>, <6 0>, <7 0>, + <8 0>, <9 0>, <10 0>, <11 0>, + <12 0>, <13 0>, <14 0>, <15 0>, + <16 0>; + clocks = <&sim KINETIS_SIM_DMA_CLK 0x1040 0x00000002>, + <&sim KINETIS_SIM_DMAMUX_CLK 0x103C 0x00000002>; + status = "disabled"; + label = "EDMA0"; + }; }; }; diff --git a/dts/arm/nxp/nxp_rt.dtsi b/dts/arm/nxp/nxp_rt.dtsi index 8424d6b0bf..b7e76a4902 100644 --- a/dts/arm/nxp/nxp_rt.dtsi +++ b/dts/arm/nxp/nxp_rt.dtsi @@ -601,6 +601,25 @@ status = "disabled"; label = "CSI"; }; + + edma0: dma-controller@400e8000 { + #dma-cells = <2>; + compatible = "nxp,mcux-edma"; + dma-channels = <32>; + dma-requests = <128>; + nxp,mem2mem; + nxp,a_on; + reg = <0x400E8000 0x4000>, + <0x400EC000 0x4000>; + interrupts = <0 0>, <1 0>, <2 0>, <3 0>, + <4 0>, <5 0>, <6 0>, <7 0>, + <8 0>, <9 0>, <10 0>, <11 0>, + <12 0>, <13 0>, <14 0>, <15 0>, + <16 0>; + clocks = <&ccm IMX_CCM_EDMA_CLK 0x7C 0x000000C0>; + status = "disabled"; + label = "EDMA0"; + }; }; }; diff --git a/dts/bindings/dma/nxp,mcux-edma.yaml b/dts/bindings/dma/nxp,mcux-edma.yaml new file mode 100644 index 0000000000..a95afeff46 --- /dev/null +++ b/dts/bindings/dma/nxp,mcux-edma.yaml @@ -0,0 +1,54 @@ +# Copyright (c) 2020, NXP +# SPDX-License-Identifier: Apache-2.0 + +description: NXP MCUX EDMA controller + +compatible: "nxp,mcux-edma" + +include: dma-controller.yaml + +properties: + reg: + required: true + + interrupts: + required: true + + dma-channels: + required: true + + dma-requests: + required: true + + nxp,mem2mem: + type: boolean + description: If the DMA controller supports memory to memory transfer + + nxp,a_on: + type: boolean + description: If the DMA controller supports always on + + "#dma-cells": + type: int + required: true + description: Number of items to expect in a DMAMUX specifier + +# Parameter syntax of NXP follows the dmamux client dts syntax +# in the Linux kernel declared in +# https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/dma/fsl-edma.txt +# +#- #dma-cells : Must be <2>. +# The 1st cell specifies the DMAMUX(0 for DMAMUX0 and 1 for DMAMUX1). +# Specific request source can only be multiplexed by specific channels +# group called DMAMUX. +# The 2nd cell specifies the request source(slot) ID. +# See the SoC's reference manual for all the supported request sources. +# * DMA clients +# DMA client drivers that uses the DMA function must use the format described +# in the dma.txt file, using a two-cell specifier for each channel: the 1st +# specifies the channel group(DMAMUX) in which this request can be multiplexed, +# and the 2nd specifies the request source. + +dma-cells: + - mux + - source diff --git a/include/dt-bindings/clock/imx_ccm.h b/include/dt-bindings/clock/imx_ccm.h index 066c7f4881..2d470a6f8b 100644 --- a/include/dt-bindings/clock/imx_ccm.h +++ b/include/dt-bindings/clock/imx_ccm.h @@ -15,5 +15,7 @@ #define IMX_CCM_LPSPI_CLK 5 #define IMX_CCM_USDHC1_CLK 6 #define IMX_CCM_USDHC2_CLK 7 +#define IMX_CCM_EDMA_CLK 8 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_IMX_CCM_H_ */ diff --git a/include/dt-bindings/clock/kinetis_sim.h b/include/dt-bindings/clock/kinetis_sim.h index 7c6feda99e..062c61b3f2 100644 --- a/include/dt-bindings/clock/kinetis_sim.h +++ b/include/dt-bindings/clock/kinetis_sim.h @@ -12,5 +12,7 @@ #define KINETIS_SIM_BUS_CLK 2 #define KINETIS_SIM_FAST_PERIPHERAL_CLK 5 #define KINETIS_SIM_LPO_CLK 19 +#define KINETIS_SIM_DMAMUX_CLK KINETIS_SIM_BUS_CLK +#define KINETIS_SIM_DMA_CLK KINETIS_SIM_CORESYS_CLK #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */