From 9e5188353e4729c3a978292b4f3d0f58d142b61f Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Wed, 5 Apr 2023 17:11:44 +0000 Subject: [PATCH] soc: arm: nxp_imx: add support for SMARTDMA for RT5xx Add support for SMARTDMA to RT5xx SOCs. SMARTDMA ram banks will be powered up, so code can be programmed into this region for the SMARTDMA engine. Signed-off-by: Daniel DeGrasse --- dts/arm/nxp/nxp_rt5xx_common.dtsi | 9 +++++++++ soc/arm/nxp_imx/rt5xx/soc.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/dts/arm/nxp/nxp_rt5xx_common.dtsi b/dts/arm/nxp/nxp_rt5xx_common.dtsi index 54469d3a56..9165b26441 100644 --- a/dts/arm/nxp/nxp_rt5xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt5xx_common.dtsi @@ -476,6 +476,15 @@ #io-channel-cells = <1>; }; + smartdma: dma@27020 { + compatible = "nxp,smartdma"; + reg = <0x27020 0x1000>; + program-mem = <0x24100000>; + interrupts = <73 0>; + status = "disabled"; + #dma-cells = <0>; + }; + ctimer0: ctimer@28000 { compatible = "nxp,lpc-ctimer"; reg = <0x28000 0x1000>; diff --git a/soc/arm/nxp_imx/rt5xx/soc.c b/soc/arm/nxp_imx/rt5xx/soc.c index 2fbb7d609b..c216f63890 100644 --- a/soc/arm/nxp_imx/rt5xx/soc.c +++ b/soc/arm/nxp_imx/rt5xx/soc.c @@ -364,6 +364,16 @@ static void clock_init(void) RESET_PeripheralReset(kSDIO0_RST_SHIFT_RSTn); #endif +#if DT_NODE_HAS_STATUS(DT_NODELABEL(smartdma), okay) && CONFIG_DMA_MCUX_SMARTDMA + /* Power up SMARTDMA ram */ + POWER_DisablePD(kPDRUNCFG_APD_SMARTDMA_SRAM); + POWER_DisablePD(kPDRUNCFG_PPD_SMARTDMA_SRAM); + POWER_ApplyPD(); + + RESET_ClearPeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); + CLOCK_EnableClock(kCLOCK_Smartdma); +#endif + DT_FOREACH_STATUS_OKAY(nxp_lpc_ctimer, CTIMER_CLOCK_SETUP) /* Set up dividers. */