aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/marvell.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/marvell.c')
-rw-r--r--drivers/net/phy/marvell.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 721a090a01bc..0101f2bdf400 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -29,6 +29,7 @@
29#include <linux/mii.h> 29#include <linux/mii.h>
30#include <linux/ethtool.h> 30#include <linux/ethtool.h>
31#include <linux/phy.h> 31#include <linux/phy.h>
32#include <linux/marvell_phy.h>
32 33
33#include <asm/io.h> 34#include <asm/io.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
@@ -48,8 +49,6 @@
48#define MII_M1145_RGMII_RX_DELAY 0x0080 49#define MII_M1145_RGMII_RX_DELAY 0x0080
49#define MII_M1145_RGMII_TX_DELAY 0x0002 50#define MII_M1145_RGMII_TX_DELAY 0x0002
50 51
51#define M1145_DEV_FLAGS_RESISTANCE 0x00000001
52
53#define MII_M1111_PHY_LED_CONTROL 0x18 52#define MII_M1111_PHY_LED_CONTROL 0x18
54#define MII_M1111_PHY_LED_DIRECT 0x4100 53#define MII_M1111_PHY_LED_DIRECT 0x4100
55#define MII_M1111_PHY_LED_COMBINE 0x411c 54#define MII_M1111_PHY_LED_COMBINE 0x411c
@@ -407,7 +406,10 @@ static int m88e1118_config_init(struct phy_device *phydev)
407 return err; 406 return err;
408 407
409 /* Adjust LED Control */ 408 /* Adjust LED Control */
410 err = phy_write(phydev, 0x10, 0x021e); 409 if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS)
410 err = phy_write(phydev, 0x10, 0x1100);
411 else
412 err = phy_write(phydev, 0x10, 0x021e);
411 if (err < 0) 413 if (err < 0)
412 return err; 414 return err;
413 415
@@ -455,7 +457,7 @@ static int m88e1145_config_init(struct phy_device *phydev)
455 if (err < 0) 457 if (err < 0)
456 return err; 458 return err;
457 459
458 if (phydev->dev_flags & M1145_DEV_FLAGS_RESISTANCE) { 460 if (phydev->dev_flags & MARVELL_PHY_M1145_FLAGS_RESISTANCE) {
459 err = phy_write(phydev, 0x1d, 0x0012); 461 err = phy_write(phydev, 0x1d, 0x0012);
460 if (err < 0) 462 if (err < 0)
461 return err; 463 return err;
@@ -586,8 +588,8 @@ static int m88e1121_did_interrupt(struct phy_device *phydev)
586 588
587static struct phy_driver marvell_drivers[] = { 589static struct phy_driver marvell_drivers[] = {
588 { 590 {
589 .phy_id = 0x01410c60, 591 .phy_id = MARVELL_PHY_ID_88E1101,
590 .phy_id_mask = 0xfffffff0, 592 .phy_id_mask = MARVELL_PHY_ID_MASK,
591 .name = "Marvell 88E1101", 593 .name = "Marvell 88E1101",
592 .features = PHY_GBIT_FEATURES, 594 .features = PHY_GBIT_FEATURES,
593 .flags = PHY_HAS_INTERRUPT, 595 .flags = PHY_HAS_INTERRUPT,
@@ -598,8 +600,8 @@ static struct phy_driver marvell_drivers[] = {
598 .driver = { .owner = THIS_MODULE }, 600 .driver = { .owner = THIS_MODULE },
599 }, 601 },
600 { 602 {
601 .phy_id = 0x01410c90, 603 .phy_id = MARVELL_PHY_ID_88E1112,
602 .phy_id_mask = 0xfffffff0, 604 .phy_id_mask = MARVELL_PHY_ID_MASK,
603 .name = "Marvell 88E1112", 605 .name = "Marvell 88E1112",
604 .features = PHY_GBIT_FEATURES, 606 .features = PHY_GBIT_FEATURES,
605 .flags = PHY_HAS_INTERRUPT, 607 .flags = PHY_HAS_INTERRUPT,
@@ -611,8 +613,8 @@ static struct phy_driver marvell_drivers[] = {
611 .driver = { .owner = THIS_MODULE }, 613 .driver = { .owner = THIS_MODULE },
612 }, 614 },
613 { 615 {
614 .phy_id = 0x01410cc0, 616 .phy_id = MARVELL_PHY_ID_88E1111,
615 .phy_id_mask = 0xfffffff0, 617 .phy_id_mask = MARVELL_PHY_ID_MASK,
616 .name = "Marvell 88E1111", 618 .name = "Marvell 88E1111",
617 .features = PHY_GBIT_FEATURES, 619 .features = PHY_GBIT_FEATURES,
618 .flags = PHY_HAS_INTERRUPT, 620 .flags = PHY_HAS_INTERRUPT,
@@ -624,8 +626,8 @@ static struct phy_driver marvell_drivers[] = {
624 .driver = { .owner = THIS_MODULE }, 626 .driver = { .owner = THIS_MODULE },
625 }, 627 },
626 { 628 {
627 .phy_id = 0x01410e10, 629 .phy_id = MARVELL_PHY_ID_88E1118,
628 .phy_id_mask = 0xfffffff0, 630 .phy_id_mask = MARVELL_PHY_ID_MASK,
629 .name = "Marvell 88E1118", 631 .name = "Marvell 88E1118",
630 .features = PHY_GBIT_FEATURES, 632 .features = PHY_GBIT_FEATURES,
631 .flags = PHY_HAS_INTERRUPT, 633 .flags = PHY_HAS_INTERRUPT,
@@ -637,8 +639,8 @@ static struct phy_driver marvell_drivers[] = {
637 .driver = {.owner = THIS_MODULE,}, 639 .driver = {.owner = THIS_MODULE,},
638 }, 640 },
639 { 641 {
640 .phy_id = 0x01410cb0, 642 .phy_id = MARVELL_PHY_ID_88E1121R,
641 .phy_id_mask = 0xfffffff0, 643 .phy_id_mask = MARVELL_PHY_ID_MASK,
642 .name = "Marvell 88E1121R", 644 .name = "Marvell 88E1121R",
643 .features = PHY_GBIT_FEATURES, 645 .features = PHY_GBIT_FEATURES,
644 .flags = PHY_HAS_INTERRUPT, 646 .flags = PHY_HAS_INTERRUPT,
@@ -650,8 +652,8 @@ static struct phy_driver marvell_drivers[] = {
650 .driver = { .owner = THIS_MODULE }, 652 .driver = { .owner = THIS_MODULE },
651 }, 653 },
652 { 654 {
653 .phy_id = 0x01410e90, 655 .phy_id = MARVELL_PHY_ID_88EC048,
654 .phy_id_mask = 0xfffffff0, 656 .phy_id_mask = MARVELL_PHY_ID_MASK,
655 .name = "Marvell 88EC048", 657 .name = "Marvell 88EC048",
656 .features = PHY_GBIT_FEATURES, 658 .features = PHY_GBIT_FEATURES,
657 .flags = PHY_HAS_INTERRUPT, 659 .flags = PHY_HAS_INTERRUPT,
@@ -663,8 +665,8 @@ static struct phy_driver marvell_drivers[] = {
663 .driver = { .owner = THIS_MODULE }, 665 .driver = { .owner = THIS_MODULE },
664 }, 666 },
665 { 667 {
666 .phy_id = 0x01410cd0, 668 .phy_id = MARVELL_PHY_ID_88E1145,
667 .phy_id_mask = 0xfffffff0, 669 .phy_id_mask = MARVELL_PHY_ID_MASK,
668 .name = "Marvell 88E1145", 670 .name = "Marvell 88E1145",
669 .features = PHY_GBIT_FEATURES, 671 .features = PHY_GBIT_FEATURES,
670 .flags = PHY_HAS_INTERRUPT, 672 .flags = PHY_HAS_INTERRUPT,
@@ -676,8 +678,8 @@ static struct phy_driver marvell_drivers[] = {
676 .driver = { .owner = THIS_MODULE }, 678 .driver = { .owner = THIS_MODULE },
677 }, 679 },
678 { 680 {
679 .phy_id = 0x01410e30, 681 .phy_id = MARVELL_PHY_ID_88E1240,
680 .phy_id_mask = 0xfffffff0, 682 .phy_id_mask = MARVELL_PHY_ID_MASK,
681 .name = "Marvell 88E1240", 683 .name = "Marvell 88E1240",
682 .features = PHY_GBIT_FEATURES, 684 .features = PHY_GBIT_FEATURES,
683 .flags = PHY_HAS_INTERRUPT, 685 .flags = PHY_HAS_INTERRUPT,