Commit 486afa37 authored by Mark A. Greer's avatar Mark A. Greer Committed by Kevin Hilman

DaVinci: EDMA: Use Channel Controller address from resource data

The base address for the DMA's Third Party Channel Controller is currently
hardcoded.  Instead, use the base address that is already in the resource
data for the controller.
Signed-off-by: default avatarMark A. Greer <mgreer@mvista.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 1347034f
...@@ -484,6 +484,7 @@ static struct edma_soc_info dm355_edma_info = { ...@@ -484,6 +484,7 @@ static struct edma_soc_info dm355_edma_info = {
static struct resource edma_resources[] = { static struct resource edma_resources[] = {
{ {
.name = "edma_cc",
.start = 0x01c00000, .start = 0x01c00000,
.end = 0x01c00000 + SZ_64K - 1, .end = 0x01c00000 + SZ_64K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
......
...@@ -383,6 +383,7 @@ static struct edma_soc_info dm644x_edma_info = { ...@@ -383,6 +383,7 @@ static struct edma_soc_info dm644x_edma_info = {
static struct resource edma_resources[] = { static struct resource edma_resources[] = {
{ {
.name = "edma_cc",
.start = 0x01c00000, .start = 0x01c00000,
.end = 0x01c00000 + SZ_64K - 1, .end = 0x01c00000 + SZ_64K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
......
...@@ -297,6 +297,7 @@ static struct edma_soc_info dm646x_edma_info = { ...@@ -297,6 +297,7 @@ static struct edma_soc_info dm646x_edma_info = {
static struct resource edma_resources[] = { static struct resource edma_resources[] = {
{ {
.name = "edma_cc",
.start = 0x01c00000, .start = 0x01c00000,
.end = 0x01c00000 + SZ_64K - 1, .end = 0x01c00000 + SZ_64K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
......
...@@ -102,9 +102,6 @@ ...@@ -102,9 +102,6 @@
#define PARM_OFFSET(param_no) (EDMA_PARM + ((param_no) << 5)) #define PARM_OFFSET(param_no) (EDMA_PARM + ((param_no) << 5))
#define edmacc_regs_base IO_ADDRESS(DAVINCI_DMA_3PCC_BASE)
#define EDMA_MAX_DMACH 64 #define EDMA_MAX_DMACH 64
#define EDMA_MAX_PARAMENTRY 512 #define EDMA_MAX_PARAMENTRY 512
#define EDMA_MAX_EVQUE 2 /* FIXME too small */ #define EDMA_MAX_EVQUE 2 /* FIXME too small */
...@@ -112,6 +109,8 @@ ...@@ -112,6 +109,8 @@
/*****************************************************************************/ /*****************************************************************************/
static __iomem void *edmacc_regs_base;
static inline unsigned int edma_read(int offset) static inline unsigned int edma_read(int offset)
{ {
return (unsigned int)__raw_readl(edmacc_regs_base + offset); return (unsigned int)__raw_readl(edmacc_regs_base + offset);
...@@ -997,10 +996,28 @@ static int __init edma_probe(struct platform_device *pdev) ...@@ -997,10 +996,28 @@ static int __init edma_probe(struct platform_device *pdev)
int status; int status;
const s8 *noevent; const s8 *noevent;
int irq = 0, err_irq = 0; int irq = 0, err_irq = 0;
struct resource *r;
resource_size_t len;
if (!info) if (!info)
return -ENODEV; return -ENODEV;
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "edma_cc");
if (!r)
return -ENODEV;
len = r->end - r->start + 1;
r = request_mem_region(r->start, len, r->name);
if (!r)
return -EBUSY;
edmacc_regs_base = ioremap(r->start, len);
if (!edmacc_regs_base) {
status = -EBUSY;
goto fail1;
}
num_channels = min_t(unsigned, info->n_channel, EDMA_MAX_DMACH); num_channels = min_t(unsigned, info->n_channel, EDMA_MAX_DMACH);
num_slots = min_t(unsigned, info->n_slot, EDMA_MAX_PARAMENTRY); num_slots = min_t(unsigned, info->n_slot, EDMA_MAX_PARAMENTRY);
...@@ -1079,6 +1096,9 @@ fail: ...@@ -1079,6 +1096,9 @@ fail:
free_irq(err_irq, NULL); free_irq(err_irq, NULL);
if (irq) if (irq)
free_irq(irq, NULL); free_irq(irq, NULL);
iounmap(edmacc_regs_base);
fail1:
release_mem_region(r->start, len);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment