Commit e47c9052 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by David S. Miller

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: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5ed5368
#ifndef __ASM_SH_ETH_H__ #ifndef __ASM_SH_ETH_H__
#define __ASM_SH_ETH_H__ #define __ASM_SH_ETH_H__
#include <linux/phy.h>
enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
enum { enum {
SH_ETH_REG_GIGABIT, SH_ETH_REG_GIGABIT,
...@@ -12,6 +14,7 @@ struct sh_eth_plat_data { ...@@ -12,6 +14,7 @@ struct sh_eth_plat_data {
int phy; int phy;
int edmac_endian; int edmac_endian;
int register_type; int register_type;
phy_interface_t phy_interface;
unsigned char mac_addr[6]; unsigned char mac_addr[6];
unsigned no_ether_link:1; unsigned no_ether_link:1;
......
...@@ -1071,7 +1071,7 @@ static int sh_eth_phy_init(struct net_device *ndev) ...@@ -1071,7 +1071,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
/* Try connect to PHY */ /* Try connect to PHY */
phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link, phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link,
0, PHY_INTERFACE_MODE_MII); 0, mdp->phy_interface);
if (IS_ERR(phydev)) { if (IS_ERR(phydev)) {
dev_err(&ndev->dev, "phy_connect failed\n"); dev_err(&ndev->dev, "phy_connect failed\n");
return PTR_ERR(phydev); return PTR_ERR(phydev);
...@@ -1669,6 +1669,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -1669,6 +1669,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data); pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data);
/* get PHY ID */ /* get PHY ID */
mdp->phy_id = pd->phy; mdp->phy_id = pd->phy;
mdp->phy_interface = pd->phy_interface;
/* EDMAC endian */ /* EDMAC endian */
mdp->edmac_endian = pd->edmac_endian; mdp->edmac_endian = pd->edmac_endian;
mdp->no_ether_link = pd->no_ether_link; mdp->no_ether_link = pd->no_ether_link;
......
...@@ -781,6 +781,7 @@ struct sh_eth_private { ...@@ -781,6 +781,7 @@ struct sh_eth_private {
struct mii_bus *mii_bus; /* MDIO bus control */ struct mii_bus *mii_bus; /* MDIO bus control */
struct phy_device *phydev; /* PHY device control */ struct phy_device *phydev; /* PHY device control */
enum phy_state link; enum phy_state link;
phy_interface_t phy_interface;
int msg_enable; int msg_enable;
int speed; int speed;
int duplex; int duplex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment