From: Dirk Behme <dirk.behme@de.bosch.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed
Date: Thu, 19 Jan 2012 13:27:24 +0100 [thread overview]
Message-ID: <4F180C2C.7080303@de.bosch.com> (raw)
In-Reply-To: <1326456604-25137-3-git-send-email-dirk.behme@de.bosch.com>
Hi Troy,
On 13.01.2012 13:10, Dirk Behme wrote:
> From: Troy Kisky <troy.kisky@boundarydevices.com>
>
> Previously, only GIGE phy was supported in this function.
>
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> CC: Troy Kisky <troy.kisky@boundarydevices.com>
> CC: Stefano Babic <sbabic@denx.de>
> CC: Marek Vasut <marek.vasut@gmail.com>
> ---
> common/miiphyutil.c | 18 +++++++++++++++++-
> 1 files changed, 17 insertions(+), 1 deletions(-)
>
> diff --git a/common/miiphyutil.c b/common/miiphyutil.c
> index 2cc23b4..8cb4748 100644
> --- a/common/miiphyutil.c
> +++ b/common/miiphyutil.c
> @@ -471,7 +471,23 @@ int miiphy_speed(const char *devname, unsigned char addr)
> (btsr & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)))
> return _1000BASET;
> #endif /* CONFIG_PHY_GIGE */
> -
> +#ifdef CONFIG_PHY_MICREL_KSZ9021
> +#define MII_PHY_CTL 0x1f
> +#define MII_PHY_CTL_1000 (1 << 6)
> +#define MII_PHY_CTL_100 (1 << 5)
> +#define MII_PHY_CTL_10 (1 << 4)
> + u16 btsr;
> + if (miiphy_read(devname, addr, MII_PHY_CTL, &btsr)) {
> + printf("PHY 1000BT status");
> + goto miiphy_read_failed;
> + }
> + if (btsr & MII_PHY_CTL_1000)
> + return _1000BASET;
> + if (btsr & MII_PHY_CTL_100)
> + return _100BASET;
> + if (btsr & MII_PHY_CTL_10)
> + return _10BASET;
> +#endif
> /* Check Basic Management Control Register first. */
> if (miiphy_read(devname, addr, MII_BMCR, &bmcr)) {
> printf("PHY speed");
Thilo mentioned that on an ARM2 board he additionally needs
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 8cb4748..d3ff2af 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -500,6 +500,8 @@ int miiphy_speed(const char *devname, unsigned char
addr)
printf("PHY AN speed");
goto miiphy_read_failed;
}
+ if (anlpar & LPA_1000XFULL )
+ return _1000BASET;
return (anlpar & LPA_100) ? _100BASET : _10BASET;
}
/* Get speed from basic control settings. */
to make GbE work on that board. What do you think?
Best regards
Dirk
next prev parent reply other threads:[~2012-01-19 12:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 12:10 [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 2/5] net: fec_mxc: Increase autonegotiation timeout Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed Dirk Behme
2012-01-13 12:44 ` Marek Vasut
2012-01-15 0:56 ` Mike Frysinger
2012-01-19 12:38 ` Dirk Behme
2012-01-19 16:19 ` Dirk Behme
2012-01-19 18:24 ` Mike Frysinger
2012-01-19 18:24 ` Mike Frysinger
2012-01-19 12:27 ` Dirk Behme [this message]
2012-01-13 12:10 ` [U-Boot] [PATCH 4/5] net: fec_mxc: Nove autonegoatiate restart after mii_postcall Dirk Behme
2012-01-13 12:44 ` Marek Vasut
2012-01-13 21:42 ` Troy Kisky
2012-01-13 13:54 ` Stefano Babic
2012-01-13 21:22 ` Troy Kisky
2012-01-13 12:10 ` [U-Boot] [PATCH 5/5] i.mx6q: mx6qsabrelite: Update the network configuration Dirk Behme
2012-01-16 13:48 ` Jason Hui
2012-01-16 19:51 ` Troy Kisky
2012-01-13 12:42 ` [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Marek Vasut
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=4F180C2C.7080303@de.bosch.com \
--to=dirk.behme@de.bosch.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