diff options
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r-- | drivers/dma/fsldma.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index cc9a68158d99..5dfedf326573 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -57,12 +57,12 @@ static void dma_init(struct fsl_dma_chan *fsl_chan) | |||
57 | 57 | ||
58 | } | 58 | } |
59 | 59 | ||
60 | static void set_sr(struct fsl_dma_chan *fsl_chan, dma_addr_t val) | 60 | static void set_sr(struct fsl_dma_chan *fsl_chan, u32 val) |
61 | { | 61 | { |
62 | DMA_OUT(fsl_chan, &fsl_chan->reg_base->sr, val, 32); | 62 | DMA_OUT(fsl_chan, &fsl_chan->reg_base->sr, val, 32); |
63 | } | 63 | } |
64 | 64 | ||
65 | static dma_addr_t get_sr(struct fsl_dma_chan *fsl_chan) | 65 | static u32 get_sr(struct fsl_dma_chan *fsl_chan) |
66 | { | 66 | { |
67 | return DMA_IN(fsl_chan, &fsl_chan->reg_base->sr, 32); | 67 | return DMA_IN(fsl_chan, &fsl_chan->reg_base->sr, 32); |
68 | } | 68 | } |
@@ -436,7 +436,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( | |||
436 | dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new); | 436 | dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new); |
437 | #endif | 437 | #endif |
438 | 438 | ||
439 | copy = min(len, FSL_DMA_BCR_MAX_CNT); | 439 | copy = min(len, (size_t)FSL_DMA_BCR_MAX_CNT); |
440 | 440 | ||
441 | set_desc_cnt(fsl_chan, &new->hw, copy); | 441 | set_desc_cnt(fsl_chan, &new->hw, copy); |
442 | set_desc_src(fsl_chan, &new->hw, dma_src); | 442 | set_desc_src(fsl_chan, &new->hw, dma_src); |
@@ -581,8 +581,8 @@ static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan) | |||
581 | if (ld_node != &fsl_chan->ld_queue) { | 581 | if (ld_node != &fsl_chan->ld_queue) { |
582 | /* Get the ld start address from ld_queue */ | 582 | /* Get the ld start address from ld_queue */ |
583 | next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys; | 583 | next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys; |
584 | dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%016llx\n", | 584 | dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n", |
585 | (u64)next_dest_addr); | 585 | (void *)next_dest_addr); |
586 | set_cdar(fsl_chan, next_dest_addr); | 586 | set_cdar(fsl_chan, next_dest_addr); |
587 | dma_start(fsl_chan); | 587 | dma_start(fsl_chan); |
588 | } else { | 588 | } else { |
@@ -662,7 +662,7 @@ static enum dma_status fsl_dma_is_complete(struct dma_chan *chan, | |||
662 | static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data) | 662 | static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data) |
663 | { | 663 | { |
664 | struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data; | 664 | struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data; |
665 | dma_addr_t stat; | 665 | u32 stat; |
666 | 666 | ||
667 | stat = get_sr(fsl_chan); | 667 | stat = get_sr(fsl_chan); |
668 | dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n", | 668 | dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n", |
@@ -681,9 +681,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data) | |||
681 | */ | 681 | */ |
682 | if (stat & FSL_DMA_SR_EOSI) { | 682 | if (stat & FSL_DMA_SR_EOSI) { |
683 | dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n"); | 683 | dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n"); |
684 | dev_dbg(fsl_chan->dev, "event: clndar 0x%016llx, " | 684 | dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n", |
685 | "nlndar 0x%016llx\n", (u64)get_cdar(fsl_chan), | 685 | (void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan)); |
686 | (u64)get_ndar(fsl_chan)); | ||
687 | stat &= ~FSL_DMA_SR_EOSI; | 686 | stat &= ~FSL_DMA_SR_EOSI; |
688 | } | 687 | } |
689 | 688 | ||
@@ -726,12 +725,15 @@ static void dma_do_tasklet(unsigned long data) | |||
726 | fsl_chan_ld_cleanup(fsl_chan); | 725 | fsl_chan_ld_cleanup(fsl_chan); |
727 | } | 726 | } |
728 | 727 | ||
728 | #ifdef FSL_DMA_CALLBACKTEST | ||
729 | static void fsl_dma_callback_test(struct fsl_dma_chan *fsl_chan) | 729 | static void fsl_dma_callback_test(struct fsl_dma_chan *fsl_chan) |
730 | { | 730 | { |
731 | if (fsl_chan) | 731 | if (fsl_chan) |
732 | dev_info(fsl_chan->dev, "selftest: callback is ok!\n"); | 732 | dev_info(fsl_chan->dev, "selftest: callback is ok!\n"); |
733 | } | 733 | } |
734 | #endif | ||
734 | 735 | ||
736 | #ifdef CONFIG_FSL_DMA_SELFTEST | ||
735 | static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan) | 737 | static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan) |
736 | { | 738 | { |
737 | struct dma_chan *chan; | 739 | struct dma_chan *chan; |
@@ -837,9 +839,9 @@ static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan) | |||
837 | if (err) { | 839 | if (err) { |
838 | for (i = 0; (*(src + i) == *(dest + i)) && (i < test_size); | 840 | for (i = 0; (*(src + i) == *(dest + i)) && (i < test_size); |
839 | i++); | 841 | i++); |
840 | dev_err(fsl_chan->dev, "selftest: Test failed, data %d/%d is " | 842 | dev_err(fsl_chan->dev, "selftest: Test failed, data %d/%ld is " |
841 | "error! src 0x%x, dest 0x%x\n", | 843 | "error! src 0x%x, dest 0x%x\n", |
842 | i, test_size, *(src + i), *(dest + i)); | 844 | i, (long)test_size, *(src + i), *(dest + i)); |
843 | } | 845 | } |
844 | 846 | ||
845 | free_resources: | 847 | free_resources: |
@@ -848,6 +850,7 @@ out: | |||
848 | kfree(src); | 850 | kfree(src); |
849 | return err; | 851 | return err; |
850 | } | 852 | } |
853 | #endif | ||
851 | 854 | ||
852 | static int __devinit of_fsl_dma_chan_probe(struct of_device *dev, | 855 | static int __devinit of_fsl_dma_chan_probe(struct of_device *dev, |
853 | const struct of_device_id *match) | 856 | const struct of_device_id *match) |
@@ -1008,8 +1011,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev, | |||
1008 | } | 1011 | } |
1009 | 1012 | ||
1010 | dev_info(&dev->dev, "Probe the Freescale DMA driver for %s " | 1013 | dev_info(&dev->dev, "Probe the Freescale DMA driver for %s " |
1011 | "controller at 0x%08x...\n", | 1014 | "controller at %p...\n", |
1012 | match->compatible, fdev->reg.start); | 1015 | match->compatible, (void *)fdev->reg.start); |
1013 | fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end | 1016 | fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end |
1014 | - fdev->reg.start + 1); | 1017 | - fdev->reg.start + 1); |
1015 | 1018 | ||