diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2007-05-11 19:25:07 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-15 17:44:40 -0400 |
commit | 4e19b5c193454ade8d86468077078f680d121979 (patch) | |
tree | e7550524011f27cf8e13a0aefd65603f3d78c428 /drivers | |
parent | f2773a29596d835d2b00137ba925c186699ea117 (diff) |
ucc_geth: eliminate max-speed, change interface-type to phy-connection-type
It was agreed that phy-connection-type was a better name for
the interface-type property, so this patch renames it.
Also, the max-speed property name was determined too generic,
and is therefore eliminated in favour of phy-connection-type
derivation logic.
includes corrections to copyright text.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ucc_geth.c | 40 | ||||
-rw-r--r-- | drivers/net/ucc_geth_mii.c | 9 | ||||
-rw-r--r-- | drivers/net/ucc_geth_mii.h | 10 |
3 files changed, 26 insertions, 33 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; |
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c index 27a1ef3b7b06..f96966d4bcc2 100644 --- a/drivers/net/ucc_geth_mii.c +++ b/drivers/net/ucc_geth_mii.c | |||
@@ -1,12 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/net/ucc_geth_mii.c | 2 | * drivers/net/ucc_geth_mii.c |
3 | * | 3 | * |
4 | * Gianfar Ethernet Driver -- MIIM bus implementation | 4 | * QE UCC Gigabit Ethernet Driver -- MII Management Bus Implementation |
5 | * Provides Bus interface for MIIM regs | 5 | * Provides Bus interface for MII Management regs in the UCC register space |
6 | * | 6 | * |
7 | * Author: Li Yang | 7 | * Copyright (C) 2007 Freescale Semiconductor, Inc. |
8 | * | 8 | * |
9 | * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. | 9 | * Authors: Li Yang <leoli@freescale.com> |
10 | * Kim Phillips <kim.phillips@freescale.com> | ||
10 | * | 11 | * |
11 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
12 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |
diff --git a/drivers/net/ucc_geth_mii.h b/drivers/net/ucc_geth_mii.h index 98430fe0bfc6..d83437039919 100644 --- a/drivers/net/ucc_geth_mii.h +++ b/drivers/net/ucc_geth_mii.h | |||
@@ -1,13 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/net/ucc_geth_mii.h | 2 | * drivers/net/ucc_geth_mii.h |
3 | * | 3 | * |
4 | * Gianfar Ethernet Driver -- MII Management Bus Implementation | 4 | * QE UCC Gigabit Ethernet Driver -- MII Management Bus Implementation |
5 | * Driver for the MDIO bus controller in the Gianfar register space | 5 | * Provides Bus interface for MII Management regs in the UCC register space |
6 | * | 6 | * |
7 | * Author: Andy Fleming | 7 | * Copyright (C) 2007 Freescale Semiconductor, Inc. |
8 | * Maintainer: Kumar Gala | ||
9 | * | 8 | * |
10 | * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. | 9 | * Authors: Li Yang <leoli@freescale.com> |
10 | * Kim Phillips <kim.phillips@freescale.com> | ||
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |