diff options
author | Tom Rini <trini@ti.com> | 2015-01-22 20:04:17 -0500 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2015-01-22 20:04:17 -0500 |
commit | ec0cc98f2cb7fa217ed0a1a54978e2d8f2fbc20c (patch) | |
tree | 6bfa9a96dcad59fc12f8825cfaf99c09680075f5 /drivers/net/fm | |
parent | 032c6867a2925c95897afe07d1f0678114254cf6 (diff) | |
parent | db4a1767c09a4696792204d1cac33631cb38424e (diff) | |
download | u-boot-imx-ec0cc98f2cb7fa217ed0a1a54978e2d8f2fbc20c.zip u-boot-imx-ec0cc98f2cb7fa217ed0a1a54978e2d8f2fbc20c.tar.gz u-boot-imx-ec0cc98f2cb7fa217ed0a1a54978e2d8f2fbc20c.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Diffstat (limited to 'drivers/net/fm')
-rw-r--r-- | drivers/net/fm/eth.c | 30 | ||||
-rw-r--r-- | drivers/net/fm/t1040.c | 3 |
2 files changed, 20 insertions, 13 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index f1e39b9..1d1089d 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -410,10 +410,15 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd) fmc_tx_port_graceful_stop_disable(fm_eth); #ifdef CONFIG_PHYLIB - ret = phy_startup(fm_eth->phydev); - if (ret) { - printf("%s: Could not initialize\n", fm_eth->phydev->dev->name); - return ret; + if (fm_eth->phydev) { + ret = phy_startup(fm_eth->phydev); + if (ret) { + printf("%s: Could not initialize\n", + fm_eth->phydev->dev->name); + return ret; + } + } else { + return 0; } #else fm_eth->phydev->speed = SPEED_1000; @@ -447,7 +452,8 @@ static void fm_eth_halt(struct eth_device *dev) /* disable bmi Rx port */ bmi_rx_port_disable(fm_eth->rx_port); - phy_shutdown(fm_eth->phydev); + if (fm_eth->phydev) + phy_shutdown(fm_eth->phydev); } static int fm_eth_send(struct eth_device *dev, void *buf, int len) @@ -625,11 +631,12 @@ static int init_phy(struct eth_device *dev) if (fm_eth->bus) { phydev = phy_connect(fm_eth->bus, fm_eth->phyaddr, dev, fm_eth->enet_if); - } - - if (!phydev) { - printf("Failed to connect\n"); - return -1; + if (!phydev) { + printf("Failed to connect\n"); + return -1; + } + } else { + return 0; } if (fm_eth->type == FM_ETH_1G_E) { @@ -711,8 +718,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) if (!fm_eth_startup(fm_eth)) return 0; - if (init_phy(dev)) - return 0; + init_phy(dev); /* clear the ethernet address */ for (i = 0; i < 6; i++) diff --git a/drivers/net/fm/t1040.c b/drivers/net/fm/t1040.c index d2a097e..0458366 100644 --- a/drivers/net/fm/t1040.c +++ b/drivers/net/fm/t1040.c @@ -50,7 +50,8 @@ phy_interface_t fman_port_enet_if(enum fm_port port) switch (port) { case FM1_DTSEC1: case FM1_DTSEC2: - if (is_serdes_configured(QSGMII_SW1_A + port - FM1_DTSEC1)) + if (is_serdes_configured(QSGMII_SW1_A + port - FM1_DTSEC1) || + is_serdes_configured(SGMII_SW1_MAC1 + port - FM1_DTSEC1)) return PHY_INTERFACE_MODE_QSGMII; case FM1_DTSEC3: case FM1_DTSEC4: |