Permalink
Browse files

add patch for zynq_gem.c for Gem1 in 1000base-x mode

For Xapp1082 ps emio mode, gem0 uses MIO and RGMII, gem1 uses PL 1000Base-x.
With this modification, Gem1 can ping and tftp.
Gem0 still works.
  • Loading branch information...
imrickysu committed Feb 24, 2016
1 parent 4942ae4 commit ea72a0b1eb02cff060c4ea85b73d5a74479efd50
Showing with 10 additions and 1 deletion.
  1. +10 −1 drivers/net/zynq_gem.c
@@ -311,6 +311,7 @@ static int zynq_gem_setup_mac(struct eth_device *dev)
static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
{
u32 i;
u16 phyreg;
unsigned long __maybe_unused clk_rate = 0;
struct phy_device *phydev;
struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
@@ -388,12 +389,20 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
priv->init++;
}

phy_detection(dev);
if (!priv->emio)
phy_detection(dev);

/* interface - look at tsec */
phydev = phy_connect(priv->bus, priv->phyaddr, dev,
priv->interface);

/* Set Isolate bit for normal operation i.e Electrically Isolate
PHY from GMII incase of 1000BASE-X Phy */
if (priv->emio) {
phyread(dev, priv->phyaddr, MII_BMCR, &phyreg);
phywrite(dev, priv->phyaddr, 0, (phyreg & 0xFBFF));
}

phydev->supported = supported | ADVERTISED_Pause |
ADVERTISED_Asym_Pause;
phydev->advertising = phydev->supported;

0 comments on commit ea72a0b

Please sign in to comment.