netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] at91_ether: Add Micrel KSZ8041 PHY support
@ 2008-09-16 20:53 Andrew Victor
  2008-09-17  8:04 ` Franco Fichtner
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Victor @ 2008-09-16 20:53 UTC (permalink / raw)
  To: jgarzik, netdev; +Cc: gustavo

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

Add support for Micrel's KSZ8041 PHY in the Atmel AT91RM9200 Ethernet driver.
The PHY is similar to the KS8721 (configuration registers differ a
bit, like LED function and a new PHY Control 2 register and LinkMD
control/status register, which aren't used by the at91_ether driver
anyway). The chip has a different pin layout so it's no good for a
drop in replacement anyway.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Andrew Victor <linux@maxim.org.za>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 8-ethernet_ksz8041.patch --]
[-- Type: text/x-patch; name=8-ethernet_ksz8041.patch, Size: 2881 bytes --]

diff -urN linux-2.6.27-rc6.orig/drivers/net/arm/at91_ether.c linux-2.6.27-rc6/drivers/net/arm/at91_ether.c
--- linux-2.6.27-rc6.orig/drivers/net/arm/at91_ether.c	2008-09-16 21:15:53.000000000 +0200
+++ linux-2.6.27-rc6/drivers/net/arm/at91_ether.c	2008-09-16 21:15:59.000000000 +0200
@@ -220,7 +220,7 @@
 		if (!(phy & (1 << 0)))
 			goto done;
 	}
-	else if (lp->phy_type == MII_KS8721_ID) {
+	else if ((lp->phy_type == MII_KS8721_ID) || (lp->phy_type == MII_KSZ8041_ID)) {
 		read_phy(lp->phy_address, MII_TPISTATUS, &phy);		/* ack interrupt in Micrel PHY */
 		if (!(phy & ((1 << 2) | 1)))
 			goto done;
@@ -286,7 +286,7 @@
 		dsintr = (1 << 15) | ( 1 << 14);
 		write_phy(lp->phy_address, MII_BCMINTR_REG, dsintr);
 	}
-	else if (lp->phy_type == MII_KS8721_ID) {	/* for Micrel PHY */
+	else if ((lp->phy_type == MII_KS8721_ID) || (lp->phy_type == MII_KSZ8041_ID)) {	/* for Micrel PHY */
 		dsintr = (1 << 10) | ( 1 << 8);
 		write_phy(lp->phy_address, MII_TPISTATUS, dsintr);
 	}
@@ -341,7 +341,7 @@
 		dsintr = ~(1 << 14);
 		write_phy(lp->phy_address, MII_BCMINTR_REG, dsintr);
 	}
-	else if (lp->phy_type == MII_KS8721_ID) {	/* for Micrel PHY */
+	else if ((lp->phy_type == MII_KS8721_ID) || (lp->phy_type == MII_KSZ8041_ID)) {	/* for Micrel PHY */
 		read_phy(lp->phy_address, MII_TPISTATUS, &dsintr);
 		dsintr = ~((1 << 10) | (1 << 8));
 		write_phy(lp->phy_address, MII_TPISTATUS, dsintr);
@@ -1102,6 +1102,8 @@
 		printk(KERN_INFO "%s: National Semiconductor DP83848 PHY\n", dev->name);
 	else if (phy_type == MII_AC101L_ID)
 		printk(KERN_INFO "%s: Altima AC101L PHY\n", dev->name);
+	else if (phy_type == MII_KSZ8041_ID)
+		printk(KERN_INFO "%s: Micrel KSZ8041 PHY\n", dev->name);
 	else if (phy_type == MII_KS8721_ID)
 		printk(KERN_INFO "%s: Micrel KS8721 PHY\n", dev->name);
 	else if (phy_type == MII_T78Q21x3_ID)
@@ -1147,6 +1149,7 @@
 			case MII_DP83847_ID:		/* National Semiconductor DP83847:  */
 			case MII_DP83848_ID:		/* National Semiconductor DP83848:  */
 			case MII_AC101L_ID:		/* Altima AC101L: PHY_ID1 = 0x22, PHY_ID2 = 0x5520 */
+			case MII_KSZ8041_ID:		/* Micrel KSZ8041: PHY_ID1 = 0x22, PHY_ID2 = 0x1512 */
 			case MII_KS8721_ID:		/* Micrel KS8721: PHY_ID1 = 0x22, PHY_ID2 = 0x1610 */
 			case MII_T78Q21x3_ID:		/* Teridian 78Q21x3: PHY_ID1 = 0x0E, PHY_ID2 = 7237 */
 			case MII_LAN83C185_ID:		/* SMSC LAN83C185: PHY_ID1 = 0x0007, PHY_ID2 = 0xC0A1 */
diff -urN linux-2.6.27-rc6.orig/drivers/net/arm/at91_ether.h linux-2.6.27-rc6/drivers/net/arm/at91_ether.h
--- linux-2.6.27-rc6.orig/drivers/net/arm/at91_ether.h	2008-09-14 20:15:27.000000000 +0200
+++ linux-2.6.27-rc6/drivers/net/arm/at91_ether.h	2008-09-16 21:15:59.000000000 +0200
@@ -48,6 +48,9 @@
 /* Altima AC101L PHY */
 #define MII_AC101L_ID		0x00225520
 
+/* Micrel KSZ8041 PHY */
+#define MII_KSZ8041_ID		0x00221510
+
 /* Micrel KS8721 PHY */
 #define MII_KS8721_ID		0x00221610
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] at91_ether: Add Micrel KSZ8041 PHY support
  2008-09-16 20:53 [PATCH] at91_ether: Add Micrel KSZ8041 PHY support Andrew Victor
@ 2008-09-17  8:04 ` Franco Fichtner
  2008-09-17  8:10   ` Franco Fichtner
  2008-09-17  8:42   ` Hans-Christian Egtvedt
  0 siblings, 2 replies; 4+ messages in thread
