diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-15 21:46:25 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-15 21:46:25 -0400 |
| commit | 0e402c6ec4f32a9192a30c4a5b5ba6867c0be7bc (patch) | |
| tree | 2edb86443cc241585aab2c789e2c1c2d711363b5 /drivers/net/ucc_geth.c | |
| parent | 28aa483f80d146a8f117eb65a4fddf31d58230d7 (diff) | |
| parent | 4e19b5c193454ade8d86468077078f680d121979 (diff) | |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
ucc_geth: eliminate max-speed, change interface-type to phy-connection-type
smc911x: fix compilation breakage
pasemi_mac: Fix local-mac-address parsing
pasemi_mac: Terminate PCI ID list
pasemi_mac: Interrupt ack fixes
pasemi_mac: Fix register defines
Diffstat (limited to 'drivers/net/ucc_geth.c')
| -rw-r--r-- | drivers/net/ucc_geth.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 0f667652fda9..c2ccbd098f53 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. | 2 | * Copyright (C) 2006-2007 Freescale Semicondutor, Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * Author: Shlomi Gridish <gridish@freescale.com> | 4 | * Author: Shlomi Gridish <gridish@freescale.com> |
| 5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
| @@ -3737,21 +3737,21 @@ static int ucc_geth_close(struct net_device *dev) | |||
| 3737 | 3737 | ||
| 3738 | const struct ethtool_ops ucc_geth_ethtool_ops = { }; | 3738 | const struct ethtool_ops ucc_geth_ethtool_ops = { }; |
| 3739 | 3739 | ||
| 3740 | static phy_interface_t to_phy_interface(const char *interface_type) | 3740 | static phy_interface_t to_phy_interface(const char *phy_connection_type) |
| 3741 | { | 3741 | { |
| 3742 | if (strcasecmp(interface_type, "mii") == 0) | 3742 | if (strcasecmp(phy_connection_type, "mii") == 0) |
| 3743 | return PHY_INTERFACE_MODE_MII; | 3743 | return PHY_INTERFACE_MODE_MII; |
| 3744 | if (strcasecmp(interface_type, "gmii") == 0) | 3744 | if (strcasecmp(phy_connection_type, "gmii") == 0) |
| 3745 | return PHY_INTERFACE_MODE_GMII; | 3745 | return PHY_INTERFACE_MODE_GMII; |
| 3746 | if (strcasecmp(interface_type, "tbi") == 0) | 3746 | if (strcasecmp(phy_connection_type, "tbi") == 0) |
| 3747 | return PHY_INTERFACE_MODE_TBI; | 3747 | return PHY_INTERFACE_MODE_TBI; |
| 3748 | if (strcasecmp(interface_type, "rmii") == 0) | 3748 | if (strcasecmp(phy_connection_type, "rmii") == 0) |
| 3749 | return PHY_INTERFACE_MODE_RMII; | 3749 | return PHY_INTERFACE_MODE_RMII; |
| 3750 | if (strcasecmp(interface_type, "rgmii") == 0) | 3750 | if (strcasecmp(phy_connection_type, "rgmii") == 0) |
| 3751 | return PHY_INTERFACE_MODE_RGMII; | 3751 | return PHY_INTERFACE_MODE_RGMII; |
| 3752 | if (strcasecmp(interface_type, "rgmii-id") == 0) | 3752 | if (strcasecmp(phy_connection_type, "rgmii-id") == 0) |
| 3753 | return PHY_INTERFACE_MODE_RGMII_ID; | 3753 | return PHY_INTERFACE_MODE_RGMII_ID; |
| 3754 | if (strcasecmp(interface_type, "rtbi") == 0) | 3754 | if (strcasecmp(phy_connection_type, "rtbi") == 0) |
| 3755 | return PHY_INTERFACE_MODE_RTBI; | 3755 | return PHY_INTERFACE_MODE_RTBI; |
| 3756 | 3756 | ||
| 3757 | return PHY_INTERFACE_MODE_MII; | 3757 | return PHY_INTERFACE_MODE_MII; |
| @@ -3819,29 +3819,21 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
| 3819 | ug_info->phy_address = *prop; | 3819 | ug_info->phy_address = *prop; |
| 3820 | 3820 | ||
| 3821 | /* get the phy interface type, or default to MII */ | 3821 | /* get the phy interface type, or default to MII */ |
| 3822 | prop = of_get_property(np, "interface-type", NULL); | 3822 | prop = of_get_property(np, "phy-connection-type", NULL); |
| 3823 | if (!prop) { | 3823 | if (!prop) { |
| 3824 | /* handle interface property present in old trees */ | 3824 | /* handle interface property present in old trees */ |
| 3825 | prop = of_get_property(phy, "interface", NULL); | 3825 | prop = of_get_property(phy, "interface", NULL); |
| 3826 | if (prop != NULL) | 3826 | if (prop != NULL) { |
| 3827 | phy_interface = enet_to_phy_interface[*prop]; | 3827 | phy_interface = enet_to_phy_interface[*prop]; |
| 3828 | else | 3828 | max_speed = enet_to_speed[*prop]; |
| 3829 | } else | ||
| 3829 | phy_interface = PHY_INTERFACE_MODE_MII; | 3830 | phy_interface = PHY_INTERFACE_MODE_MII; |
| 3830 | } else { | 3831 | } else { |
| 3831 | phy_interface = to_phy_interface((const char *)prop); | 3832 | phy_interface = to_phy_interface((const char *)prop); |
| 3832 | } | 3833 | } |
| 3833 | 3834 | ||
| 3834 | /* get speed, or derive from interface */ | 3835 | /* get speed, or derive from PHY interface */ |
| 3835 | prop = of_get_property(np, "max-speed", NULL); | 3836 | if (max_speed == 0) |
| 3836 | if (!prop) { | ||
| 3837 | /* handle interface property present in old trees */ | ||
| 3838 | prop = of_get_property(phy, "interface", NULL); | ||
| 3839 | if (prop != NULL) | ||
| 3840 | max_speed = enet_to_speed[*prop]; | ||
| 3841 | } else { | ||
| 3842 | max_speed = *prop; | ||
| 3843 | } | ||
| 3844 | if (!max_speed) { | ||
| 3845 | switch (phy_interface) { | 3837 | switch (phy_interface) { |
| 3846 | case PHY_INTERFACE_MODE_GMII: | 3838 | case PHY_INTERFACE_MODE_GMII: |
| 3847 | case PHY_INTERFACE_MODE_RGMII: | 3839 | case PHY_INTERFACE_MODE_RGMII: |
| @@ -3854,9 +3846,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
| 3854 | max_speed = SPEED_100; | 3846 | max_speed = SPEED_100; |
| 3855 | break; | 3847 | break; |
| 3856 | } | 3848 | } |
| 3857 | } | ||
| 3858 | 3849 | ||
| 3859 | if (max_speed == SPEED_1000) { | 3850 | if (max_speed == SPEED_1000) { |
| 3851 | /* configure muram FIFOs for gigabit operation */ | ||
| 3860 | ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; | 3852 | ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; |
| 3861 | ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; | 3853 | ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; |
| 3862 | ug_info->uf_info.urfset = UCC_GETH_URFSET_GIGA_INIT; | 3854 | ug_info->uf_info.urfset = UCC_GETH_URFSET_GIGA_INIT; |
