From: Siva Durga Prasad Paladugu Date: Tue, 31 Jan 2017 10:01:17 +0000 (+0530) Subject: net: zynq_gem: Dont enable SGMII and PCS selection X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f711a088a1482f9f29bc51d895d76accd5fb14d;p=thirdparty%2Fu-boot.git net: zynq_gem: Dont enable SGMII and PCS selection Dont enable SGMII and PCS selection if internal PCS/PMA is not used, by getting the info about internal/external PCS/PMA usage from dt property "is-internal-phy". Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 2b9598af04f..1ef16c0a5cb 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -185,6 +185,7 @@ struct zynq_gem_priv { #ifdef CONFIG_CLK_ZYNQMP struct clk clk; #endif + bool int_pcs; }; static u32 phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, @@ -432,7 +433,12 @@ static int zynq_gem_init(struct udevice *dev) nwconfig = ZYNQ_GEM_NWCFG_INIT; - if (priv->interface == PHY_INTERFACE_MODE_SGMII) { + /* + * Set SGMII enable PCS selection only if internal PCS/PMA + * core is used and interface is SGMII. + */ + if (priv->interface == PHY_INTERFACE_MODE_SGMII && + priv->int_pcs) { nwconfig |= ZYNQ_GEM_NWCFG_SGMII_ENBL | ZYNQ_GEM_NWCFG_PCS_SEL; #ifdef CONFIG_ARM64 @@ -708,6 +714,8 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) priv->interface = pdata->phy_interface; priv->emio = fdtdec_get_bool(gd->fdt_blob, dev->of_offset, "xlnx,emio"); + priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, dev->of_offset, + "is-internal-pcspma"); printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv->iobase, priv->phyaddr, phy_string_for_interface(priv->interface));