diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2013-07-08 16:04:37 +0530 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-07-26 16:39:11 -0400 |
commit | 2bf36ac638ab2db9f0295aa47064976eeebf80c1 (patch) | |
tree | d15b7d976bd10d20226258595cdeba5d9f2cc94e | |
parent | 5d4dbf1c3a1d86b4289ab3e5cde120a6f3c26e9b (diff) | |
download | u-boot-imx-2bf36ac638ab2db9f0295aa47064976eeebf80c1.zip u-boot-imx-2bf36ac638ab2db9f0295aa47064976eeebf80c1.tar.gz u-boot-imx-2bf36ac638ab2db9f0295aa47064976eeebf80c1.tar.bz2 |
drivers: net: cpsw: remove hard coding bd ram for cpsw
BD ram address may vary in various SOC, so removing the hardcoding and
passing the same information through platform data
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
-rw-r--r-- | board/ti/am335x/board.c | 1 | ||||
-rw-r--r-- | board/ti/ti814x/evm.c | 1 | ||||
-rw-r--r-- | drivers/net/cpsw.c | 4 | ||||
-rw-r--r-- | include/cpsw.h | 1 |
4 files changed, 4 insertions, 3 deletions
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 7138d73..15e249d 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -435,6 +435,7 @@ static struct cpsw_platform_data cpsw_data = { .ale_entries = 1024, .host_port_reg_ofs = 0x108, .hw_stats_reg_ofs = 0x900, + .bd_ram_ofs = 0x2000, .mac_control = (1 << 5), .control = cpsw_control, .host_port_num = 0, diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c index 17fba5a..c469645 100644 --- a/board/ti/ti814x/evm.c +++ b/board/ti/ti814x/evm.c @@ -207,6 +207,7 @@ static struct cpsw_platform_data cpsw_data = { .ale_entries = 1024, .host_port_reg_ofs = 0x28, .hw_stats_reg_ofs = 0x400, + .bd_ram_ofs = 0x2000, .mac_control = (1 << 5), .control = cpsw_control, .host_port_num = 0, diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index 379b679..dc0a2be 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -51,8 +51,6 @@ #define CPDMA_RXCP_VER1 0x160 #define CPDMA_RXCP_VER2 0x260 -#define CPDMA_RAM_ADDR 0x4a102000 - /* Descriptor mode bits */ #define CPDMA_DESC_SOP BIT(31) #define CPDMA_DESC_EOP BIT(30) @@ -984,12 +982,12 @@ int cpsw_register(struct cpsw_platform_data *data) return -ENOMEM; } - priv->descs = (void *)CPDMA_RAM_ADDR; priv->host_port = data->host_port_num; priv->regs = regs; priv->host_port_regs = regs + data->host_port_reg_ofs; priv->dma_regs = regs + data->cpdma_reg_ofs; priv->ale_regs = regs + data->ale_reg_ofs; + priv->descs = (void *)regs + data->bd_ram_ofs; int idx = 0; diff --git a/include/cpsw.h b/include/cpsw.h index 296b0e5..743cb96 100644 --- a/include/cpsw.h +++ b/include/cpsw.h @@ -39,6 +39,7 @@ struct cpsw_platform_data { int ale_entries; /* ale table size */ u32 host_port_reg_ofs; /* cpdma host port registers */ u32 hw_stats_reg_ofs; /* cpsw hw stats counters */ + u32 bd_ram_ofs; /* Buffer Descriptor RAM offset */ u32 mac_control; struct cpsw_slave_data *slave_data; void (*control)(int enabled); |