From: Franco Fichtner @ 2008-09-17  8:04 UTC (permalink / raw)
  To: Andrew Victor; +Cc: jgarzik, netdev, gustavo, kernel

Andrew Victor wrote:
> Add support for Micrel's KSZ8041 PHY in the Atmel AT91RM9200 Ethernet driver.
> The PHY is similar to the KS8721 (configuration registers differ a
> bit, like LED function and a new PHY Control 2 register and LinkMD
> control/status register, which aren't used by the at91_ether driver
> anyway). The chip has a different pin layout so it's no good for a
> drop in replacement anyway.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> Signed-off-by: Andrew Victor <linux@maxim.org.za>
> 

Added avr32 kernel list as CC.


Thanks,
Franco

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] at91_ether: Add Micrel KSZ8041 PHY support
  2008-09-17  8:04 ` Franco Fichtner
@ 2008-09-17  8:10   ` Franco Fichtner
  2008-09-17  8:42   ` Hans-Christian Egtvedt
  1 sibling, 0 replies; 4+ messages in thread
From: Franco Fichtner @ 2008-09-17  8:10 UTC (permalink / raw)
  To: Andrew Victor; +Cc: jgarzik, netdev, gustavo, kernel

Franco Fichtner wrote:
> Added avr32 kernel list as CC.

D'oh, missed the attached file. Forwarded all three patches instead.

> Thanks,
> Franco

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] at91_ether: Add Micrel KSZ8041 PHY support
  2008-09-17  8:04 ` Franco Fichtner
  2008-09-17  8:10   ` Franco Fichtner
@ 2008-09-17  8:42   ` Hans-Christian Egtvedt
  1 sibling, 0 replies; 4+ messages in thread
From: Hans-Christian Egtvedt @ 2008-09-17  8:42 UTC (permalink / raw)
  To: Franco Fichtner; +Cc: Andrew Victor, netdev, jgarzik, gustavo, kernel

On Wed, 17 Sep 2008 10:04:17 +0200
Franco Fichtner <franco@marian.de> wrote:

> Andrew Victor wrote:

<snipp changelog for adding addition PHY support in AT91RM9200 driver>

> Added avr32 kernel list as CC.
> 

Hmm, for our information? AVR32 devices uses the drivers/net/macb.c
driver. And this driver uses the kernel PHY library.

-- 
Best regards,
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-17  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-16 20:53 [PATCH] at91_ether: Add Micrel KSZ8041 PHY support Andrew Victor
2008-09-17  8:04 ` Franco Fichtner
2008-09-17  8:10   ` Franco Fichtner
2008-09-17  8:42   ` Hans-Christian Egtvedt

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).