From: Antonio Di Bacco Date: Wed, 15 Mar 2006 22:31:13 +0100 Subject: [U-Boot-Users] mii_send error or at least strange Message-ID: <200603152231.13466.antonio.dibacco@aruba.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 */ }