summaryrefslogtreecommitdiffstats
path: root/drivers/dma/pl330.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-07-06 14:32:19 -0400
committerVinod Koul <vinod.koul@intel.com>2014-07-15 12:31:02 -0400
commitf0564c7ecbc07a1290dabc8720f9dc03f22fa563 (patch)
treec96ced1d48f4e97a29b4a0221ef3867b9a3fd54a /drivers/dma/pl330.c
parent585a9d0b43d109ad76c0e43eae0fbe5ec3196246 (diff)
dmaengine: pl330: Remove duplicated cachecontrol enum
The settings for destination and source cache control are exactly the same. This patch removes the duplicated enum and uses the same for both destination and source cache control. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r--drivers/dma/pl330.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3aff676af853..22739c436bc3 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -33,26 +33,15 @@
33#define PL330_MAX_IRQS 32 33#define PL330_MAX_IRQS 32
34#define PL330_MAX_PERI 32 34#define PL330_MAX_PERI 32
35 35
36enum pl330_srccachectrl { 36enum pl330_cachectrl {
37 SCCTRL0, /* Noncacheable and nonbufferable */ 37 CCTRL0, /* Noncacheable and nonbufferable */
38 SCCTRL1, /* Bufferable only */ 38 CCTRL1, /* Bufferable only */
39 SCCTRL2, /* Cacheable, but do not allocate */ 39 CCTRL2, /* Cacheable, but do not allocate */
40 SCCTRL3, /* Cacheable and bufferable, but do not allocate */ 40 CCTRL3, /* Cacheable and bufferable, but do not allocate */
41 SINVALID1, 41 INVALID1, /* AWCACHE = 0x1000 */
42 SINVALID2, 42 INVALID2,
43 SCCTRL6, /* Cacheable write-through, allocate on reads only */ 43 CCTRL6, /* Cacheable write-through, allocate on writes only */
44 SCCTRL7, /* Cacheable write-back, allocate on reads only */ 44 CCTRL7, /* Cacheable write-back, allocate on writes only */
45};
46
47enum pl330_dstcachectrl {
48 DCCTRL0, /* Noncacheable and nonbufferable */
49 DCCTRL1, /* Bufferable only */
50 DCCTRL2, /* Cacheable, but do not allocate */
51 DCCTRL3, /* Cacheable and bufferable, but do not allocate */
52 DINVALID1, /* AWCACHE = 0x1000 */
53 DINVALID2,
54 DCCTRL6, /* Cacheable write-through, allocate on writes only */
55 DCCTRL7, /* Cacheable write-back, allocate on writes only */
56}; 45};
57 46
58enum pl330_byteswap { 47enum pl330_byteswap {
@@ -337,8 +326,8 @@ struct pl330_reqcfg {
337 unsigned brst_len:5; 326 unsigned brst_len:5;
338 unsigned brst_size:3; /* in power of 2 */ 327 unsigned brst_size:3; /* in power of 2 */
339 328
340 enum pl330_dstcachectrl dcctl; 329 enum pl330_cachectrl dcctl;
341 enum pl330_srccachectrl scctl; 330 enum pl330_cachectrl scctl;
342 enum pl330_byteswap swap; 331 enum pl330_byteswap swap;
343 struct pl330_config *pcfg; 332 struct pl330_config *pcfg;
344}; 333};
@@ -1490,14 +1479,14 @@ static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc)
1490 1479
1491static inline bool _is_valid(u32 ccr) 1480static inline bool _is_valid(u32 ccr)
1492{ 1481{
1493 enum pl330_dstcachectrl dcctl; 1482 enum pl330_cachectrl dcctl;
1494 enum pl330_srccachectrl scctl; 1483 enum pl330_cachectrl scctl;
1495 1484
1496 dcctl = (ccr >> CC_DSTCCTRL_SHFT) & CC_DRCCCTRL_MASK; 1485 dcctl = (ccr >> CC_DSTCCTRL_SHFT) & CC_DRCCCTRL_MASK;
1497 scctl = (ccr >> CC_SRCCCTRL_SHFT) & CC_SRCCCTRL_MASK; 1486 scctl = (ccr >> CC_SRCCCTRL_SHFT) & CC_SRCCCTRL_MASK;
1498 1487
1499 if (dcctl == DINVALID1 || dcctl == DINVALID2 1488 if (dcctl == INVALID1 || dcctl == INVALID2
1500 || scctl == SINVALID1 || scctl == SINVALID2) 1489 || scctl == INVALID1 || scctl == INVALID2)
1501 return false; 1490 return false;
1502 else 1491 else
1503 return true; 1492 return true;
@@ -2485,8 +2474,8 @@ static inline void _init_desc(struct dma_pl330_desc *desc)
2485 desc->req.x = &desc->px; 2474 desc->req.x = &desc->px;
2486 desc->req.token = desc; 2475 desc->req.token = desc;
2487 desc->rqcfg.swap = SWAP_NO; 2476 desc->rqcfg.swap = SWAP_NO;
2488 desc->rqcfg.scctl = SCCTRL0; 2477 desc->rqcfg.scctl = CCTRL0;
2489 desc->rqcfg.dcctl = DCCTRL0; 2478 desc->rqcfg.dcctl = CCTRL0;
2490 desc->req.cfg = &desc->rqcfg; 2479 desc->req.cfg = &desc->rqcfg;
2491 desc->req.xfer_cb = dma_pl330_rqcb; 2480 desc->req.xfer_cb = dma_pl330_rqcb;
2492 desc->txd.tx_submit = pl330_tx_submit; 2481 desc->txd.tx_submit = pl330_tx_submit;