Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242624
b: refs/heads/master
c: 6a1fef6
h: refs/heads/master
v: v3
  • Loading branch information
Sriram authored and David S. Miller committed Mar 23, 2011
1 parent d52890e commit 0353204
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c7a4f9ce651383c73dfdff3d7e21d5f9572c4ec
refs/heads/master: 6a1fef6d000944911df0f160f366111daa10740a
11 changes: 8 additions & 3 deletions trunk/drivers/net/davinci_cpdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct cpdma_desc {

struct cpdma_desc_pool {
u32 phys;
u32 hw_addr;
void __iomem *iomap; /* ioremap map */
void *cpumap; /* dma_alloc map */
int desc_size, mem_size;
Expand Down Expand Up @@ -137,7 +138,8 @@ struct cpdma_chan {
* abstract out these details
*/
static struct cpdma_desc_pool *
cpdma_desc_pool_create(struct device *dev, u32 phys, int size, int align)
cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr,
int size, int align)
{
int bitmap_size;
struct cpdma_desc_pool *pool;
Expand All @@ -161,10 +163,12 @@ cpdma_desc_pool_create(struct device *dev, u32 phys, int size, int align)
if (phys) {
pool->phys = phys;
pool->iomap = ioremap(phys, size);
pool->hw_addr = hw_addr;
} else {
pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys,
GFP_KERNEL);
pool->iomap = (void __force __iomem *)pool->cpumap;
pool->hw_addr = pool->phys;
}

if (pool->iomap)
Expand Down Expand Up @@ -201,14 +205,14 @@ static inline dma_addr_t desc_phys(struct cpdma_desc_pool *pool,
{
if (!desc)
return 0;
return pool->phys + (__force dma_addr_t)desc -
return pool->hw_addr + (__force dma_addr_t)desc -
(__force dma_addr_t)pool->iomap;
}

static inline struct cpdma_desc __iomem *
desc_from_phys(struct cpdma_desc_pool *pool, dma_addr_t dma)
{
return dma ? pool->iomap + dma - pool->phys : NULL;
return dma ? pool->iomap + dma - pool->hw_addr : NULL;
}

static struct cpdma_desc __iomem *
Expand Down Expand Up @@ -260,6 +264,7 @@ struct cpdma_ctlr *cpdma_ctlr_create(struct cpdma_params *params)

ctlr->pool = cpdma_desc_pool_create(ctlr->dev,
ctlr->params.desc_mem_phys,
ctlr->params.desc_hw_addr,
ctlr->params.desc_mem_size,
ctlr->params.desc_align);
if (!ctlr->pool) {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/davinci_cpdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct cpdma_params {
bool has_soft_reset;
int min_packet_size;
u32 desc_mem_phys;
u32 desc_hw_addr;
int desc_mem_size;
int desc_align;

Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,10 +1854,13 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
dma_params.rxcp = priv->emac_base + 0x660;
dma_params.num_chan = EMAC_MAX_TXRX_CHANNELS;
dma_params.min_packet_size = EMAC_DEF_MIN_ETHPKTSIZE;
dma_params.desc_mem_phys = hw_ram_addr;
dma_params.desc_hw_addr = hw_ram_addr;
dma_params.desc_mem_size = pdata->ctrl_ram_size;
dma_params.desc_align = 16;

dma_params.desc_mem_phys = pdata->no_bd_ram ? 0 :
(u32 __force)res->start + pdata->ctrl_ram_offset;

priv->dma = cpdma_ctlr_create(&dma_params);
if (!priv->dma) {
dev_err(emac_dev, "DaVinci EMAC: Error initializing DMA\n");
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/davinci_emac.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct emac_platform_data {

u8 rmii_en;
u8 version;
bool no_bd_ram;
void (*interrupt_enable) (void);
void (*interrupt_disable) (void);
};
Expand Down

0 comments on commit 0353204

Please sign in to comment.