summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Yang2012-12-28 17:04:54 +0530
committerJérémy Dufour2013-01-30 13:06:44 +0100
commit1b8e234723cf8371e0b399897b9e62f666829845 (patch)
tree8d83f5b39ad822337dde4629ce5788421080985a
parent333b4065c569668d930082050a812c8b658464d6 (diff)
polux/linux/drivers/net: disable EEE in synopsys/RTL821x, refs #3664
The EEE is only disabled after the PHY reset.
-rw-r--r--polux/linux-2.6.10/drivers/net/synop3504/synop3504.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/polux/linux-2.6.10/drivers/net/synop3504/synop3504.c b/polux/linux-2.6.10/drivers/net/synop3504/synop3504.c
index 1440db06ec..624969a121 100644
--- a/polux/linux-2.6.10/drivers/net/synop3504/synop3504.c
+++ b/polux/linux-2.6.10/drivers/net/synop3504/synop3504.c
@@ -151,6 +151,41 @@ mdly (unsigned int msec)
}
/**
+ * Function : synop3504_disable_eee_rtl821x
+ * Purpose : Disable EEE for PHY RealTek 821x.
+ * Parameters : tc the Synopsys context.
+ * Return value : void.
+ *
+ * This function does not check the PHY is in fact a RTL821x. You must call
+ * this function only for a PHY RTL821x.
+ */
+static inline void
+synop3504_disable_eee_rtl821x (Synopsys *tc)
+{
+ /* Select Page5. */
+ SynopsysMiiWrite (tc, 31, 0x0005, AUTOMATIC_PHY_RESOLUTION);
+ /* Set reg #5. */
+ SynopsysMiiWrite (tc, 5, 0x8b85, AUTOMATIC_PHY_RESOLUTION);
+ /* For RTL8211E. */
+ SynopsysMiiWrite (tc, 6, 0x0ae2, AUTOMATIC_PHY_RESOLUTION);
+ /* Select Page7. */
+ SynopsysMiiWrite (tc, 31, 0x0007, AUTOMATIC_PHY_RESOLUTION);
+ /* Set reg #30. */
+ SynopsysMiiWrite (tc, 30, 0x0020, AUTOMATIC_PHY_RESOLUTION);
+ /* For RTL8211E. */
+ SynopsysMiiWrite (tc, 21, 0x1008, AUTOMATIC_PHY_RESOLUTION);
+ /* Select Page 0. */
+ SynopsysMiiWrite (tc, 31, 0x0000, AUTOMATIC_PHY_RESOLUTION);
+ /* Set address mode and MMD Device=7. */
+ SynopsysMiiWrite (tc, 13, 0x0007, AUTOMATIC_PHY_RESOLUTION);
+ /* Set address value. */
+ SynopsysMiiWrite (tc, 14, 0x003c, AUTOMATIC_PHY_RESOLUTION);
+ /* Set data mode and MMD Device=7. */
+ SynopsysMiiWrite (tc, 13, 0x4007, AUTOMATIC_PHY_RESOLUTION);
+ /* Set data. */
+ SynopsysMiiWrite (tc, 14, 0x0000, AUTOMATIC_PHY_RESOLUTION);
+}
+/**
* Function : synop3504_receive
* Purpose : Receives the packet and give to the upper layers.
* Parameters : dev->network device
@@ -507,6 +542,13 @@ synop3504_reset_phy (struct net_device *dev)
SynopsysMiiWrite (tc, 3, 0x8100, 22);
break;
}
+ /* In case of a PHY RTL821x, we need to disable the EEE after PHY
+ * reset. */
+ if (pr->OUI_model == REALTEK_RTL8211E)
+ {
+ /* Disable EEE. */
+ synop3504_disable_eee_rtl821x (tc);
+ }
}
__u32