drivers: net: cpsw: remove hard coding bd ram for cpsw
authorMugunthan V N <mugunthanvnm@ti.com>
Mon, 8 Jul 2013 10:34:37 +0000 (16:04 +0530)
committerTom Rini <trini@ti.com>
Fri, 26 Jul 2013 20:39:11 +0000 (16:39 -0400)
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>
board/ti/am335x/board.c
board/ti/ti814x/evm.c
drivers/net/cpsw.c
include/cpsw.h

index 7138d739e4506afc32ac3c773f078ed640c0a887..15e249d605ecfdf7635a8903d76e3b206ac6407f 100644 (file)
@@ -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,
index 17fba5aecd52a7fdaf8d58bcae6346cb94f4ec83..c469645ff3d5a991595f42a990c88a1b8f0a8cd7 100644 (file)
@@ -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,
index 379b679d2e47ba41bd229771aff20e801ec1a030..dc0a2be23bccf21cbd366861e774a68c33183817 100644 (file)
@@ -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;
 
index 296b0e557f3f58c41357d86235de2739cdcaebe9..743cb96e7e9e1502dfb807b1f8d9110b42605c98 100644 (file)
@@ -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);