diff options
-rw-r--r-- | drivers/net/r8169.c | 68 | ||||
-rw-r--r-- | 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 86722886ae47..4470fefbe97e 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1389,6 +1389,71 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) | |||
1389 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | 1389 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp, | ||
1393 | void __iomem *ioaddr) | ||
1394 | { | ||
1395 | struct pci_dev *pdev = tp->pci_dev; | ||
1396 | u16 vendor_id, device_id; | ||
1397 | |||
1398 | pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor_id); | ||
1399 | pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &device_id); | ||
1400 | |||
1401 | if ((vendor_id != PCI_VENDOR_ID_GIGABYTE) || (device_id != 0xe000)) | ||
1402 | return; | ||
1403 | |||
1404 | mdio_write(ioaddr, 0x1f, 0x0001); | ||
1405 | mdio_write(ioaddr, 0x10, 0xf01b); | ||
1406 | mdio_write(ioaddr, 0x1f, 0x0000); | ||
1407 | } | ||
1408 | |||
1409 | static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp, | ||
1410 | void __iomem *ioaddr) | ||
1411 | { | ||
1412 | struct phy_reg phy_reg_init[] = { | ||
1413 | { 0x1f, 0x0001 }, | ||
1414 | { 0x04, 0x0000 }, | ||
1415 | { 0x03, 0x00a1 }, | ||
1416 | { 0x02, 0x0008 }, | ||
1417 | { 0x01, 0x0120 }, | ||
1418 | { 0x00, 0x1000 }, | ||
1419 | { 0x04, 0x0800 }, | ||
1420 | { 0x04, 0x9000 }, | ||
1421 | { 0x03, 0x802f }, | ||
1422 | { 0x02, 0x4f02 }, | ||
1423 | { 0x01, 0x0409 }, | ||
1424 | { 0x00, 0xf099 }, | ||
1425 | { 0x04, 0x9800 }, | ||
1426 | { 0x04, 0xa000 }, | ||
1427 | { 0x03, 0xdf01 }, | ||
1428 | { 0x02, 0xdf20 }, | ||
1429 | { 0x01, 0xff95 }, | ||
1430 | { 0x00, 0xba00 }, | ||
1431 | { 0x04, 0xa800 }, | ||
1432 | { 0x04, 0xf000 }, | ||
1433 | { 0x03, 0xdf01 }, | ||
1434 | { 0x02, 0xdf20 }, | ||
1435 | { 0x01, 0x101a }, | ||
1436 | { 0x00, 0xa0ff }, | ||
1437 | { 0x04, 0xf800 }, | ||
1438 | { 0x04, 0x0000 }, | ||
1439 | { 0x1f, 0x0000 }, | ||
1440 | |||
1441 | { 0x1f, 0x0001 }, | ||
1442 | { 0x10, 0xf41b }, | ||
1443 | { 0x14, 0xfb54 }, | ||
1444 | { 0x18, 0xf5c7 }, | ||
1445 | { 0x1f, 0x0000 }, | ||
1446 | |||
1447 | { 0x1f, 0x0001 }, | ||
1448 | { 0x17, 0x0cc0 }, | ||
1449 | { 0x1f, 0x0000 } | ||
1450 | }; | ||
1451 | |||
1452 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | ||
1453 | |||
1454 | rtl8169scd_hw_phy_config_quirk(tp, ioaddr); | ||
1455 | } | ||
1456 | |||
1392 | static void rtl8169sce_hw_phy_config(void __iomem *ioaddr) | 1457 | static void rtl8169sce_hw_phy_config(void __iomem *ioaddr) |
1393 | { | 1458 | { |
1394 | struct phy_reg phy_reg_init[] = { | 1459 | struct phy_reg phy_reg_init[] = { |
@@ -1681,6 +1746,9 @@ static void rtl_hw_phy_config(struct net_device *dev) | |||
1681 | case RTL_GIGA_MAC_VER_04: | 1746 | case RTL_GIGA_MAC_VER_04: |
1682 | rtl8169sb_hw_phy_config(ioaddr); | 1747 | rtl8169sb_hw_phy_config(ioaddr); |
1683 | break; | 1748 | break; |
1749 | case RTL_GIGA_MAC_VER_05: | ||
1750 | rtl8169scd_hw_phy_config(tp, ioaddr); | ||
1751 | break; | ||
1684 | case RTL_GIGA_MAC_VER_06: | 1752 | case RTL_GIGA_MAC_VER_06: |
1685 | rtl8169sce_hw_phy_config(ioaddr); | 1753 | rtl8169sce_hw_phy_config(ioaddr); |
1686 | break; | 1754 | break; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 73b46b6b904f..fdc3110c90c0 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1984,6 +1984,8 @@ | |||
1984 | 1984 | ||
1985 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 1985 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
1986 | 1986 | ||
1987 | #define PCI_VENDOR_ID_GIGABYTE 0x1458 | ||
1988 | |||
1987 | #define PCI_VENDOR_ID_AMBIT 0x1468 | 1989 | #define PCI_VENDOR_ID_AMBIT 0x1468 |
1988 | 1990 | ||
1989 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 1991 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |