diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2011-03-07 16:59:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-14 17:10:15 -0400 |
commit | e47c90523484518aac30498150e427d824ace705 (patch) | |
tree | 04a57da9305eca9a5202fd5f16627930b922e4a1 | |
parent | c5ed53687b39c195b4730de8c0355c1b78054ba6 (diff) |
net: sh_eth: modify the PHY_INTERFACE_MODE
The previous code had hardcoded the PHY_INTERFACE_MODE_MII of phy_connect.
So some Gigabit PHYs will not behave correctly.
The patch adds the phy_interface in sh_eth_plat_data, so we can select
the phy interface.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sh/include/asm/sh_eth.h | 3 | ||||
-rw-r--r-- | drivers/net/sh_eth.c | 3 | ||||
-rw-r--r-- | drivers/net/sh_eth.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h index 155769601065..e86c880b7e4c 100644 --- a/arch/sh/include/asm/sh_eth.h +++ b/arch/sh/include/asm/sh_eth.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_SH_ETH_H__ | 1 | #ifndef __ASM_SH_ETH_H__ |
2 | #define __ASM_SH_ETH_H__ | 2 | #define __ASM_SH_ETH_H__ |
3 | 3 | ||
4 | #include <linux/phy.h> | ||
5 | |||
4 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; | 6 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; |
5 | enum { | 7 | enum { |
6 | SH_ETH_REG_GIGABIT, | 8 | SH_ETH_REG_GIGABIT, |
@@ -12,6 +14,7 @@ struct sh_eth_plat_data { | |||
12 | int phy; | 14 | int phy; |
13 | int edmac_endian; | 15 | int edmac_endian; |
14 | int register_type; | 16 | int register_type; |
17 | phy_interface_t phy_interface; | ||
15 | 18 | ||
16 | unsigned char mac_addr[6]; | 19 | unsigned char mac_addr[6]; |
17 | unsigned no_ether_link:1; | 20 | unsigned no_ether_link:1; |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 6734311e56e4..5d28ce68f357 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -1071,7 +1071,7 @@ static int sh_eth_phy_init(struct net_device *ndev) | |||
1071 | 1071 | ||
1072 | /* Try connect to PHY */ | 1072 | /* Try connect to PHY */ |
1073 | phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link, | 1073 | phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link, |
1074 | 0, PHY_INTERFACE_MODE_MII); | 1074 | 0, mdp->phy_interface); |
1075 | if (IS_ERR(phydev)) { | 1075 | if (IS_ERR(phydev)) { |
1076 | dev_err(&ndev->dev, "phy_connect failed\n"); | 1076 | dev_err(&ndev->dev, "phy_connect failed\n"); |
1077 | return PTR_ERR(phydev); | 1077 | return PTR_ERR(phydev); |
@@ -1669,6 +1669,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
1669 | pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data); | 1669 | pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data); |
1670 | /* get PHY ID */ | 1670 | /* get PHY ID */ |
1671 | mdp->phy_id = pd->phy; | 1671 | mdp->phy_id = pd->phy; |
1672 | mdp->phy_interface = pd->phy_interface; | ||
1672 | /* EDMAC endian */ | 1673 | /* EDMAC endian */ |
1673 | mdp->edmac_endian = pd->edmac_endian; | 1674 | mdp->edmac_endian = pd->edmac_endian; |
1674 | mdp->no_ether_link = pd->no_ether_link; | 1675 | mdp->no_ether_link = pd->no_ether_link; |
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index b349c5e2bcda..c3048a6ba676 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h | |||
@@ -781,6 +781,7 @@ struct sh_eth_private { | |||
781 | struct mii_bus *mii_bus; /* MDIO bus control */ | 781 | struct mii_bus *mii_bus; /* MDIO bus control */ |
782 | struct phy_device *phydev; /* PHY device control */ | 782 | struct phy_device *phydev; /* PHY device control */ |
783 | enum phy_state link; | 783 | enum phy_state link; |
784 | phy_interface_t phy_interface; | ||
784 | int msg_enable; | 785 | int msg_enable; |
785 | int speed; | 786 | int speed; |
786 | int duplex; | 787 | int duplex; |