Skip to contentSkip to conversation

driver/net/fm/memac_phy: set NEG bit for external MDIOs

PATCH New shh.xie at gmail.com 3 participants 3 messages Aug 13, 2014 – Nov 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver/net/fm/memac_phy: set NEG bit for external MDIOs

From: Shaohui Xie <[email protected]>

NEG bit default is '1' for external MDIOs as per FMAN-v3 RM, but on some platforms, e.g. T2080QDS, this bit is '0', which leads to MDIO failure on XAUI PHY, so set this bit definitely to align with the RM.

---
 arch/powerpc/include/asm/fsl_memac.h | 1 +
 drivers/net/fm/memac_phy.c           | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/fsl_memac.h +1 -0
index 4640e33..190643e 100644
@@ -243,6 +243,7 @@ struct memac_mdio_controller {
 #define MDIO_STAT_PRE		(1 << 5)
 #define MDIO_STAT_ENC		(1 << 6)
 #define MDIO_STAT_HOLD_15_CLK	(7 << 2)
+#define MDIO_STAT_NEG		(1 << 23)
 
 #define MDIO_CTL_DEV_ADDR(x)	(x & 0x1f)
 #define MDIO_CTL_PORT_ADDR(x)	((x & 0x1f) << 5)
drivers/net/fm/memac_phy.c +4 -1
index de9c0e9..f5b20d5 100644
@@ -137,9 +137,12 @@ int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info)
 	 * is zero, so MDIO clock is disabled.
 	 * So, for proper functioning of MDIO, MDIO_CLK_DIV bits needs to
 	 * be properly initialized.
+	 * NEG bit default should be '1' as per FMAN-v3 RM, but on platform
+	 * like T2080QDS, this bit default is '0', which leads to MDIO failure
+	 * on XAUI PHY, so set this bit definitely.
 	 */
 	setbits_be32(&((struct memac_mdio_controller *)info->regs)->mdio_stat,
-		     MDIO_STAT_CLKDIV(258));
+		     MDIO_STAT_CLKDIV(258) | MDIO_STAT_NEG);
 
 	return mdio_register(bus);
 }
Signature · 1 line
1.8.0
#1 lore raw

PATCH 1/1 driver/net/fm/memac_phy: set NEG bit for external MDIOs

Quoted 8 lines · On Wed, Aug 13, 2014 at 5:38 AM, <[email protected]> wrote:

From: Shaohui Xie <[email protected]>

NEG bit default is '1' for external MDIOs as per FMAN-v3 RM, but on some platforms, e.g. T2080QDS, this bit is '0', which leads to MDIO failure on XAUI PHY, so set this bit definitely to align with the RM.

#2 lore raw

PATCH 1/1 driver/net/fm/memac_phy: set NEG bit for external MDIOs

In reply to shh.xie at gmail.com
Quoted 8 lines · shh.xie at gmail.com

From: Shaohui Xie <[email protected]>

NEG bit default is '1' for external MDIOs as per FMAN-v3 RM, but on some platforms, e.g. T2080QDS, this bit is '0', which leads to MDIO failure on XAUI PHY, so set this bit definitely to align with the RM.

---

Applied to u-boot-mpc85xx master. Thanks.

York