diff options
Diffstat (limited to 'drivers/net/sungem_phy.c')
-rw-r--r-- | drivers/net/sungem_phy.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index cb0aba95d4e3..b2ddd5e79303 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c | |||
@@ -275,7 +275,7 @@ static int bcm5411_init(struct mii_phy* phy) | |||
275 | return 0; | 275 | return 0; |
276 | } | 276 | } |
277 | 277 | ||
278 | static int bcm5411_suspend(struct mii_phy* phy) | 278 | static int generic_suspend(struct mii_phy* phy) |
279 | { | 279 | { |
280 | phy_write(phy, MII_BMCR, BMCR_PDOWN); | 280 | phy_write(phy, MII_BMCR, BMCR_PDOWN); |
281 | 281 | ||
@@ -329,6 +329,30 @@ static int bcm5421_init(struct mii_phy* phy) | |||
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | static int bcm5421_enable_fiber(struct mii_phy* phy) | ||
333 | { | ||
334 | /* enable fiber mode */ | ||
335 | phy_write(phy, MII_NCONFIG, 0x9020); | ||
336 | /* LEDs active in both modes, autosense prio = fiber */ | ||
337 | phy_write(phy, MII_NCONFIG, 0x945f); | ||
338 | |||
339 | /* switch off fibre autoneg */ | ||
340 | phy_write(phy, MII_NCONFIG, 0xfc01); | ||
341 | phy_write(phy, 0x0b, 0x0004); | ||
342 | |||
343 | return 0; | ||
344 | } | ||
345 | |||
346 | static int bcm5461_enable_fiber(struct mii_phy* phy) | ||
347 | { | ||
348 | phy_write(phy, MII_NCONFIG, 0xfc0c); | ||
349 | phy_write(phy, MII_BMCR, 0x4140); | ||
350 | phy_write(phy, MII_NCONFIG, 0xfc0b); | ||
351 | phy_write(phy, MII_BMCR, 0x0140); | ||
352 | |||
353 | return 0; | ||
354 | } | ||
355 | |||
332 | static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) | 356 | static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) |
333 | { | 357 | { |
334 | u16 ctl, adv; | 358 | u16 ctl, adv; |
@@ -738,7 +762,7 @@ static struct mii_phy_def bcm5401_phy_def = { | |||
738 | /* Broadcom BCM 5411 */ | 762 | /* Broadcom BCM 5411 */ |
739 | static struct mii_phy_ops bcm5411_phy_ops = { | 763 | static struct mii_phy_ops bcm5411_phy_ops = { |
740 | .init = bcm5411_init, | 764 | .init = bcm5411_init, |
741 | .suspend = bcm5411_suspend, | 765 | .suspend = generic_suspend, |
742 | .setup_aneg = bcm54xx_setup_aneg, | 766 | .setup_aneg = bcm54xx_setup_aneg, |
743 | .setup_forced = bcm54xx_setup_forced, | 767 | .setup_forced = bcm54xx_setup_forced, |
744 | .poll_link = genmii_poll_link, | 768 | .poll_link = genmii_poll_link, |
@@ -757,11 +781,12 @@ static struct mii_phy_def bcm5411_phy_def = { | |||
757 | /* Broadcom BCM 5421 */ | 781 | /* Broadcom BCM 5421 */ |
758 | static struct mii_phy_ops bcm5421_phy_ops = { | 782 | static struct mii_phy_ops bcm5421_phy_ops = { |
759 | .init = bcm5421_init, | 783 | .init = bcm5421_init, |
760 | .suspend = bcm5411_suspend, | 784 | .suspend = generic_suspend, |
761 | .setup_aneg = bcm54xx_setup_aneg, | 785 | .setup_aneg = bcm54xx_setup_aneg, |
762 | .setup_forced = bcm54xx_setup_forced, | 786 | .setup_forced = bcm54xx_setup_forced, |
763 | .poll_link = genmii_poll_link, | 787 | .poll_link = genmii_poll_link, |
764 | .read_link = bcm54xx_read_link, | 788 | .read_link = bcm54xx_read_link, |
789 | .enable_fiber = bcm5421_enable_fiber, | ||
765 | }; | 790 | }; |
766 | 791 | ||
767 | static struct mii_phy_def bcm5421_phy_def = { | 792 | static struct mii_phy_def bcm5421_phy_def = { |
@@ -776,7 +801,7 @@ static struct mii_phy_def bcm5421_phy_def = { | |||
776 | /* Broadcom BCM 5421 built-in K2 */ | 801 | /* Broadcom BCM 5421 built-in K2 */ |
777 | static struct mii_phy_ops bcm5421k2_phy_ops = { | 802 | static struct mii_phy_ops bcm5421k2_phy_ops = { |
778 | .init = bcm5421_init, | 803 | .init = bcm5421_init, |
779 | .suspend = bcm5411_suspend, | 804 | .suspend = generic_suspend, |
780 | .setup_aneg = bcm54xx_setup_aneg, | 805 | .setup_aneg = bcm54xx_setup_aneg, |
781 | .setup_forced = bcm54xx_setup_forced, | 806 | .setup_forced = bcm54xx_setup_forced, |
782 | .poll_link = genmii_poll_link, | 807 | .poll_link = genmii_poll_link, |
@@ -792,10 +817,29 @@ static struct mii_phy_def bcm5421k2_phy_def = { | |||
792 | .ops = &bcm5421k2_phy_ops | 817 | .ops = &bcm5421k2_phy_ops |
793 | }; | 818 | }; |
794 | 819 | ||
820 | static struct mii_phy_ops bcm5461_phy_ops = { | ||
821 | .init = bcm5421_init, | ||
822 | .suspend = generic_suspend, | ||
823 | .setup_aneg = bcm54xx_setup_aneg, | ||
824 | .setup_forced = bcm54xx_setup_forced, | ||
825 | .poll_link = genmii_poll_link, | ||
826 | .read_link = bcm54xx_read_link, | ||
827 | .enable_fiber = bcm5461_enable_fiber, | ||
828 | }; | ||
829 | |||
830 | static struct mii_phy_def bcm5461_phy_def = { | ||
831 | .phy_id = 0x002060c0, | ||
832 | .phy_id_mask = 0xfffffff0, | ||
833 | .name = "BCM5461", | ||
834 | .features = MII_GBIT_FEATURES, | ||
835 | .magic_aneg = 1, | ||
836 | .ops = &bcm5461_phy_ops | ||
837 | }; | ||
838 | |||
795 | /* Broadcom BCM 5462 built-in Vesta */ | 839 | /* Broadcom BCM 5462 built-in Vesta */ |
796 | static struct mii_phy_ops bcm5462V_phy_ops = { | 840 | static struct mii_phy_ops bcm5462V_phy_ops = { |
797 | .init = bcm5421_init, | 841 | .init = bcm5421_init, |
798 | .suspend = bcm5411_suspend, | 842 | .suspend = generic_suspend, |
799 | .setup_aneg = bcm54xx_setup_aneg, | 843 | .setup_aneg = bcm54xx_setup_aneg, |
800 | .setup_forced = bcm54xx_setup_forced, | 844 | .setup_forced = bcm54xx_setup_forced, |
801 | .poll_link = genmii_poll_link, | 845 | .poll_link = genmii_poll_link, |
@@ -816,6 +860,7 @@ static struct mii_phy_def bcm5462V_phy_def = { | |||
816 | * would be useful here) --BenH. | 860 | * would be useful here) --BenH. |
817 | */ | 861 | */ |
818 | static struct mii_phy_ops marvell_phy_ops = { | 862 | static struct mii_phy_ops marvell_phy_ops = { |
863 | .suspend = generic_suspend, | ||
819 | .setup_aneg = marvell_setup_aneg, | 864 | .setup_aneg = marvell_setup_aneg, |
820 | .setup_forced = marvell_setup_forced, | 865 | .setup_forced = marvell_setup_forced, |
821 | .poll_link = genmii_poll_link, | 866 | .poll_link = genmii_poll_link, |
@@ -856,6 +901,7 @@ static struct mii_phy_def* mii_phy_table[] = { | |||
856 | &bcm5411_phy_def, | 901 | &bcm5411_phy_def, |
857 | &bcm5421_phy_def, | 902 | &bcm5421_phy_def, |
858 | &bcm5421k2_phy_def, | 903 | &bcm5421k2_phy_def, |
904 | &bcm5461_phy_def, | ||
859 | &bcm5462V_phy_def, | 905 | &bcm5462V_phy_def, |
860 | &marvell_phy_def, | 906 | &marvell_phy_def, |
861 | &genmii_phy_def, | 907 | &genmii_phy_def, |