public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 01/11] uec: add support for gbit mii status readings
Date: Mon, 24 Mar 2008 20:46:24 +0300	[thread overview]
Message-ID: <20080324174624.GA19904@localhost.localdomain> (raw)
In-Reply-To: <20080324174449.GA17079@localhost.localdomain>

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/qe/uec_phy.c |   28 +++++++++++++++++++---------
 drivers/qe/uec_phy.h |    5 +++++
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index a42701c..8c4a558 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -318,16 +318,26 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
 		return err;
 
 	if (mii_info->autoneg) {
-		status = phy_read (mii_info, PHY_ANLPAR);
+		status = phy_read(mii_info, MII_1000BASETSTATUS);
 
-		if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
-			mii_info->duplex = DUPLEX_FULL;
-		else
-			mii_info->duplex = DUPLEX_HALF;
-		if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
-			mii_info->speed = SPEED_100;
-		else
-			mii_info->speed = SPEED_10;
+		if (status & (LPA_1000FULL | LPA_1000HALF)) {
+			mii_info->speed = SPEED_1000;
+			if (status & LPA_1000FULL)
+				mii_info->duplex = DUPLEX_FULL;
+			else
+				mii_info->duplex = DUPLEX_HALF;
+		} else {
+			status = phy_read(mii_info, PHY_ANLPAR);
+
+			if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
+				mii_info->duplex = DUPLEX_FULL;
+			else
+				mii_info->duplex = DUPLEX_HALF;
+			if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
+				mii_info->speed = SPEED_100;
+			else
+				mii_info->speed = SPEED_10;
+		}
 		mii_info->pause = 0;
 	}
 	/* On non-aneg, we assume what we put in BMCR is the speed,
diff --git a/drivers/qe/uec_phy.h b/drivers/qe/uec_phy.h
index e59a940..6f769fb 100644
--- a/drivers/qe/uec_phy.h
+++ b/drivers/qe/uec_phy.h
@@ -29,6 +29,11 @@
 #define MII_1000BASETCONTROL_FULLDUPLEXCAP    0x0200
 #define MII_1000BASETCONTROL_HALFDUPLEXCAP    0x0100
 
+/* 1000BT status */
+#define MII_1000BASETSTATUS	0x0a
+#define LPA_1000FULL		0x0400
+#define LPA_1000HALF		0x0200
+
 /* Cicada Extended Control Register 1 */
 #define MII_CIS8201_EXT_CON1	    0x17
 #define MII_CIS8201_EXTCON1_INIT    0x0000
-- 
1.5.2.2

  reply	other threads:[~2008-03-24 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 17:44 [U-Boot-Users] [PATCH 0/11] Few MPC8360E-RDK related patches Anton Vorontsov
2008-03-24 17:46 ` Anton Vorontsov [this message]
2008-03-25  1:08   ` [U-Boot-Users] [PATCH 01/11] uec: add support for gbit mii status readings Kim Phillips
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 02/11] uec: add support for RGMII_RXID interface mode Anton Vorontsov
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 03/11] uec: add support for Broadcom BCM5481 Gigabit PHY Anton Vorontsov
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 04/11] mpc83xx: MPC8360E-RDK: use RGMII_RXID interface mode Anton Vorontsov
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 05/11] mpc83xx: MPC8360E-RDK: add support for NAND Anton Vorontsov
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 06/11] mpc83xx: MPC8360E-RDK: configure pario pins for AD7843 and FHCI Anton Vorontsov
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 07/11] mpc83xx: MPC8360E-RDK: rework ddr setup, enable ecc Anton Vorontsov
2008-03-24 17:47 ` [U-Boot-Users] [PATCH 08/11] mpc83xx: MPC8360E-RDK: add dhcp command Anton Vorontsov
2008-03-24 17:47 ` [U-Boot-Users] [PATCH 09/11] mpc83xx: MPC8360E-RDK: define CONFIG_OF_STDOUT_VIA_ALIAS Anton Vorontsov
2008-03-24 17:47 ` [U-Boot-Users] [PATCH 10/11] mpc83xx: MPC8360E-RDK: use 33.3(3)MHz CLKIN/SYS_CLK Anton Vorontsov
2008-03-24 17:47 ` [U-Boot-Users] [PATCH 11/11] mpc83xx: add "fsl, soc" and "fsl, immr" compatible fixups Anton Vorontsov

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=20080324174624.GA19904@localhost.localdomain \
    --to=avorontsov@ru.mvista.com \
    --cc=u-boot@lists.denx.de \
    /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