diff options
author | françois romieu <romieu@fr.zoreil.com> | 2009-08-10 15:44:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 01:13:22 -0400 |
commit | 2e955856ff1212bd63dbbf403940c72eca5b4a8f (patch) | |
tree | fdd07d09bfa445cff65317a61e3e51bb410e8624 /drivers/net/r8169.c | |
parent | 8c7006aa94bea415cd7f8c5fa8df9d3f261bd314 (diff) |
r8169: phy init for the 8169scd
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 68 |
1 files changed, 68 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; |