From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Fri, 29 Mar 2019 09:23:24 +0100 Subject: [U-Boot] [PATCH] drivers/net/phy: implement fallback mechanism for negative phy adresses In-Reply-To: <1553839391-22437-1-git-send-email-hannes.schmelzer@br-automation.com> References: <1553839391-22437-1-git-send-email-hannes.schmelzer@br-automation.com> Message-ID: <2a95708b-0ac9-b186-1226-7c89a0d68b8d@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Please fix subject net: phy: should be fine. On 29. 03. 19 7:03, Hannes Schmelzer wrote: > Negative phy-addresses can occour if the caller function was not able to > determine a valid phy address (from device-tree for example). In this > case we catch this here and search for ANY phy device on the given mdio- > bus. > > Signed-off-by: Hannes Schmelzer > > --- > > drivers/net/phy/phy.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 0c8b29d..916b525 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -922,13 +922,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, > #endif > { > struct phy_device *phydev = NULL; > + uint mask = (addr > 0) ? (0x1 << addr) : 0xffffffff; s/0x1/1/ > > #ifdef CONFIG_PHY_FIXED > phydev = phy_connect_fixed(bus, dev, interface); > #endif > > if (!phydev) > - phydev = phy_find_by_mask(bus, 1 << addr, interface); > + phydev = phy_find_by_mask(bus, mask, interface); > > if (phydev) > phy_connect_dev(phydev, dev); > When subject and that stuff above are fixed please add Tested-by: Michal Simek And then we can remove our code from zynq_gem (phy_dectection()). Thanks, Michal