Skip to contentSkip to conversation

mpc5xxx_fec: add call to reset_phy() after PHY initialization

PATCH New Ilya Yanok 3 participants 4 messages Aug 19, 2010 – Oct 12, 2010 Network drivers

lore
Share & tools
lore

Ilya Yanok

author
#0 lore raw

PATCH 1/1 mpc5xxx_fec: add call to reset_phy() after PHY initialization

Some boards need their board-specific PHY quirks to be called to PHY to work normally. As mpc5xxx_fec driver uses on demand PHY initialization and can even reinit PHY during normal operation we can't count on reset_phy() call from arch/<arch>/lib/board.c (it is most likely called _before_ we init the PHY from the driver) so we need to add call to reset_phy() directly in the driver.

---
 drivers/net/mpc5xxx_fec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/mpc5xxx_fec.c +7 -0
index c88e596..bc8c922 100644
@@ -250,6 +250,13 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
 	mpc5xxx_fec_init_phy(dev, bis);
 
 	/*
+	 * Call board-specific PHY fixups (if any)
+	 */
+#ifdef CONFIG_RESET_PHY_R
+	reset_phy();
+#endif
+
+	/*
 	 * Initialize RxBD/TxBD rings
 	 */
 	mpc5xxx_fec_rbd_init(fec);
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 1/1 mpc5xxx_fec: add call to reset_phy() after PHY initialization

Dear Ben,

Quoted 8 lines · In message <[email protected]> Ilya Yanok…

Some boards need their board-specific PHY quirks to be called to PHY to work normally. As mpc5xxx_fec driver uses on demand PHY initialization and can even reinit PHY during normal operation we can't count on reset_phy() call from arch/<arch>/lib/board.c (it is most likely called _before_ we init the PHY from the driver) so we need to add call to reset_phy() directly in the driver.

Quoted 5 lines
---
 drivers/net/mpc5xxx_fec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Do you have any comments?

Best regards,

Wolfgang Denk

Signature · 5 lines
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 direct quote from the Boss: "We passed over a lot of good people to
get the ones we hired."
#2 lore raw

PATCH 1/1 mpc5xxx_fec: add call to reset_phy() after PHY initialization

Dear Ben,

ping again...

Quoted 11 lines · In message <[email protected]> I wrote:

Dear Ben,

Quoted 8 lines · In message <[email protected]> Ilya Yanok…

Some boards need their board-specific PHY quirks to be called to PHY to work normally. As mpc5xxx_fec driver uses on demand PHY initialization and can even reinit PHY during normal operation we can't count on reset_phy() call from arch/<arch>/lib/board.c (it is most likely called _before_ we init the PHY from the driver) so we need to add call to reset_phy() directly in the driver.

Quoted 7 lines
Quoted 5 lines
---
 drivers/net/mpc5xxx_fec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Do you have any comments?

Please comment how to go on - this is a real problem that needs to be fixed one way or another.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
It is more rational to sacrifice one life than six.
	-- Spock, "The Galileo Seven", stardate 2822.3
Applied
#3 lore raw

PATCH 1/1 mpc5xxx_fec: add call to reset_phy() after PHY initialization

In reply to Ilya Yanok

Hi Ilya,

Quoted 22 lines · Ilya Yanok

Some boards need their board-specific PHY quirks to be called to PHY to work normally. As mpc5xxx_fec driver uses on demand PHY initialization and can even reinit PHY during normal operation we can't count on reset_phy() call from arch/<arch>/lib/board.c (it is most likely called _before_ we init the PHY from the driver) so we need to add call to reset_phy() directly in the driver.

---
  drivers/net/mpc5xxx_fec.c |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/mpc5xxx_fec.c +0 -0
index c88e596..bc8c922 100644
@@ -250,6 +250,13 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
  	mpc5xxx_fec_init_phy(dev, bis);
 
  	/*

drivers/net/mpc5xxx_fec.c static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis) · line 262

Quoted 10 lines
drivers/net/mpc5xxx_fec.c +7 -0
+	 * Call board-specific PHY fixups (if any)
+	 */
+#ifdef CONFIG_RESET_PHY_R
+	reset_phy();
+#endif
+
+	/*
  	 * Initialize RxBD/TxBD rings
  	 */
  	mpc5xxx_fec_rbd_init(fec);

Applied to net repo. Please accept my sincere apologies for taking so long to process.

regards,
Ben