All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 3/8] ibm_newemac: Add ET1011c PHY support
Date: Wed, 21 Nov 2007 17:06:41 +1100	[thread overview]
Message-ID: <20071121060731.D383FDDDF2@ozlabs.org> (raw)
In-Reply-To: <1195625198.76200.922309668615.qpush@grosgo>

From: Stefan Roese <sr@denx.de>

This adds support for the Agere ET1011c PHY as found on the AMCC Taishan
board.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/net/ibm_newemac/phy.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Index: linux-work/drivers/net/ibm_newemac/phy.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/phy.c	2007-11-08 18:54:12.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/phy.c	2007-11-08 18:54:13.000000000 +1100
@@ -327,6 +327,42 @@ static int m88e1111_init(struct mii_phy 
 	return  0;
 }
 
+static int et1011c_init(struct mii_phy *phy)
+{
+        u16 reg_short;
+
+        reg_short = (u16)(phy_read(phy,0x16));
+        reg_short &= ~(0x7);
+        reg_short |= 0x6;       /* RGMII Trace Delay*/
+        phy_write(phy, 0x16, reg_short);
+
+        reg_short = (u16)(phy_read(phy, 0x17));
+        reg_short &= ~(0x40);
+        phy_write(phy, 0x17, reg_short);
+
+        phy_write(phy,0x1c,0x74f0);
+        return 0;
+}
+
+static struct mii_phy_ops et1011c_phy_ops = {
+        .init           = et1011c_init,
+        .setup_aneg     = genmii_setup_aneg,
+        .setup_forced   = genmii_setup_forced,
+        .poll_link      = genmii_poll_link,
+        .read_link      = genmii_read_link
+};
+
+static struct mii_phy_def et1011c_phy_def = {
+        .phy_id         = 0x0282f000,
+        .phy_id_mask    = 0x0fffff00,
+        .name           = "ET1011C Gigabit Ethernet",
+        .ops            = &et1011c_phy_ops
+};
+
+
+
+
+
 static struct mii_phy_ops m88e1111_phy_ops = {
 	.init		= m88e1111_init,
 	.setup_aneg	= genmii_setup_aneg,
@@ -344,6 +380,7 @@ static struct mii_phy_def m88e1111_phy_d
 };
 
 static struct mii_phy_def *mii_phy_table[] = {
+	&et1011c_phy_def,
 	&cis8201_phy_def,
 	&bcm5248_phy_def,
 	&m88e1111_phy_def,

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <jgarzik@pobox.com>
Cc: <netdev@vger.kernel.org>, <linuxppc-dev@ozlabs.org>,
	Josh Boyer <jwboyer@linux.vnet.ibm.com>
Subject: [PATCH 3/8] ibm_newemac: Add ET1011c PHY support
Date: Wed, 21 Nov 2007 17:06:41 +1100	[thread overview]
Message-ID: <20071121060731.D383FDDDF2@ozlabs.org> (raw)
In-Reply-To: <1195625198.76200.922309668615.qpush@grosgo>

From: Stefan Roese <sr@denx.de>

This adds support for the Agere ET1011c PHY as found on the AMCC Taishan
board.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/net/ibm_newemac/phy.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Index: linux-work/drivers/net/ibm_newemac/phy.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/phy.c	2007-11-08 18:54:12.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/phy.c	2007-11-08 18:54:13.000000000 +1100
@@ -327,6 +327,42 @@ static int m88e1111_init(struct mii_phy 
 	return  0;
 }
 
+static int et1011c_init(struct mii_phy *phy)
+{
+        u16 reg_short;
+
+        reg_short = (u16)(phy_read(phy,0x16));
+        reg_short &= ~(0x7);
+        reg_short |= 0x6;       /* RGMII Trace Delay*/
+        phy_write(phy, 0x16, reg_short);
+
+        reg_short = (u16)(phy_read(phy, 0x17));
+        reg_short &= ~(0x40);
+        phy_write(phy, 0x17, reg_short);
+
+        phy_write(phy,0x1c,0x74f0);
+        return 0;
+}
+
+static struct mii_phy_ops et1011c_phy_ops = {
+        .init           = et1011c_init,
+        .setup_aneg     = genmii_setup_aneg,
+        .setup_forced   = genmii_setup_forced,
+        .poll_link      = genmii_poll_link,
+        .read_link      = genmii_read_link
+};
+
+static struct mii_phy_def et1011c_phy_def = {
+        .phy_id         = 0x0282f000,
+        .phy_id_mask    = 0x0fffff00,
+        .name           = "ET1011C Gigabit Ethernet",
+        .ops            = &et1011c_phy_ops
+};
+
+
+
+
+
 static struct mii_phy_ops m88e1111_phy_ops = {
 	.init		= m88e1111_init,
 	.setup_aneg	= genmii_setup_aneg,
@@ -344,6 +380,7 @@ static struct mii_phy_def m88e1111_phy_d
 };
 
 static struct mii_phy_def *mii_phy_table[] = {
+	&et1011c_phy_def,
 	&cis8201_phy_def,
 	&bcm5248_phy_def,
 	&m88e1111_phy_def,

  parent reply	other threads:[~2007-11-21  6:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21  6:06 [PATCH 0/8] ibm_newemac: Candidate patches for 2.6.25 Benjamin Herrenschmidt
2007-11-21  6:06 ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 1/8] ibm_newemac: Fix possible lockup on close Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21 15:41   ` Christoph Hellwig
2007-11-21 15:43     ` Josh Boyer
2007-11-21 15:43       ` Josh Boyer
2007-11-21 19:53     ` Benjamin Herrenschmidt
2007-11-21 19:53       ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 2/8] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  6:06 ` Benjamin Herrenschmidt [this message]
2007-11-21  6:06   ` [PATCH 3/8] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 4/8] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 5/8] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 6/8] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 7/8] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  6:06 ` [PATCH 8/8] ibm_newemac: Skip EMACs that are marked unused by the firmware Benjamin Herrenschmidt
2007-11-21  6:06   ` Benjamin Herrenschmidt
2007-11-21  7:13   ` Stefan Roese
2007-11-21  7:13     ` Stefan Roese
2007-11-21  7:28     ` Benjamin Herrenschmidt
2007-11-24  1:43 ` [PATCH 0/8] ibm_newemac: Candidate patches for 2.6.25 Jeff Garzik
2007-11-24  1:43   ` Jeff Garzik

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=20071121060731.D383FDDDF2@ozlabs.org \
    --to=benh@kernel.crashing.org \
    --cc=jgarzik@pobox.com \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.