Hello All,
We have custom board made on imx6ul. I am trying to get my ethernet working on ethernet2 with TI DP83822 in RMII mode. I am getting the following log output.
imx sema4 driver is registered.
[drm] Initialized vivante 1.0.0 20120216 for platform:Vivante GCCore on minor 0
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
spi_imx 2010000.ecspi: probed
libphy: Fixed MDIO Bus: probed
CAN device driver interface
OF: /soc/aips-bus@02000000/ethernet@020b4000: could not get #gpio-cells for /soc/aips-bus@02100000/i2c@021a4000/gpio@20
fec 20b4000.ethernet: 20b4000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 1e:cd:92:b1:09:15
libphy: fec_enet_mii_bus: probed
fec 20b4000.ethernet eth0: registered PHC device 0
usbcore: registered new interface driver kaweth
pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
usbcore: registered new interface driver pegasus
usbcore: registered new interface driver rtl8150
usbcore: registered new interface driver r8152
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
When I do ifconfig, I get the following output:
root@imx6ulevk:~# ifconfig
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:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:140 (140.0 B) TX bytes:140 (140.0 B)
I am not gettinh ethernet working, following is the device tree... what could be wrong
pinctrl_enet2: enet2grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET2_MDIO 0x1b0b0
MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
>;
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2>;
pinctrl-assert-gpios = <&pca9535_1 8 GPIO_ACTIVE_HIGH>; /*dp83822 reset gpio*/
phy-mode = "rmii";
phy-handle = <ðphy1>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
clocks = <&clks IMX6UL_CLK_ENET2_REF>;
clock-names = "rmii-ref";
device-type = "ethernet-phy";
};
};
};
what could possibly be wrong?
I have also referred following links
linux/imx7d-sdb.dts at master · torvalds/linux · GitHub
linux/imx6ul-14x14-evk.dts at master · torvalds/linux · GitHub
I have also made changes to mach-imx6ul.c
Any other change do I need to make for clock or anything?
Thanks,
Asma
@Igorpadykov,
Thank you for quick reply.
I want to use external clock from DP83822. So if do setup_fec, I believe it tries to set up internal clock.
Is my device tree right to setup external clock, In other word how can I set up external clock?
And here is my setup_fec, same as imx6ulevk - Is it correct?
Hi Asma
one can try to debug it in similar way as on below link
Ethernet problem with i.MX 7Dual and DP83849IVS PHY
Start with uboot function setup_fec() and check "ENET2_TX_CLK__ENET2_REF_CLK"
clock with oscilloscope
mx6ul_14x14_evk.c\mx6ul_14x14_evk\freescale\board - uboot-imx - i.MX U-Boot
This clock direction is described in sect.30.4.2 GPR1 General Purpose Register (IOMUXC_GPR_GPR1)
i.MX6UL Reference Manual. First check if it is working in uboot.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov,
Thanks for the reply, My ethernet is up now.
root@imx6ulevk:~# ifconfig
eth0 Link encap:Ethernet HWaddr f2:36:34:63:49:58
inet addr:169.254.234.123 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::f036:34ff:fe63:4958/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:22690 (22.1 KiB)
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:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1036 (1.0 KiB) TX bytes:1036 (1.0 KiB)
But when i do ping, I get host not reachable.
root@imx6ulevk:/etc/network# ifdown eth0
ifdown: interface eth0 not configured
root@imx6ulevk:/etc/network# ping 8.8.8.8
connect: Network is unreachable
root@imx6ulevk:/etc/network# ping www.google.com
ping: www.google.com: Name or service not known
root@imx6ulevk:/etc/network#
what could possibly the reason for this?
Regards,
Asma