[U-Boot-Users] mii_send error or at least strange

Antonio Di Bacco antonio.dibacco at aruba.it
Wed Mar 15 22:31:13 CET 2006


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 */ 
} 




More information about the U-Boot mailing list