aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/ibm/emac/core.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 4989481c19f0..d300a0c0eafc 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -359,10 +359,26 @@ static int emac_reset(struct emac_instance *dev)
359 } 359 }
360 360
361#ifdef CONFIG_PPC_DCR_NATIVE 361#ifdef CONFIG_PPC_DCR_NATIVE
362 /* Enable internal clock source */ 362 /*
363 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) 363 * PPC460EX/GT Embedded Processor Advanced User's Manual
364 dcri_clrset(SDR0, SDR0_ETH_CFG, 364 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:
365 0, SDR0_ETH_CFG_ECS << dev->cell_index); 365 * Note: The PHY must provide a TX Clk in order to perform a soft reset
366 * of the EMAC. If none is present, select the internal clock
367 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
368 * After a soft reset, select the external clock.
369 */
370 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
371 if (dev->phy_address == 0xffffffff &&
372 dev->phy_map == 0xffffffff) {
373 /* No PHY: select internal loop clock before reset */
374 dcri_clrset(SDR0, SDR0_ETH_CFG,
375 0, SDR0_ETH_CFG_ECS << dev->cell_index);
376 } else {
377 /* PHY present: select external clock before reset */
378 dcri_clrset(SDR0, SDR0_ETH_CFG,
379 SDR0_ETH_CFG_ECS << dev->cell_index, 0);
380 }
381 }
366#endif 382#endif
367 383
368 out_be32(&p->mr0, EMAC_MR0_SRST); 384 out_be32(&p->mr0, EMAC_MR0_SRST);
@@ -370,10 +386,14 @@ static int emac_reset(struct emac_instance *dev)
370 --n; 386 --n;
371 387
372#ifdef CONFIG_PPC_DCR_NATIVE 388#ifdef CONFIG_PPC_DCR_NATIVE
373 /* Enable external clock source */ 389 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
374 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) 390 if (dev->phy_address == 0xffffffff &&
375 dcri_clrset(SDR0, SDR0_ETH_CFG, 391 dev->phy_map == 0xffffffff) {
376 SDR0_ETH_CFG_ECS << dev->cell_index, 0); 392 /* No PHY: restore external clock source after reset */
393 dcri_clrset(SDR0, SDR0_ETH_CFG,
394 SDR0_ETH_CFG_ECS << dev->cell_index, 0);
395 }
396 }
377#endif 397#endif
378 398
379 if (n) { 399 if (n) {