|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2010-11-10 11:20:21
|
显示全部楼层
操作RTL8201 的代码:
/***********************************************************/
/* read a phy reg and return the value with a rc */
/***********************************************************/
int miiphy_read (unsigned char addr, unsigned char reg,
unsigned short *value)
{
............
sta_reg = in32 (EMAC_STACR);
i = 0;
.......
if ((sta_reg & EMAC_STACR_PHYE) != 0) {
printf ("read err 3\n");
printf ("a2: read: EMAC_STACR=0x%0lx, i=%d\n",
sta_reg, (int) i); /* test-only */
return -1;
}
*value = *(short *) (&sta_reg);
return 0;
} /* phy_read */ |
|