mii_send error or at least strange
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 0printf("%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 */
}
Antonio,
I'm not sure about the 8xx PowerQUICCs, but other Freescale CPUs with multiple ethernet ports support MII data plane on all ports but only have one MDIO port (control plane for MII). Maybe that's why the code is this way?
regards,
Ben
Quoted 33 lines · Antonio Di Bacco
I had a look to
mii_sendcode inu-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)
{
uintmii_reply;
volatilefec_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 0printf("%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 */ }
Quoted 9 lines
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060315/67723504/attachment.htm
That's a good answer.
Thank you.
But why do I receive "mii_send STUCK" for example when tftp tries to use FEC2?
Bye.
Quoted 54 lines · Ben Warren
Antonio,
I'm not sure about the 8xx PowerQUICCs, but other Freescale CPUs with multiple ethernet ports support MII data plane on all ports but only have one MDIO port (control plane for MII). Maybe that's why the code is this way?
regards,
BenQuoted 43 lines · Antonio Di Bacco
I had a look to
mii_sendcode inu-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)
{
uintmii_reply;
volatilefec_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 0printf("%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 */ }-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Quoted 4 lines · Ben Warren
I'm not sure about the 8xx PowerQUICCs, but other Freescale CPUs with
multiple ethernet ports support MII data plane on all ports but only have one MDIO port (control plane for MII).? Maybe that's why the code is this way?
That's exactly why.
-- Dan