Skip to content

Commit b070da7

Browse files
decsnynashif
authored andcommitted
dts: nxp,mcux-edma: Convert compats to prop
Convert the numerous revision compatibles to a DT property for the revision called nxp,version (inspired from a linux DT property from st called st,version on their DMA). Signed-off-by: Declan Snyder <[email protected]>
1 parent 8e46d26 commit b070da7

14 files changed

+39
-44
lines changed

drivers/dma/Kconfig.mcux_edma

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@
33
# Copyright (c) 2020, NXP
44
# SPDX-License-Identifier: Apache-2.0
55

6+
EDMA_COMPAT := $(DT_COMPAT_NXP_MCUX_EDMA)
7+
REV_PROP := nxp,version
8+
69
config DMA_MCUX_EDMA
710
bool "MCUX DMA driver"
811
default y
9-
depends on DT_HAS_NXP_MCUX_EDMA_ENABLED
12+
depends on $(dt_compat_any_has_prop,$(EDMA_COMPAT),$(REV_PROP),2)
1013
imply NOCACHE_MEMORY if HAS_MCUX_CACHE
1114
help
1215
DMA driver for MCUX series SoCs.
1316

1417
config DMA_MCUX_EDMA_V3
1518
bool "MCUX DMA v3 driver"
1619
default y
17-
depends on DT_HAS_NXP_MCUX_EDMA_V3_ENABLED
20+
depends on $(dt_compat_any_has_prop,$(EDMA_COMPAT),$(REV_PROP),3)
1821
help
1922
DMA version 3 driver for MCUX series SoCs.
2023

2124
config DMA_MCUX_EDMA_V4
2225
bool "MCUX DMA v4 driver"
2326
default y
24-
depends on DT_HAS_NXP_MCUX_EDMA_V4_ENABLED
27+
depends on $(dt_compat_any_has_prop,$(EDMA_COMPAT),$(REV_PROP),4)
2528
help
2629
DMA version 4 driver for MCUX series SoCs.
2730

drivers/dma/dma_mcux_edma.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @brief Common part of DMA drivers for imx rt series.
99
*/
1010

11+
#define DT_DRV_COMPAT nxp_mcux_edma
12+
1113
#include <errno.h>
1214
#include <soc.h>
1315
#include <zephyr/init.h>
@@ -23,14 +25,6 @@
2325
#include <zephyr/logging/log.h>
2426
#include <zephyr/irq.h>
2527

26-
#ifdef CONFIG_DMA_MCUX_EDMA
27-
#define DT_DRV_COMPAT nxp_mcux_edma
28-
#elif CONFIG_DMA_MCUX_EDMA_V3
29-
#define DT_DRV_COMPAT nxp_mcux_edma_v3
30-
#elif CONFIG_DMA_MCUX_EDMA_V4
31-
#define DT_DRV_COMPAT nxp_mcux_edma_v4
32-
#endif
33-
3428
LOG_MODULE_REGISTER(dma_mcux_edma, CONFIG_DMA_LOG_LEVEL);
3529

3630
#define HAS_CHANNEL_GAP(n) DT_INST_NODE_HAS_PROP(n, channel_gap) ||

dts/arm/nxp/nxp_k6x.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@
522522
edma0: dma-controller@40008000 {
523523
#dma-cells = <2>;
524524
compatible = "nxp,mcux-edma";
525+
nxp,version = <2>;
525526
dma-channels = <16>;
526527
dma-requests = <64>;
527528
nxp,mem2mem;

dts/arm/nxp/nxp_k8x.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@
427427
edma0: dma-controller@40008000 {
428428
#dma-cells = <2>;
429429
compatible = "nxp,mcux-edma";
430+
nxp,version = <2>;
430431
dma-channels = <16>;
431432
dma-requests = <64>;
432433
nxp,mem2mem;

dts/arm/nxp/nxp_ke1xf.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
soc {
100100
edma: dma-controller@40008000 {
101101
compatible = "nxp,mcux-edma";
102+
nxp,version = <2>;
102103
dma-channels = <16>;
103104
dma-requests = <64>;
104105
nxp,mem2mem;

dts/arm/nxp/nxp_ke1xz.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@
443443

444444
edma: dma-controller@40008000 {
445445
compatible = "nxp,mcux-edma";
446+
nxp,version = <2>;
446447
dma-channels = <8>;
447448
dma-requests = <64>;
448449
nxp,mem2mem;

dts/arm/nxp/nxp_mcxn23x_common.dtsi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@
461461

462462
edma0: dma-controller@80000 {
463463
#dma-cells = <2>;
464-
compatible = "nxp,mcux-edma-v4";
464+
compatible = "nxp,mcux-edma";
465+
nxp,version = <4>;
465466
dma-channels = <16>;
466467
dma-requests = <120>;
467468

@@ -476,7 +477,8 @@
476477

477478
edma1: dma-controller@a0000 {
478479
#dma-cells = <2>;
479-
compatible = "nxp,mcux-edma-v4";
480+
compatible = "nxp,mcux-edma";
481+
nxp,version = <4>;
480482
dma-channels = <16>;
481483
dma-requests = <120>;
482484

dts/arm/nxp/nxp_mcxn94x_common.dtsi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@
536536

537537
edma0: dma-controller@80000 {
538538
#dma-cells = <2>;
539-
compatible = "nxp,mcux-edma-v4";
539+
compatible = "nxp,mcux-edma";
540+
nxp,version = <4>;
540541
dma-channels = <16>;
541542
dma-requests = <120>;
542543

@@ -551,7 +552,8 @@
551552

552553
edma1: dma-controller@a0000 {
553554
#dma-cells = <2>;
554-
compatible = "nxp,mcux-edma-v4";
555+
compatible = "nxp,mcux-edma";
556+
nxp,version = <4>;
555557
dma-channels = <16>;
556558
dma-requests = <120>;
557559

dts/arm/nxp/nxp_rt10xx.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@
881881
edma0: dma-controller@400e8000 {
882882
#dma-cells = <2>;
883883
compatible = "nxp,mcux-edma";
884+
nxp,version = <2>;
884885
dma-channels = <32>;
885886
dma-requests = <128>;
886887
nxp,mem2mem;

dts/arm/nxp/nxp_rt11xx.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@
10441044
edma0: dma-controller@40070000 {
10451045
#dma-cells = <2>;
10461046
compatible = "nxp,mcux-edma";
1047+
nxp,version = <2>;
10471048
dma-channels = <32>;
10481049
dma-requests = <208>;
10491050
nxp,mem2mem;
@@ -1063,6 +1064,7 @@
10631064
edma_lpsr0: dma-controller@40c14000 {
10641065
#dma-cells = <2>;
10651066
compatible = "nxp,mcux-edma";
1067+
nxp,version = <2>;
10661068
dma-channels = <32>;
10671069
dma-requests = <208>;
10681070
nxp,mem2mem;

0 commit comments

Comments
 (0)