diff options
| author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2017-01-09 09:50:52 -0500 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@intel.com> | 2017-01-10 00:38:01 -0500 |
| commit | 527a27591312e4b3a0f8179f321f9e85c0850df0 (patch) | |
| tree | c73059466c4c8792369677c427d0eedd9d94f63b | |
| parent | 21d25f6a4217e755906cb548b55ddab39d0e88b9 (diff) | |
dmaengine: omap-dma: Fix the port_window support
We do not yet have users of port_window. The following errors were found
when converting the tusb6010_omap.c musb driver:
- The peripheral side must have SRC_/DST_PACKED disabled
- when configuring the burst for the peripheral side the memory side
configuration were overwritten: d->csdp = ... -> d->csdp |= ...
- The EI and FI were configured for the wrong sides of the transfers.
With these changes and the converted tus6010_omap.c I was able to verify
that things are working as they expected to work.
Fixes: 201ac4861c19 ("dmaengine: omap-dma: Support for slave devices with data port window")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| -rw-r--r-- | drivers/dma/omap-dma.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 4ad101a47e0a..daf479cce691 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
| @@ -938,21 +938,14 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( | |||
| 938 | d->ccr |= CCR_DST_AMODE_POSTINC; | 938 | d->ccr |= CCR_DST_AMODE_POSTINC; |
| 939 | if (port_window) { | 939 | if (port_window) { |
| 940 | d->ccr |= CCR_SRC_AMODE_DBLIDX; | 940 | d->ccr |= CCR_SRC_AMODE_DBLIDX; |
| 941 | d->ei = 1; | ||
| 942 | /* | ||
| 943 | * One frame covers the port_window and by configure | ||
| 944 | * the source frame index to be -1 * (port_window - 1) | ||
| 945 | * we instruct the sDMA that after a frame is processed | ||
| 946 | * it should move back to the start of the window. | ||
| 947 | */ | ||
| 948 | d->fi = -(port_window_bytes - 1); | ||
| 949 | 941 | ||
| 950 | if (port_window_bytes >= 64) | 942 | if (port_window_bytes >= 64) |
| 951 | d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED; | 943 | d->csdp |= CSDP_SRC_BURST_64; |
| 952 | else if (port_window_bytes >= 32) | 944 | else if (port_window_bytes >= 32) |
| 953 | d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED; | 945 | d->csdp |= CSDP_SRC_BURST_32; |
| 954 | else if (port_window_bytes >= 16) | 946 | else if (port_window_bytes >= 16) |
| 955 | d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED; | 947 | d->csdp |= CSDP_SRC_BURST_16; |
| 948 | |||
| 956 | } else { | 949 | } else { |
| 957 | d->ccr |= CCR_SRC_AMODE_CONSTANT; | 950 | d->ccr |= CCR_SRC_AMODE_CONSTANT; |
| 958 | } | 951 | } |
| @@ -962,13 +955,21 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( | |||
| 962 | d->ccr |= CCR_SRC_AMODE_POSTINC; | 955 | d->ccr |= CCR_SRC_AMODE_POSTINC; |
| 963 | if (port_window) { | 956 | if (port_window) { |
| 964 | d->ccr |= CCR_DST_AMODE_DBLIDX; | 957 | d->ccr |= CCR_DST_AMODE_DBLIDX; |
| 958 | d->ei = 1; | ||
| 959 | /* | ||
| 960 | * One frame covers the port_window and by configure | ||
| 961 | * the source frame index to be -1 * (port_window - 1) | ||
| 962 | * we instruct the sDMA that after a frame is processed | ||
| 963 | * it should move back to the start of the window. | ||
| 964 | */ | ||
| 965 | d->fi = -(port_window_bytes - 1); | ||
| 965 | 966 | ||
| 966 | if (port_window_bytes >= 64) | 967 | if (port_window_bytes >= 64) |
| 967 | d->csdp = CSDP_DST_BURST_64 | CSDP_DST_PACKED; | 968 | d->csdp |= CSDP_DST_BURST_64; |
| 968 | else if (port_window_bytes >= 32) | 969 | else if (port_window_bytes >= 32) |
| 969 | d->csdp = CSDP_DST_BURST_32 | CSDP_DST_PACKED; | 970 | d->csdp |= CSDP_DST_BURST_32; |
| 970 | else if (port_window_bytes >= 16) | 971 | else if (port_window_bytes >= 16) |
| 971 | d->csdp = CSDP_DST_BURST_16 | CSDP_DST_PACKED; | 972 | d->csdp |= CSDP_DST_BURST_16; |
| 972 | } else { | 973 | } else { |
| 973 | d->ccr |= CCR_DST_AMODE_CONSTANT; | 974 | d->ccr |= CCR_DST_AMODE_CONSTANT; |
| 974 | } | 975 | } |
| @@ -1017,7 +1018,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( | |||
| 1017 | osg->addr = sg_dma_address(sgent); | 1018 | osg->addr = sg_dma_address(sgent); |
| 1018 | osg->en = en; | 1019 | osg->en = en; |
| 1019 | osg->fn = sg_dma_len(sgent) / frame_bytes; | 1020 | osg->fn = sg_dma_len(sgent) / frame_bytes; |
| 1020 | if (port_window && dir == DMA_MEM_TO_DEV) { | 1021 | if (port_window && dir == DMA_DEV_TO_MEM) { |
| 1021 | osg->ei = 1; | 1022 | osg->ei = 1; |
| 1022 | /* | 1023 | /* |
| 1023 | * One frame covers the port_window and by configure | 1024 | * One frame covers the port_window and by configure |
