linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* mii_send error or at least strange
@ 2006-03-15 20:21 Antonio Di Bacco
  2006-03-15 21:02 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Di Bacco @ 2006-03-15 20:21 UTC (permalink / raw)
  To: linuxppc-embedded

I had a look to mii_send code in u-boot/cpu/mpc8xx/fec.c . It supports both 
FEC1 and FEC2 but anyway it seems to write always register mii-data of FEC1, 
look here: 
 
/* send command to phy using mii, wait for result */ 
static uint  mii_send(uint mii_cmd) 
{ 
uint mii_reply; 
volatile fec_t *ep; 
int cnt; 
 
ep = &(((immap_t *)CFG_IMMR)->im_cpm.cp_fec); 
 
ep->fec_mii_data = mii_cmd; /* command to phy */ 
 
/* wait for mii complete */ 
cnt = 0; 
while (!(ep->fec_ievent & FEC_ENET_MII)) { 
if (++cnt > 1000) { 
printf("mii_send STUCK!\n"); 
break; 
} 
} 
mii_reply = ep->fec_mii_data; /* result from phy */ 
ep->fec_ievent = FEC_ENET_MII; /* clear MII complete */ 
#if 0 
printf("%s[%d] %s: sent=0x%8.8x, reply=0x%8.8x\n", 
__FILE__,__LINE__,__FUNCTION__,mii_cmd,mii_reply); 
#endif 
return (mii_reply & 0xffff); /* data read from phy */ 
} 

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

* Re: mii_send error or at least strange
  2006-03-15 20:21 mii_send error or at least strange Antonio Di Bacco
@ 2006-03-15 21:02 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2006-03-15 21:02 UTC (permalink / raw)
  To: Antonio Di Bacco; +Cc: linuxppc-embedded

In message <200603152121.21852.antonio.dibacco@aruba.it> you wrote:
> I had a look to mii_send code in u-boot/cpu/mpc8xx/fec.c . It supports both 

You are off topic here. Please post U-Boot related questions on the
U-Boot mailing list.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Es gibt immer genug fuer die Beduerfnisse aller, aber  niemals  genug
fuer die Gier einzelner.                                    -- Ghandi

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

end of thread, other threads:[~2006-03-15 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-15 20:21 mii_send error or at least strange Antonio Di Bacco
2006-03-15 21:02 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).