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 03/11] uec: add support for Broadcom BCM5481 Gigabit PHY
Date: Mon, 24 Mar 2008 20:46:34 +0300	[thread overview]
Message-ID: <20080324174634.GC19904@localhost.localdomain> (raw)
In-Reply-To: <20080324174449.GA17079@localhost.localdomain>

This patch adds basic support for Broadcom BCM5481 PHY.

RXD-RXC delay quirk comes from MPC8360E-RDK BSP source, author is
Peter Barada <peterb@logicpd.com>.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/qe/uec_phy.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 8c4a558..423ba78 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -347,6 +347,37 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
 	return 0;
 }
 
+static int bcm_init(struct uec_mii_info *mii_info)
+{
+	struct eth_device *edev = mii_info->dev;
+	uec_private_t *uec = edev->priv;
+
+	gbit_config_aneg(mii_info);
+
+	if (uec->uec_info->enet_interface == ENET_1000_RGMII_RXID) {
+		u16 val;
+		int cnt = 50;
+
+		/* Wait for aneg to complete. */
+		do
+			val = phy_read(mii_info, PHY_BMSR);
+		while (--cnt && !(val & PHY_BMSR_AUTN_COMP));
+
+		/* Set RDX clk delay. */
+		phy_write(mii_info, 0x18, 0x7 | (7 << 12));
+
+		val = phy_read(mii_info, 0x18);
+		/* Set RDX-RXC skew. */
+		val |= (1 << 8);
+		val |= (7 | (7 << 12));
+		/* Write bits 14:0. */
+		val |= (1 << 15);
+		phy_write(mii_info, 0x18, val);
+	}
+
+	 return 0;
+}
+
 static int marvell_read_status (struct uec_mii_info *mii_info)
 {
 	u16 status;
@@ -515,6 +546,15 @@ static struct phy_info phy_info_marvell = {
 	.config_intr = &marvell_config_intr,
 };
 
+static struct phy_info phy_info_bcm5481 = {
+	.phy_id = 0x0143bca0,
+	.phy_id_mask = 0xffffff0,
+	.name = "Broadcom 5481",
+	.features = MII_GBIT_FEATURES,
+	.read_status = genmii_read_status,
+	.init = bcm_init,
+};
+
 static struct phy_info phy_info_genmii = {
 	.phy_id = 0x00000000,
 	.phy_id_mask = 0x00000000,
@@ -528,6 +568,7 @@ static struct phy_info *phy_info[] = {
 	&phy_info_dm9161,
 	&phy_info_dm9161a,
 	&phy_info_marvell,
+	&phy_info_bcm5481,
 	&phy_info_genmii,
 	NULL
 };
-- 
1.5.2.2

  parent 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 ` [U-Boot-Users] [PATCH 01/11] uec: add support for gbit mii status readings Anton Vorontsov
2008-03-25  1:08   ` 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 ` Anton Vorontsov [this message]
2008-03-24 17:46 ` [U-Boot-Users] [PATCH 04/11] mpc83xx: MPC8360E-RDK: use " 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=20080324174634.GC19904@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