我一个自己layout的板子上(使用imx6dl)使用了IP101A 的phy,它是GMII接口的,我已经在driver/net/phy中添加了相应的驱动,但是目前还是不能工作,提示我:
eth0: no PHY, assuming direct connection to switch
PHY 0:00 not found
eth0: could not attach to PHY
在arch/arm/mach-mx6/board_xxxx.c中的fec_data中的init的函数是实现什么样的功能,是需要怎么修改呢?(我的IO定义已经修改)
static int mx6_fec_phy_init(struct phy_device *phydev)
{
unsigned short val;
/* Ar8031 phy SmartEEE feature cause link status generates glitch,
* which cause ethernet link down/up issue, so disable SmartEEE
*/
phy_write(phydev, 0xd, 0x3);
phy_write(phydev, 0xe, 0x805d);
phy_write(phydev, 0xd, 0x4003);
val = phy_read(phydev, 0xe);
val &= ~(0x1 << 8);
phy_write(phydev, 0xe, val);
/* To enable AR8031 ouput a 125MHz clk from CLK_25M */
phy_write(phydev, 0xd, 0x7);
phy_write(phydev, 0xe, 0x8016);
phy_write(phydev, 0xd, 0x4007);
val = phy_read(phydev, 0xe);
val &= 0xffe3;
val |= 0x18;
phy_write(phydev, 0xe, val);
/* Introduce tx clock delay */
phy_write(phydev, 0x1d, 0x5);
val = phy_read(phydev, 0x1e);
val |= 0x0100;
phy_write(phydev, 0x1e, val);
/*check phy power*/
val = phy_read(phydev, 0x0);
if (val & BMCR_PDOWN)
return 0;
}
static struct fec_platform_data fec_data __initdata = {
.init = mx6_fec_phy_init,
.phy = PHY_INTERFACE_MODE_GMII,
//.gpio_irq = MX6_ENET_IRQ,
};
u-boot中又需要作些什么配置??
|