From: Francois Romieu <romieu@fr.zoreil.com>
To: netdev@vger.kernel.org
Cc: jeff@garzik.org, akpm@linux-foundation.org,
Edward Hsu <edward_hsu@realtek.com.tw>,
Mario Limonciello <mario_limonciello@dell.com>,
Kasper Sandberg <lkml@metanurb.dk>
Subject: [PATCH 3/13] r8169: update phy init parameters
Date: Sun, 29 Jun 2008 16:41:43 +0200 [thread overview]
Message-ID: <20080629144143.GD1540@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20080629143817.GA1540@electric-eye.fr.zoreil.com>
The modified parameters are synced with Realtek's driver
version 8.006.00.
The change should only be noticeable with some 8168c.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index cfe8829..a42a21f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -482,6 +482,11 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
return value;
}
+static void mdio_patch(void __iomem *ioaddr, int reg_addr, int value)
+{
+ mdio_write(ioaddr, reg_addr, mdio_read(ioaddr, reg_addr) | value);
+}
+
static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr)
{
RTL_W16(IntrMask, 0x0000);
@@ -1257,26 +1262,45 @@ static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
{ 0x1f, 0x0003 },
{ 0x12, 0xc096 },
{ 0x16, 0x000a },
- { 0x1f, 0x0000 }
+ { 0x1f, 0x0000 },
+ { 0x1f, 0x0000 },
+ { 0x09, 0x2000 },
+ { 0x09, 0x0000 }
};
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+ mdio_patch(ioaddr, 0x14, 1 << 5);
+ mdio_patch(ioaddr, 0x0d, 1 << 5);
+ mdio_write(ioaddr, 0x1f, 0x0000);
}
static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)
{
struct phy_reg phy_reg_init[] = {
- { 0x1f, 0x0000 },
+ { 0x1f, 0x0001 },
{ 0x12, 0x2300 },
- { 0x1f, 0x0003 },
- { 0x16, 0x0f0a },
- { 0x1f, 0x0000 },
+ { 0x03, 0x802f },
+ { 0x02, 0x4f02 },
+ { 0x01, 0x0409 },
+ { 0x00, 0xf099 },
+ { 0x04, 0x9800 },
+ { 0x04, 0x9000 },
+ { 0x1d, 0x3d98 },
{ 0x1f, 0x0002 },
{ 0x0c, 0x7eb8 },
+ { 0x06, 0x0761 },
+ { 0x1f, 0x0003 },
+ { 0x16, 0x0f0a },
{ 0x1f, 0x0000 }
};
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+ mdio_patch(ioaddr, 0x16, 1 << 0);
+ mdio_patch(ioaddr, 0x14, 1 << 5);
+ mdio_patch(ioaddr, 0x0d, 1 << 5);
+ mdio_write(ioaddr, 0x1f, 0x0000);
}
static void rtl_hw_phy_config(struct net_device *dev)
--
1.5.3.3
next prev parent reply other threads:[~2008-06-29 14:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-29 14:38 [RFT 0/13] r8169 branch info Francois Romieu
2008-06-29 14:39 ` [PATCH 1/13] r8169: multicast register update (sync with Realtek's 8.004.00 8168 driver) Francois Romieu
2008-06-29 14:40 ` [PATCH 2/13] r8169: remove non-napi code Francois Romieu
2008-06-29 14:41 ` Francois Romieu [this message]
2008-06-29 14:42 ` [PATCH 4/13] r8169: new phy init parameters for the 8168b Francois Romieu
2008-06-29 14:43 ` [PATCH 5/13] r8169: shuffle some registers handling around (8168 operation only) Francois Romieu
2008-06-29 14:44 ` [PATCH 6/13] r8169: add 8168 registers description Francois Romieu
2008-06-29 14:44 ` [PATCH 7/13] r8169: make room for more specific 8168 hardware start procedure Francois Romieu
2008-06-29 14:45 ` [PATCH 8/13] r8169: Tx performance tweak Francois Romieu
2008-06-30 10:53 ` Ben Hutchings
2008-07-01 21:40 ` Francois Romieu
2008-06-29 14:46 ` [PATCH 9/13] r8169: sync existing 8168 device hardware start sequences with vendor driver Francois Romieu
2008-06-29 14:47 ` [PATCH 10/13] r8169: add a new 8168 flavor Francois Romieu
2008-06-29 14:47 ` [PATCH 11/13] r8169: add a new 8168 flavor (bis) Francois Romieu
2008-06-29 14:48 ` [PATCH 12/13] r8169: add a new 8168 flavor (ter) Francois Romieu
2008-06-29 14:49 ` [PATCH 13/13] r8169: change default behavior for mildly identified 8168c chipsets Francois Romieu
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=20080629144143.GD1540@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=akpm@linux-foundation.org \
--cc=edward_hsu@realtek.com.tw \
--cc=jeff@garzik.org \
--cc=lkml@metanurb.dk \
--cc=mario_limonciello@dell.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).