I'm having issues getting ENET1 to function on a custom board based off of the i.MX6UL dev kit. The interface works great in u-boot (can retrieve a DHCP address and respond to PING's). However, I've not had any luck getting it to work in the kernel.
here's my kernel version:
Linux version 4.1.20-01618-g0076509-dirty
Here are my DTS entries for the ethernet device:
pinctrl_enet1: enet1grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x13030
MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x40000011
MX6UL_PAD_ENET2_RX_DATA0__ENET1_MDIO 0x0A429
MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC 0x1b088
>;
};
&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1>;
phy-mode = "rmii";
phy-handle = <ðphy0>;
phy-reset-gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>;
phy-reset-duration = <500>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
};
};
When I try to configure the device, eth0, for static address these are the errors I receive:
sh-4.3# ifup eth0 -i etc/network/interfaces_static
run-parts: /etc/network/if-pre-up.d: No such file or directory
ifconfig: SIOCSIFFLAGS: No such device
ifconfig: SIOCSIFFLAGS: No such device
route: SIOCADDRT: Network is unreachable
sh-4.3# ip link set eth0 up
ip: SIOCSIFFLAGS: No such device
Any advice on using only ENET1 on the i.MX6UL?
Thanks in advance.
已解决! 转到解答。
Hello gusarambula,
I should've marked this resolved as I discovered that the issue boiled down to some timing bug in the kernel. It seems likely that the driver was trying to communicate with the PHY before it was completely out of reset. This was discovered by adding some kernel debug messages in locations throughout the driver initialization and having a print statement in one particular location suddenly caused everything to work.
The end solution was to add some delay in the PHY reset function after the reset steps were complete (toggling the HW I/O). All seems to be working now.
Hello Kevin VandenBerge,
Have you tried getting eth0 down and then up? You probably did but I would like to confirm as perhaps that is part of the problem. Does static IPs work on u-boot?
It’s odd that it’s working correctly in U-boot but not in kernel, however, have you tried using the NXP BSP Kernel? (4.15)
Regards,
Hello gusarambula,
I should've marked this resolved as I discovered that the issue boiled down to some timing bug in the kernel. It seems likely that the driver was trying to communicate with the PHY before it was completely out of reset. This was discovered by adding some kernel debug messages in locations throughout the driver initialization and having a print statement in one particular location suddenly caused everything to work.
The end solution was to add some delay in the PHY reset function after the reset steps were complete (toggling the HW I/O). All seems to be working now.