* [PATCH] Setup PHYs for rtl8101/2(e) hardware
@ 2008-07-02 6:24 Mario_Limonciello
2008-07-02 21:50 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Mario_Limonciello @ 2008-07-02 6:24 UTC (permalink / raw)
To: netdev, romieu
Hello:
In comparing the differences with the Realtek release r8101-1.008.05-1 of their r8101 driver, I found a handful of differences in the startup procedures of the r8169 driver. I isolated two sets of fixes that get rid of transient errors when loading the drivers.
Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com> <mailto:Mario_Limonciello@Dell.com>
---
drivers/net/r8169.c | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4c5a875..89def08 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1139,6 +1139,10 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
{ 0x7cf00000, 0x34000000, RTL_GIGA_MAC_VER_13 },
{ 0x7cf00000, 0x34200000, RTL_GIGA_MAC_VER_16 },
{ 0x7c800000, 0x34000000, RTL_GIGA_MAC_VER_16 },
+ /* 8101E */
+ { 0x7c800000, 0x24800000, RTL_GIGA_MAC_VER_16 },
+ /* 8102E */
+ { 0x7c800000, 0x34800000, RTL_GIGA_MAC_VER_16 },
/* FIXME: where did these entries come from ? -- FR */
{ 0xfc800000, 0x38800000, RTL_GIGA_MAC_VER_15 },
{ 0xfc800000, 0x30800000, RTL_GIGA_MAC_VER_14 },
@@ -1299,6 +1303,21 @@ static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
+static void rtl8101_hw_phy_config(void __iomem *ioaddr)
+{
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0000 },
+ { 0x11, mdio_read(ioaddr,0x11) | 0x1000 },
+ { 0x19, mdio_read(ioaddr,0x19) | 0x2000 },
+ { 0x1f, 0x0003 },
+ { 0x08, 0x441D },
+ { 0x01, 0xc066 },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
+
static void rtl_hw_phy_config(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
@@ -1316,6 +1335,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
case RTL_GIGA_MAC_VER_04:
rtl8169sb_hw_phy_config(ioaddr);
break;
+ case RTL_GIGA_MAC_VER_13:
+ case RTL_GIGA_MAC_VER_16:
+ rtl8101_hw_phy_config(ioaddr);
case RTL_GIGA_MAC_VER_18:
rtl8168cp_hw_phy_config(ioaddr);
break;
@@ -1438,8 +1460,11 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
rtl_hw_phy_config(dev);
- dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
- RTL_W8(0x82, 0x01);
+ if (tp->mac_version != RTL_GIGA_MAC_VER_13 && tp->mac_version != RTL_GIGA_MAC_VER_16)
+ {
+ dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+ RTL_W8(0x82, 0x01);
+ }
pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
--
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Setup PHYs for rtl8101/2(e) hardware
2008-07-02 6:24 [PATCH] Setup PHYs for rtl8101/2(e) hardware Mario_Limonciello
@ 2008-07-02 21:50 ` Francois Romieu
2008-07-02 21:58 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2008-07-02 21:50 UTC (permalink / raw)
To: Mario_Limonciello; +Cc: netdev, Edward Hsu
Mario_Limonciello@Dell.com <Mario_Limonciello@Dell.com> :
[...]
> In comparing the differences with the Realtek release r8101-1.008.05-1
> of their r8101 driver, I found a handful of differences in the startup
> procedures of the r8169 driver. I isolated two sets of fixes that get
> rid of transient errors when loading the drivers.
(please restrain your lines to ~80 cols and Cc: Edward)
May I ask where did you got r8101-1.008.05-1 ? I only have
r8101-1.007.00 from Realtek's ftp (dated 21/04/2008).
Judging from r8101-1.007.00, I would say that your change is almost
right but that it can overlap some existing devices. This remark may
be irrelevant if there are enough differences between r8101-1.007.00
and r8101-1.008.05-1 though.
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Setup PHYs for rtl8101/2(e) hardware
2008-07-02 21:50 ` Francois Romieu
@ 2008-07-02 21:58 ` Mario Limonciello
0 siblings, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2008-07-02 21:58 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Edward Hsu
[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]
Francois:
r8101-1.008.05-1 was provided to me from a colleague who was working
with Realtek to support his platform. It was given to me under the
presumption that it would have already been posted to the Realtek FTP by
now (I'm a bit surprised it isn't).
When you are warning of device overlap, I'm assuming you mean in the PHY
setup. As of this r8101 release all of their configs in the driver
setup the PHYs the same way, so it didn't appear to be a problem.
You'll see once it is posted I suppose.
There is a number of other changes between the old release to this one,
but these were the only relevant changes that I saw to fix the current
transient stability issue of the device when loaded.
Edward:
Perhaps you can shed light as to why it hasn't been posted yet?
Regards,
Francois Romieu wrote:
> Mario_Limonciello@Dell.com <Mario_Limonciello@Dell.com> :
> [...]
>
>> In comparing the differences with the Realtek release r8101-1.008.05-1
>> of their r8101 driver, I found a handful of differences in the startup
>> procedures of the r8169 driver. I isolated two sets of fixes that get
>> rid of transient errors when loading the drivers.
>>
>
> (please restrain your lines to ~80 cols and Cc: Edward)
>
> May I ask where did you got r8101-1.008.05-1 ? I only have
> r8101-1.007.00 from Realtek's ftp (dated 21/04/2008).
>
> Judging from r8101-1.007.00, I would say that your change is almost
> right but that it can overlap some existing devices. This remark may
> be irrelevant if there are enough differences between r8101-1.007.00
> and r8101-1.008.05-1 though.
>
>
--
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-02 21:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 6:24 [PATCH] Setup PHYs for rtl8101/2(e) hardware Mario_Limonciello
2008-07-02 21:50 ` Francois Romieu
2008-07-02 21:58 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).