* [PATCH net-next 1/6] r8169: fix r8101 quirk dupe
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
@ 2009-08-11 5:41 ` Francois Romieu
2009-08-11 5:42 ` [PATCH net-next 2/6] r8169: differentiate close chipsets in the startup identification message Francois Romieu
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:41 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev, plr.vincent
Noticed by Vincent Pelletier <plr.vincent@gmail.com>.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b82780d..eac882b 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2757,7 +2757,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
EnableBist | \
Mac_dbgo_oe | \
Force_half_dup | \
- Force_half_dup | \
+ Force_rxflow_en | \
Force_txflow_en | \
Cxpl_dbg_sel | \
ASF | \
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH net-next 2/6] r8169: differentiate close chipsets in the startup identification message
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
2009-08-11 5:41 ` [PATCH net-next 1/6] r8169: fix r8101 quirk dupe Francois Romieu
@ 2009-08-11 5:42 ` Francois Romieu
2009-08-11 5:43 ` [PATCH net-next 3/6] r8169: phy init for the 8169sce Francois Romieu
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:42 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev
The driver displays the same 0x18000000 xid for RTL_GIGA_MAC_VER_06
and RTL_GIGA_MAC_VER_05 whereas the former ought to be identified as
0x98000000.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index eac882b..6c4b879 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2180,7 +2180,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, dev);
if (netif_msg_probe(tp)) {
- u32 xid = RTL_R32(TxConfig) & 0x7cf0f8ff;
+ u32 xid = RTL_R32(TxConfig) & 0x9cf0f8ff;
printk(KERN_INFO "%s: %s at 0x%lx, "
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH net-next 3/6] r8169: phy init for the 8169sce
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
2009-08-11 5:41 ` [PATCH net-next 1/6] r8169: fix r8101 quirk dupe Francois Romieu
2009-08-11 5:42 ` [PATCH net-next 2/6] r8169: differentiate close chipsets in the startup identification message Francois Romieu
@ 2009-08-11 5:43 ` Francois Romieu
2009-08-11 5:44 ` [PATCH net-next 4/6] r8169: phy init for the 8169scd Francois Romieu
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:43 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev
Synced with Realtek's 6.011.00 r8169 driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 6c4b879..8672288 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1389,6 +1389,59 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
+static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
+{
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x04, 0x0000 },
+ { 0x03, 0x00a1 },
+ { 0x02, 0x0008 },
+ { 0x01, 0x0120 },
+ { 0x00, 0x1000 },
+ { 0x04, 0x0800 },
+ { 0x04, 0x9000 },
+ { 0x03, 0x802f },
+ { 0x02, 0x4f02 },
+ { 0x01, 0x0409 },
+ { 0x00, 0xf099 },
+ { 0x04, 0x9800 },
+ { 0x04, 0xa000 },
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0xff95 },
+ { 0x00, 0xba00 },
+ { 0x04, 0xa800 },
+ { 0x04, 0xf000 },
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0x101a },
+ { 0x00, 0xa0ff },
+ { 0x04, 0xf800 },
+ { 0x04, 0x0000 },
+ { 0x1f, 0x0000 },
+
+ { 0x1f, 0x0001 },
+ { 0x0b, 0x8480 },
+ { 0x1f, 0x0000 },
+
+ { 0x1f, 0x0001 },
+ { 0x18, 0x67c7 },
+ { 0x04, 0x2000 },
+ { 0x03, 0x002f },
+ { 0x02, 0x4360 },
+ { 0x01, 0x0109 },
+ { 0x00, 0x3022 },
+ { 0x04, 0x2800 },
+ { 0x1f, 0x0000 },
+
+ { 0x1f, 0x0001 },
+ { 0x17, 0x0cc0 },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
+
static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
{
struct phy_reg phy_reg_init[] = {
@@ -1628,6 +1681,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_06:
+ rtl8169sce_hw_phy_config(ioaddr);
+ break;
case RTL_GIGA_MAC_VER_07:
case RTL_GIGA_MAC_VER_08:
case RTL_GIGA_MAC_VER_09:
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH net-next 4/6] r8169: phy init for the 8169scd
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
` (2 preceding siblings ...)
2009-08-11 5:43 ` [PATCH net-next 3/6] r8169: phy init for the 8169sce Francois Romieu
@ 2009-08-11 5:44 ` Francois Romieu
2009-08-11 5:44 ` [PATCH net-next 5/6] r8169: phy init for the 8169s Francois Romieu
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:44 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev
Synced with Realtek's 6.011.00 r8169 driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 2 +
2 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 8672288..4470fef 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1389,6 +1389,71 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
+static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
+ void __iomem *ioaddr)
+{
+ struct pci_dev *pdev = tp->pci_dev;
+ u16 vendor_id, device_id;
+
+ pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor_id);
+ pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &device_id);
+
+ if ((vendor_id != PCI_VENDOR_ID_GIGABYTE) || (device_id != 0xe000))
+ return;
+
+ mdio_write(ioaddr, 0x1f, 0x0001);
+ mdio_write(ioaddr, 0x10, 0xf01b);
+ mdio_write(ioaddr, 0x1f, 0x0000);
+}
+
+static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
+ void __iomem *ioaddr)
+{
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x04, 0x0000 },
+ { 0x03, 0x00a1 },
+ { 0x02, 0x0008 },
+ { 0x01, 0x0120 },
+ { 0x00, 0x1000 },
+ { 0x04, 0x0800 },
+ { 0x04, 0x9000 },
+ { 0x03, 0x802f },
+ { 0x02, 0x4f02 },
+ { 0x01, 0x0409 },
+ { 0x00, 0xf099 },
+ { 0x04, 0x9800 },
+ { 0x04, 0xa000 },
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0xff95 },
+ { 0x00, 0xba00 },
+ { 0x04, 0xa800 },
+ { 0x04, 0xf000 },
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0x101a },
+ { 0x00, 0xa0ff },
+ { 0x04, 0xf800 },
+ { 0x04, 0x0000 },
+ { 0x1f, 0x0000 },
+
+ { 0x1f, 0x0001 },
+ { 0x10, 0xf41b },
+ { 0x14, 0xfb54 },
+ { 0x18, 0xf5c7 },
+ { 0x1f, 0x0000 },
+
+ { 0x1f, 0x0001 },
+ { 0x17, 0x0cc0 },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+ rtl8169scd_hw_phy_config_quirk(tp, ioaddr);
+}
+
static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
{
struct phy_reg phy_reg_init[] = {
@@ -1681,6 +1746,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_05:
+ rtl8169scd_hw_phy_config(tp, ioaddr);
+ break;
case RTL_GIGA_MAC_VER_06:
rtl8169sce_hw_phy_config(ioaddr);
break;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 73b46b6..fdc3110 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1984,6 +1984,8 @@
#define PCI_VENDOR_ID_SAMSUNG 0x144d
+#define PCI_VENDOR_ID_GIGABYTE 0x1458
+
#define PCI_VENDOR_ID_AMBIT 0x1468
#define PCI_VENDOR_ID_MYRICOM 0x14c1
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH net-next 5/6] r8169: phy init for the 8169s
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
` (3 preceding siblings ...)
2009-08-11 5:44 ` [PATCH net-next 4/6] r8169: phy init for the 8169scd Francois Romieu
@ 2009-08-11 5:44 ` Francois Romieu
2009-08-11 5:45 ` [PATCH net-next 6/6] r8169: phy init for the 8102e Francois Romieu
2009-08-13 5:17 ` [PATCH net-next 0/6] r8169 updates David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:44 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev
Synced with Realtek's 6.011.00 r8169 driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 116 ++++++++++++++++++++++++++------------------------
1 files changed, 60 insertions(+), 56 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4470fef..93a87aa 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1222,17 +1222,6 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
.get_ethtool_stats = rtl8169_get_ethtool_stats,
};
-static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg,
- int bitnum, int bitval)
-{
- int val;
-
- val = mdio_read(ioaddr, reg);
- val = (bitval == 1) ?
- val | (bitval << bitnum) : val & ~(0x0001 << bitnum);
- mdio_write(ioaddr, reg, val & 0xffff);
-}
-
static void rtl8169_get_mac_version(struct rtl8169_private *tp,
void __iomem *ioaddr)
{
@@ -1328,54 +1317,69 @@ static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len)
static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
{
- struct {
- u16 regs[5]; /* Beware of bit-sign propagation */
- } phy_magic[5] = { {
- { 0x0000, //w 4 15 12 0
- 0x00a1, //w 3 15 0 00a1
- 0x0008, //w 2 15 0 0008
- 0x1020, //w 1 15 0 1020
- 0x1000 } },{ //w 0 15 0 1000
- { 0x7000, //w 4 15 12 7
- 0xff41, //w 3 15 0 ff41
- 0xde60, //w 2 15 0 de60
- 0x0140, //w 1 15 0 0140
- 0x0077 } },{ //w 0 15 0 0077
- { 0xa000, //w 4 15 12 a
- 0xdf01, //w 3 15 0 df01
- 0xdf20, //w 2 15 0 df20
- 0xff95, //w 1 15 0 ff95
- 0xfa00 } },{ //w 0 15 0 fa00
- { 0xb000, //w 4 15 12 b
- 0xff41, //w 3 15 0 ff41
- 0xde20, //w 2 15 0 de20
- 0x0140, //w 1 15 0 0140
- 0x00bb } },{ //w 0 15 0 00bb
- { 0xf000, //w 4 15 12 f
- 0xdf01, //w 3 15 0 df01
- 0xdf20, //w 2 15 0 df20
- 0xff95, //w 1 15 0 ff95
- 0xbf00 } //w 0 15 0 bf00
- }
- }, *p = phy_magic;
- unsigned int i;
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x06, 0x006e },
+ { 0x08, 0x0708 },
+ { 0x15, 0x4000 },
+ { 0x18, 0x65c7 },
- mdio_write(ioaddr, 0x1f, 0x0001); //w 31 2 0 1
- mdio_write(ioaddr, 0x15, 0x1000); //w 21 15 0 1000
- mdio_write(ioaddr, 0x18, 0x65c7); //w 24 15 0 65c7
- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
+ { 0x1f, 0x0001 },
+ { 0x03, 0x00a1 },
+ { 0x02, 0x0008 },
+ { 0x01, 0x0120 },
+ { 0x00, 0x1000 },
+ { 0x04, 0x0800 },
+ { 0x04, 0x0000 },
- for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) {
- int val, pos = 4;
+ { 0x03, 0xff41 },
+ { 0x02, 0xdf60 },
+ { 0x01, 0x0140 },
+ { 0x00, 0x0077 },
+ { 0x04, 0x7800 },
+ { 0x04, 0x7000 },
- val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff);
- mdio_write(ioaddr, pos, val);
- while (--pos >= 0)
- mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff);
- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1
- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
- }
- mdio_write(ioaddr, 0x1f, 0x0000); //w 31 2 0 0
+ { 0x03, 0x802f },
+ { 0x02, 0x4f02 },
+ { 0x01, 0x0409 },
+ { 0x00, 0xf0f9 },
+ { 0x04, 0x9800 },
+ { 0x04, 0x9000 },
+
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0xff95 },
+ { 0x00, 0xba00 },
+ { 0x04, 0xa800 },
+ { 0x04, 0xa000 },
+
+ { 0x03, 0xff41 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0x0140 },
+ { 0x00, 0x00bb },
+ { 0x04, 0xb800 },
+ { 0x04, 0xb000 },
+
+ { 0x03, 0xdf41 },
+ { 0x02, 0xdc60 },
+ { 0x01, 0x6340 },
+ { 0x00, 0x007d },
+ { 0x04, 0xd800 },
+ { 0x04, 0xd000 },
+
+ { 0x03, 0xdf01 },
+ { 0x02, 0xdf20 },
+ { 0x01, 0x100a },
+ { 0x00, 0xa0ff },
+ { 0x04, 0xf800 },
+ { 0x04, 0xf000 },
+
+ { 0x1f, 0x0000 },
+ { 0x0b, 0x0000 },
+ { 0x00, 0x9200 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH net-next 6/6] r8169: phy init for the 8102e
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
` (4 preceding siblings ...)
2009-08-11 5:44 ` [PATCH net-next 5/6] r8169: phy init for the 8169s Francois Romieu
@ 2009-08-11 5:45 ` Francois Romieu
2009-08-13 5:17 ` [PATCH net-next 0/6] r8169 updates David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Francois Romieu @ 2009-08-11 5:45 UTC (permalink / raw)
To: David S. Miller; +Cc: edward_hsu, netdev
Synced with Realtek's 1.013.00 r8101 driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 93a87aa..8cd8530 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1729,6 +1729,7 @@ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
mdio_write(ioaddr, 0x1f, 0x0000);
mdio_patch(ioaddr, 0x11, 1 << 12);
mdio_patch(ioaddr, 0x19, 1 << 13);
+ mdio_patch(ioaddr, 0x10, 1 << 15);
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next 0/6] r8169 updates
2009-08-11 5:40 [PATCH net-next 0/6] r8169 updates Francois Romieu
` (5 preceding siblings ...)
2009-08-11 5:45 ` [PATCH net-next 6/6] r8169: phy init for the 8102e Francois Romieu
@ 2009-08-13 5:17 ` David Miller
6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-08-13 5:17 UTC (permalink / raw)
To: romieu; +Cc: edward_hsu, netdev
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 11 Aug 2009 07:40:39 +0200
> Hi,
>
> this series contains a minor fix (#1), an helper update (#2) as well as
> a set of phy related changes taken from Realtek's own driver (#3 .. #6).
All applied, thanks a lot Francois!
^ permalink raw reply [flat|nested] 8+ messages in thread