From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sun, 23 Oct 2011 21:41:36 +0200 Subject: [U-Boot] [PATCH] phy/marvell: Rewrite the MV88E1111 phy config function based on kernel code In-Reply-To: <1319178713-12472-2-git-send-email-tie-fei.zang@freescale.com> References: <1319178713-12472-1-git-send-email-tie-fei.zang@freescale.com> <1319178713-12472-2-git-send-email-tie-fei.zang@freescale.com> Message-ID: <20111023194136.750C71408771@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Roy Zang, In message <1319178713-12472-2-git-send-email-tie-fei.zang@freescale.com> you wrote: > The original m88e1111s_config() does not do the SGMII mode > initialization and is buggy. Rewrite the function according to > 3.0.6 kernel function m88e1111_config_init() in drivers/net/phy/marvell.c > > Signed-off-by: Roy Zang > Acked-by: Andy Fleming > Cc: Kumar Gala ... > + /* soft reset */ > + phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET); > + do > + reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); > + while (reg & BMCR_RESET); ... > + /* soft reset */ > + phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET); > + do > + reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); > + while (reg & BMCR_RESET); Do we really need this double reset? Also, I dislike the potentially infinite loop here - please add a timeout and an error exit. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A supercomputer is a machine that runs an endless loop in 2 seconds.