I took the reference from linux/arch/arm/boot/dts/imx6ull-14x14-evk.dts and the dts file I use is mentioned earlier at starting of this thread. The only thing I changed in the dts is the ENET1_nRST GPIO and ENET1_nINT pins. I am still facing some issues in bringing up the fec1.
There are two issue:
1. At the time of fec_probe I get the "fep->phy_node" value as garbage
2. At the kernel boot time, as part of fec driver prob it calls fec_restart where ENET registers (control, interrupt event, mii speed control etc.) are being configured. After the kernel boot I am able to see the eth0 interface in ifconfig. Here is the ifconfig output:
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 36:6b:33:80:70:b3
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12160 (11.8 KiB) TX bytes:12160 (11.8 KiB)
sit0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
When I am trying to bring the eth0 interface up It hangs forever at "writel(1, fep->hwp + FEC_ECNTRL);" when writing on control register at 0x24 offset.
static void fec_restart(struct net_device *ndev)
{
struct fec_enet_private *fep = netdev_priv(ndev);
u32 val;
u32 temp_mac[2];
u32 rcntl = OPT_FRAME_SIZE | 0x04;
u32 ecntl = FEC_ENET_ETHEREN; /* ETHEREN */
/* Whack a reset. We should wait for this.
* For i.MX6SX SOC, enet use AXI bus, we use disable MAC
* instead of reset MAC itself.
*/
if (fep->quirks & FEC_QUIRK_HAS_AVB) {
writel(0, fep->hwp + FEC_ECNTRL);
} else {
writel(1, fep->hwp + FEC_ECNTRL); <<<<<<< it hangs forever during "ifconfig eth0 up"
udelay(10);
}
...
}
The same fec_restart call works without hang during the kernel boot process but after boot when doing so hangs the board forever. Please let me know if anything is missing.
Thanks,
Digesh