public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ppc4xx - allow usage of fixed/unmanaged PHYs
@ 2008-08-26 18:11 Wolfgang Ocker
  2008-08-26 18:52 ` Wolfgang Denk
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wolfgang Ocker @ 2008-08-26 18:11 UTC (permalink / raw)
  To: u-boot

This patch allows a managed switch like the 88E6083 to be directly
connected to a 4xx using PHY mode.

It avoids waiting for a link (it's always there) and uses fixed values
for speed and duplex mode since both settings are hardware controlled.

Should I use "FIXED" instead of "UNMANAGED" (so called in the kernel
afair)?

---
Support unmanaged/fixed PHYs like port 8/9 of Marvell 88E6083 on 4xx.
    
Added config vars CONFIG_UNMANAGED_PHY, CONFIG_UNMANAGED_PHY_SPEED
and CONFIG_UNMANAGED_PHY_FULL_DUPLEX to allow unmanaged PHYs
and to configure the settings for speed and duplex mode.

Signed-off-by: Wolfgang Ocker <weo@reccoware.de>

---
 cpu/ppc4xx/4xx_enet.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c
index 8a38335..3b32fa5 100644
--- a/cpu/ppc4xx/4xx_enet.c
+++ b/cpu/ppc4xx/4xx_enet.c
@@ -800,7 +800,9 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 	unsigned long failsafe;
 	unsigned mode_reg;
 	unsigned short devnum;
+#ifndef CONFIG_UNMANAGED_PHY
 	unsigned short reg_short;
+#endif
 #if defined(CONFIG_440GX) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
     defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
@@ -945,6 +947,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 	out_be32((void *)EMAC_M1 + hw_p->hw_addr, mode_reg);
 #endif /* defined(CONFIG_440GX) || defined(CONFIG_440SP) */
 
+#ifndef CONFIG_UNMANAGED_PHY
 	/* wait for PHY to complete auto negotiation */
 	reg_short = 0;
 #ifndef CONFIG_CS8952_PHY
@@ -1082,7 +1085,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
 	speed = miiphy_speed (dev->name, reg);
 	duplex = miiphy_duplex (dev->name, reg);
-
+#else /* !CONFIG_UNMANAGED_PHY */
+	speed = CONFIG_UNMANAGED_PHY_SPEED;
+	duplex = CONFIG_UNMANAGED_PHY_FULL_DUPLEX ? FULL : HALF;
+#endif
 	if (hw_p->print_speed) {
 		hw_p->print_speed = 0;
 		printf ("ENET Speed is %d Mbps - %s duplex connection (EMAC%d)\n",

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-09-22 13:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26 18:11 [U-Boot] [PATCH] ppc4xx - allow usage of fixed/unmanaged PHYs Wolfgang Ocker
2008-08-26 18:52 ` Wolfgang Denk
2008-08-26 19:19   ` Wolfgang Ocker
2008-08-26 21:09     ` Ben Warren
2008-08-26 19:12 ` Grant Erickson
2008-08-26 19:34   ` Wolfgang Ocker
2008-09-22 12:59 ` Stefan Roese
2008-09-22 13:55   ` Wolfgang Ocker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox