* [net-next PATCH] driver: net: cpsw: add no_bd_ram dt parsing
@ 2015-10-09 10:06 Mugunthan V N
2015-10-12 8:20 ` Mugunthan V N
0 siblings, 1 reply; 2+ messages in thread
From: Mugunthan V N @ 2015-10-09 10:06 UTC (permalink / raw)
To: netdev; +Cc: linux-omap, David S . Miller, Sekhar Nori, Mugunthan V N
cpdma is capable of placing the dma descriptors in ddr using
dma_alloc_coherent() when the internal bd ram size is not enough.
To utilize this feature pass the DT parameter "no_bd_ram" and
increase bd_ram_size and number of rx descriptors.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 4 ++++
drivers/net/ethernet/ti/cpsw.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 8fc90f1..cf1a625 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1987,6 +1987,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
data->ale_entries = prop;
+ data->no_bd_ram = of_property_read_bool(node, "no_bd_ram");
+
if (of_property_read_u32(node, "bd_ram_size", &prop)) {
dev_err(&pdev->dev, "Missing bd_ram_size property in the DT.\n");
return -EINVAL;
@@ -2358,6 +2360,8 @@ static int cpsw_probe(struct platform_device *pdev)
dma_params.desc_mem_size = data->bd_ram_size;
dma_params.desc_align = 16;
dma_params.has_ext_regs = true;
+ if (data->no_bd_ram)
+ dma_params.desc_mem_phys = 0;
dma_params.desc_hw_addr = dma_params.desc_mem_phys;
priv->dma = cpdma_ctlr_create(&dma_params);
diff --git a/drivers/net/ethernet/ti/cpsw.h b/drivers/net/ethernet/ti/cpsw.h
index ca90efa..b654ac2 100644
--- a/drivers/net/ethernet/ti/cpsw.h
+++ b/drivers/net/ethernet/ti/cpsw.h
@@ -33,6 +33,7 @@ struct cpsw_platform_data {
u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
u32 ale_entries; /* ale table size */
+ bool no_bd_ram; /* set if cpsw bd ram should not be used */
u32 bd_ram_size; /*buffer descriptor ram size */
u32 rx_descs; /* Number of Rx Descriptios */
u32 mac_control; /* Mac control register */
--
2.6.1.133.gf5b6079
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next PATCH] driver: net: cpsw: add no_bd_ram dt parsing
2015-10-09 10:06 [net-next PATCH] driver: net: cpsw: add no_bd_ram dt parsing Mugunthan V N
@ 2015-10-12 8:20 ` Mugunthan V N
0 siblings, 0 replies; 2+ messages in thread
From: Mugunthan V N @ 2015-10-12 8:20 UTC (permalink / raw)
To: netdev; +Cc: linux-omap, David S . Miller, Sekhar Nori
On Friday 09 October 2015 03:36 PM, Mugunthan V N wrote:
> cpdma is capable of placing the dma descriptors in ddr using
> dma_alloc_coherent() when the internal bd ram size is not enough.
> To utilize this feature pass the DT parameter "no_bd_ram" and
> increase bd_ram_size and number of rx descriptors.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Dave
Please drop this patch as it is not working on AM437x platform. Will
send a v2 after fixing it.
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-12 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09 10:06 [net-next PATCH] driver: net: cpsw: add no_bd_ram dt parsing Mugunthan V N
2015-10-12 8:20 ` Mugunthan V N
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).