From: Mugunthan V N <mugunthanvnm@ti.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-omap@vger.kernel.org, balbi@ti.com,
Mugunthan V N <mugunthanvnm@ti.com>
Subject: [net-next PATCH 1/1] drivers: net: cpsw: Add support for new CPSW IP version
Date: Wed, 31 Jul 2013 17:42:26 +0530 [thread overview]
Message-ID: <1375272746-24446-1-git-send-email-mugunthanvnm@ti.com> (raw)
The new IP version has a minor changes and the offsets are same as the previous
version, so instead of adding CPSW version number in the driver, make the driver
to fall through to the latest versions so that the new version of CPSW which has
the same register offsets will work directly without patching the driver.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 05a1674..a6b9700 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -799,6 +799,7 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
slave_write(slave, TX_PRIORITY_MAPPING, CPSW1_TX_PRI_MAP);
break;
case CPSW_VERSION_2:
+ default:
slave_write(slave, TX_PRIORITY_MAPPING, CPSW2_TX_PRI_MAP);
break;
}
@@ -1180,10 +1181,9 @@ static int cpsw_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
cpsw_hwtstamp_v1(priv);
break;
case CPSW_VERSION_2:
+ default:
cpsw_hwtstamp_v2(priv);
break;
- default:
- return -ENOTSUPP;
}
return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
@@ -1790,6 +1790,7 @@ static int cpsw_probe(struct platform_device *pdev)
dma_params.desc_mem_phys = 0;
break;
case CPSW_VERSION_2:
+ default:
priv->host_port_regs = ss_regs + CPSW2_HOST_PORT_OFFSET;
priv->cpts->reg = ss_regs + CPSW2_CPTS_OFFSET;
dma_params.dmaregs = ss_regs + CPSW2_CPDMA_OFFSET;
@@ -1801,10 +1802,6 @@ static int cpsw_probe(struct platform_device *pdev)
dma_params.desc_mem_phys =
(u32 __force) priv->cpsw_res->start + CPSW2_BD_OFFSET;
break;
- default:
- dev_err(priv->dev, "unknown version 0x%08x\n", priv->version);
- ret = -ENODEV;
- goto clean_cpsw_wr_iores_ret;
}
for (i = 0; i < priv->data.slaves; i++) {
struct cpsw_slave *slave = &priv->slaves[i];
--
1.8.4.rc0.11.g35f5eaa
next reply other threads:[~2013-07-31 12:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 12:12 Mugunthan V N [this message]
2013-07-31 14:49 ` [net-next PATCH 1/1] drivers: net: cpsw: Add support for new CPSW IP version Richard Cochran
2013-07-31 15:28 ` Felipe Balbi
2013-07-31 16:38 ` Richard Cochran
2013-07-31 18:45 ` Felipe Balbi
2013-07-31 19:22 ` Richard Cochran
2013-07-31 19:43 ` Felipe Balbi
2013-07-31 19:45 ` Felipe Balbi
2013-07-31 20:04 ` Richard Cochran
2013-07-31 20:07 ` Felipe Balbi
2013-07-31 20:20 ` Richard Cochran
2013-07-31 20:26 ` Felipe Balbi
2013-07-31 20:34 ` Richard Cochran
2013-07-31 21:11 ` Felipe Balbi
2013-08-01 4:43 ` Richard Cochran
2013-08-01 4:46 ` Richard Cochran
2013-07-31 23:55 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375272746-24446-1-git-send-email-mugunthanvnm@ti.com \
--to=mugunthanvnm@ti.com \
--cc=balbi@ti.com \
--cc=davem@davemloft.net \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox