Skip to contentSkip to conversation

Add basic support for smsc9311 in smsc911x Driver

PATCH In review Fernando 2 participants 2 messages Feb 15, 2011 – Feb 22, 2011

Subsystems (2)
lore
Share & tools
lore

Fernando

author
#0 lore raw

PATCH 1/1 Add basic support for smsc9311 in smsc911x Driver

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

Quoted 1 line

From e987729802dd3980041fd7e48e68f3a9f53424bd Mon Sep 17 00:00:00 2001

From: Fernando Governatore <[email protected]>
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(-)
drivers/net/smc911x.h +2 -0
index 3269292..5e336d2 100644
@@ -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 },
 };
 
drivers/net/smsc911x.c +12 -3
index 64bfdae..483fdbd 100644
@@ -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;
 
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Fernando <[email protected]>
Date: Tue, 15 Feb 2011 12:57:08 -0200

Quoted 7 lines

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.

Please submit your patch properly as per the directions in Documentation/SubmittingPatches, in particular you forgot to provide a proper Signed-off-by: line in your commit message.