diff options
author | Hongbo Zhang <hongbo.zhang@freescale.com> | 2013-09-26 05:33:43 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-11-13 03:56:27 -0500 |
commit | 8de7a7d95049bdbe454ade7add08d893efe5a456 (patch) | |
tree | 218e7b1f3982f57470ad8e519f3be9ae356a5bec | |
parent | 03aa254f1e3c3d902cd68763f8abc2387e82b4da (diff) |
DMA: Freescale: update driver to support 8-channel DMA engine
This patch adds support to 8-channel DMA engine, thus the driver works for both
the new 8-channel and the legacy 4-channel DMA engines.
Signed-off-by: Hongbo Zhang <hongbo.zhang@freescale.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/Kconfig | 9 | ||||
-rw-r--r-- | drivers/dma/fsldma.c | 9 | ||||
-rw-r--r-- | drivers/dma/fsldma.h | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index f238cfd33847..cd325866d9f4 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
@@ -89,14 +89,15 @@ config AT_HDMAC | |||
89 | Support the Atmel AHB DMA controller. | 89 | Support the Atmel AHB DMA controller. |
90 | 90 | ||
91 | config FSL_DMA | 91 | config FSL_DMA |
92 | tristate "Freescale Elo and Elo Plus DMA support" | 92 | tristate "Freescale Elo series DMA support" |
93 | depends on FSL_SOC | 93 | depends on FSL_SOC |
94 | select DMA_ENGINE | 94 | select DMA_ENGINE |
95 | select ASYNC_TX_ENABLE_CHANNEL_SWITCH | 95 | select ASYNC_TX_ENABLE_CHANNEL_SWITCH |
96 | ---help--- | 96 | ---help--- |
97 | Enable support for the Freescale Elo and Elo Plus DMA controllers. | 97 | Enable support for the Freescale Elo series DMA controllers. |
98 | The Elo is the DMA controller on some 82xx and 83xx parts, and the | 98 | The Elo is the DMA controller on some mpc82xx and mpc83xx parts, the |
99 | Elo Plus is the DMA controller on 85xx and 86xx parts. | 99 | EloPlus is on mpc85xx and mpc86xx and Pxxx parts, and the Elo3 is on |
100 | some Txxx and Bxxx parts. | ||
100 | 101 | ||
101 | config MPC512X_DMA | 102 | config MPC512X_DMA |
102 | tristate "Freescale MPC512x built-in DMA engine support" | 103 | tristate "Freescale MPC512x built-in DMA engine support" |
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index b3f3e90054f2..4e898121707b 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -1253,7 +1253,9 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev, | |||
1253 | WARN_ON(fdev->feature != chan->feature); | 1253 | WARN_ON(fdev->feature != chan->feature); |
1254 | 1254 | ||
1255 | chan->dev = fdev->dev; | 1255 | chan->dev = fdev->dev; |
1256 | chan->id = ((res.start - 0x100) & 0xfff) >> 7; | 1256 | chan->id = (res.start & 0xfff) < 0x300 ? |
1257 | ((res.start - 0x100) & 0xfff) >> 7 : | ||
1258 | ((res.start - 0x200) & 0xfff) >> 7; | ||
1257 | if (chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { | 1259 | if (chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { |
1258 | dev_err(fdev->dev, "too many channels for device\n"); | 1260 | dev_err(fdev->dev, "too many channels for device\n"); |
1259 | err = -EINVAL; | 1261 | err = -EINVAL; |
@@ -1426,6 +1428,7 @@ static int fsldma_of_remove(struct platform_device *op) | |||
1426 | } | 1428 | } |
1427 | 1429 | ||
1428 | static const struct of_device_id fsldma_of_ids[] = { | 1430 | static const struct of_device_id fsldma_of_ids[] = { |
1431 | { .compatible = "fsl,elo3-dma", }, | ||
1429 | { .compatible = "fsl,eloplus-dma", }, | 1432 | { .compatible = "fsl,eloplus-dma", }, |
1430 | { .compatible = "fsl,elo-dma", }, | 1433 | { .compatible = "fsl,elo-dma", }, |
1431 | {} | 1434 | {} |
@@ -1447,7 +1450,7 @@ static struct platform_driver fsldma_of_driver = { | |||
1447 | 1450 | ||
1448 | static __init int fsldma_init(void) | 1451 | static __init int fsldma_init(void) |
1449 | { | 1452 | { |
1450 | pr_info("Freescale Elo / Elo Plus DMA driver\n"); | 1453 | pr_info("Freescale Elo series DMA driver\n"); |
1451 | return platform_driver_register(&fsldma_of_driver); | 1454 | return platform_driver_register(&fsldma_of_driver); |
1452 | } | 1455 | } |
1453 | 1456 | ||
@@ -1459,5 +1462,5 @@ static void __exit fsldma_exit(void) | |||
1459 | subsys_initcall(fsldma_init); | 1462 | subsys_initcall(fsldma_init); |
1460 | module_exit(fsldma_exit); | 1463 | module_exit(fsldma_exit); |
1461 | 1464 | ||
1462 | MODULE_DESCRIPTION("Freescale Elo / Elo Plus DMA driver"); | 1465 | MODULE_DESCRIPTION("Freescale Elo series DMA driver"); |
1463 | MODULE_LICENSE("GPL"); | 1466 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index f5c38791fc74..1ffc24484d23 100644 --- a/drivers/dma/fsldma.h +++ b/drivers/dma/fsldma.h | |||
@@ -112,7 +112,7 @@ struct fsldma_chan_regs { | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | struct fsldma_chan; | 114 | struct fsldma_chan; |
115 | #define FSL_DMA_MAX_CHANS_PER_DEVICE 4 | 115 | #define FSL_DMA_MAX_CHANS_PER_DEVICE 8 |
116 | 116 | ||
117 | struct fsldma_device { | 117 | struct fsldma_device { |
118 | void __iomem *regs; /* DGSR register base */ | 118 | void __iomem *regs; /* DGSR register base */ |