Hello,
We use LAN8720A as RMII phy on i.Mx6q, now we can set its IP but don't transfer data.
RMII_REF_CLK_50M is connected to GPIO_16.
board-mx6q_sabresd.h
MX6Q_PAD_ENET_MDIO__ENET_MDIO,
MX6Q_PAD_ENET_MDC__ENET_MDC,
MX6Q_PAD_ENET_RXD0__ENET_RDATA_0,
MX6Q_PAD_ENET_RXD1__ENET_RDATA_1,
MX6Q_PAD_ENET_CRS_DV__ENET_RX_EN,
MX6Q_PAD_ENET_RX_ER__ENET_RX_ER,
MX6Q_PAD_ENET_TXD0__ENET_TDATA_0,
MX6Q_PAD_ENET_TXD1__ENET_TDATA_1,
MX6Q_PAD_ENET_TX_EN__ENET_TX_EN,
MX6Q_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT,/* Internal connect for 1588 TS Clock 50M clock*/
MX6Q_PAD_RGMII_TD3__GPIO_6_23, /* RMII reset */
//MX6Q_PAD_GPIO_5__GPIO_1_5, /* PHY interrupt */
board-mx6q_sabresd.c
mxc_iomux_set_gpr_register(1, 21, 1, 1);
static int mx6q_sabresd_fec_phy_init(struct phy_device *phydev)
{
unsigned short val;
/* reset phy */
gpio_request(SABRESD_RMII_RST, "phy-rst");
gpio_direction_output(SABRESD_RMII_RST, 0);
mdelay(10);
gpio_direction_output(SABRESD_RMII_RST, 1);
val = phy_read(phydev, 0x0);
phy_write(phydev, 0x0, (val |BMCR_RESET));
msleep(500);
/* check phy power */
val = phy_read(phydev, 0x0);
if (val & BMCR_PDOWN)
{
phy_write(phydev, 0x0, (val & ~BMCR_PDOWN));
}
return 0;
}
static struct fec_platform_data fec_data __initdata = {
.init = mx6q_sabresd_fec_phy_init,
.phy = PHY_INTERFACE_MODE_RMII,
#ifdef CONFIG_MX6_ENET_IRQ_TO_GPIO
.gpio_irq = MX6_ENET_IRQ,
#endif
};
I have similar problem with newer kernel:
RMII interface error on i.MX6Q
Unfortunately I haven't figured it out yet.
Laszlo
When I ping the router, terminal display the information as below
my router's IP is 192.168.1.1. it is alive.
Are there other things need to set up? then it will transmit data.
I have modifued the kernel is according to the patch.
When I use the wireshark to test the ping command. it display as the follow,
20:13:10:11:18:14 is board's mac. 68:5b:35:b6:3f:81 is PC's mac.
The terminal have display,
Now, I don't know what happen is on the network module.
It caputue shows, the sending is correct.
APR is sent out and APR response is sending back.
So as I suggest, please check the
Please check from the peer you ping to, if the packet is sent out and peer side has replied. Just i.MX6 could not receive from phy.
If so, please check the CRS_DV signal. It is the signal to tell mac the data is ready to receive.
Also please check the phy mode.
The CRS_DV have signal, also can entry fec_recv function in uboot mxc_fec.c.
int fec_recv(struct eth_device *dev)
if (info->rxbd[info->rxIdx].cbd_sc & BD_ENET_RX_EMPTY) {
length = -1;
break; /* nothing received - leave for() loop */
}
the function checked recv buffer empty and break;
I couldn't find where to receive data and then give the info->rxbd assignment.
hello,did you solve this problem?
H Sober,
Please check from the peer you ping to, if the packet is sent out and peer side has replied. Just i.MX6 could not receive from phy.
If so, please check the CRS_DV signal. It is the signal to tell mac the data is ready to receive.
Also please check the phy mode.