netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fernando <fernando@syspac.com.br>
To: netdev@vger.kernel.org
Subject: [PATCH] Add basic support for smsc9311 in smsc911x Driver
Date: Tue, 15 Feb 2011 12:57:08 -0200	[thread overview]
Message-ID: <20110215125708.79245312@SyspacSw04> (raw)


The smsc9311 chip is an switch chip with 3 ports that have almost the same
register structure of the LAN9115. There are some differences in IRQ regs,
but that doesn't seem to be a problem right now.

This patch was tested on a Torpedo (OMAP35x) based board and is based on
v2.6.38-rc4.

Fernando

>From e987729802dd3980041fd7e48e68f3a9f53424bd Mon Sep 17 00:00:00 2001
From: Fernando Governatore <fernando@syspac.com.br>
Date: Tue, 15 Feb 2011 12:10:22 -0200
Subject: [PATCH] Add basic support for smsc9311 in smsc911x Driver

  The smsc9311 chip is an switch chip with three ports.
Here is assumed that only the first one is connected to
the host.

  Makes the driver aware of the chip revision id.

  If no external phy is being used, mask out all the PHY
IDs that are not present by default.

  The default switch configuration is not changed.
---
 drivers/net/smc911x.h  |    2 ++
 drivers/net/smsc911x.c |   15 ++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index 3269292..5e336d2 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -687,6 +687,7 @@ smc_pxa_dma_outsl(struct smc911x_local *lp, u_long physaddr,
 #define CHIP_9215	0x115A
 #define CHIP_9217	0x117A
 #define CHIP_9218	0x118A
+#define CHIP_9311	0x9311
 
 struct chip_id {
 	u16 id;
@@ -702,6 +703,7 @@ static const struct chip_id chip_ids[] =  {
 	{ CHIP_9215, "LAN9215" },
 	{ CHIP_9217, "LAN9217" },
 	{ CHIP_9218, "LAN9218" },
+	{ CHIP_9311, "LAN9311" },
 	{ 0, NULL },
 };
 
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 64bfdae..483fdbd 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -856,6 +856,7 @@ static int __devinit smsc911x_mii_init(struct platform_device *pdev,
 	case 0x01150000:
 	case 0x117A0000:
 	case 0x115A0000:
+	case 0x93110000:
 		/* External PHY supported, try to autodetect */
 		smsc911x_phy_initialise_external(pdata);
 		break;
@@ -867,8 +868,15 @@ static int __devinit smsc911x_mii_init(struct platform_device *pdev,
 	}
 
 	if (!pdata->using_extphy) {
-		/* Mask all PHYs except ID 1 (internal) */
-		pdata->mii_bus->phy_mask = ~(1 << 1);
+		/* Mask all PHYs except internal IDs */
+		switch(pdata->idrev & 0xFFFF0000){
+		case 0x93110000:
+			pdata->mii_bus->phy_mask = ~(1 << 0) & ~(1 << 1) & ~(1 << 2);
+			break;
+		default:
+			pdata->mii_bus->phy_mask = ~(1 << 1);
+			break;
+		}
 	}
 
 	if (mdiobus_register(pdata->mii_bus)) {
@@ -1870,7 +1878,8 @@ static int __devinit smsc911x_init(struct net_device *dev)
 	case 0x92110000:
 	case 0x92200000:
 	case 0x92210000:
-		/* LAN9210/LAN9211/LAN9220/LAN9221 */
+	case 0x93110000:
+		/* LAN9210/LAN9211/LAN9220/LAN9221/LAN9311 */
 		pdata->generation = 4;
 		break;
 
-- 
1.7.1


             reply	other threads:[~2011-02-15 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 14:57 Fernando [this message]
2011-02-22 17:37 ` [PATCH] Add basic support for smsc9311 in smsc911x Driver 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=20110215125708.79245312@SyspacSw04 \
    --to=fernando@syspac.com.br \
    --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;
as well as URLs for NNTP newsgroup(s).