Hi, I'm trying to set up an existing project using an i.MX6Q with the latest kernel (I'm using linux-imx 6.1), latest uboot-imx (2023.04) and Yocto Mickledore. My reference board is the imx6q-sabresd. I've enabled the fec ethernet in the DTS with the following:
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet>;
phy-mode = "rgmii-id";
phy-handle = <&phy>;
fsl,magic-packet;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy: ethernet-phy@1 {
reg = <1>;
qca,clk-out-frequency = <125000000>;
reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
};
};
};
&iomuxc {
imx6q-device {
pinctrl_enet: enetgrp_fec {
fsl,pins = <
MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x10030
MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x100b0
MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x80000000
>;
};
};
};
When I use boot into Linux, I can see the ethernet device with `ifconfig`:
root@machine-name:~# ifconfig
eth0 Link encap:Ethernet HWaddr 0C:92:4E:00:36:46
UP 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: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)
However, when I plug an Ethernet cable into the device, I get a bunch of these logs:
[ 35.296600] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 35.305602] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 36.520866] fec 2188000.ethernet eth0: rcv is not +last
[ 41.512868] fec 2188000.ethernet eth0: rcv is not +last
[ 41.519520] fec 2188000.ethernet eth0: rcv is not +last
[ 41.525027] fec 2188000.ethernet eth0: rcv is not +last
[ 41.530820] fec 2188000.ethernet eth0: rcv is not +last
[ 41.536440] fec 2188000.ethernet eth0: rcv is not +last
[ 41.542103] fec 2188000.ethernet eth0: rcv is not +last
[ 41.547927] fec 2188000.ethernet eth0: rcv is not +last
[ 41.553725] fec 2188000.ethernet eth0: rcv is not +last
[ 41.559345] fec 2188000.ethernet eth0: rcv is not +last
[ 41.565024] fec 2188000.ethernet eth0: rcv is not +last
[ 41.570601] fec 2188000.ethernet eth0: rcv is not +last
[ 41.576054] fec 2188000.ethernet eth0: rcv is not +last
[ 41.581491] fec 2188000.ethernet eth0: rcv is not +last
[ 41.586877] fec 2188000.ethernet eth0: rcv is not +last
[ 41.592426] fec 2188000.ethernet eth0: rcv is not +last
[ 41.598503] fec 2188000.ethernet eth0: rcv is not +last
[ 46.514977] fec 2188000.ethernet eth0: rcv is not +last
[ 46.521103] fec 2188000.ethernet eth0: rcv is not +last
[ 46.526655] fec 2188000.ethernet eth0: rcv is not +last
[ 46.532199] fec 2188000.ethernet eth0: rcv is not +last
[ 46.537718] fec 2188000.ethernet eth0: rcv is not +last
[ 46.543333] fec 2188000.ethernet eth0: rcv is not +last
[ 46.549479] fec 2188000.ethernet eth0: rcv is not +last
[ 46.555185] fec 2188000.ethernet eth0: rcv is not +last
[ 46.560778] fec 2188000.ethernet eth0: rcv is not +last
[ 46.566350] fec 2188000.ethernet eth0: rcv is not +last
[ 46.571921] fec 2188000.ethernet eth0: rcv is not +last
[ 46.577378] fec 2188000.ethernet eth0: rcv is not +last
[ 46.582808] fec 2188000.ethernet eth0: rcv is not +last
[ 46.588174] fec 2188000.ethernet eth0: rcv is not +last
[ 46.593606] fec 2188000.ethernet eth0: rcv is not +last
[ 46.599659] fec 2188000.ethernet eth0: rcv is not +last
I see from Google that back in Kernel 3.0, there was a bug that produced this, but this was a long time ago and it was patched.
Does anyone have any insight into this issue?
Solved! Go to Solution.
Turns out I think I had multiple issues. The first might have been that I was missing some kernel configs. I'm not sure which ones specifically though. But the primary fix was manually setting the ethernet speed to a slower speed. First I did it with `ethtool -s enp0s3 autoneg on speed 100 duplex full`. But a more useful fix was to set the max speed of the PHY in the device tree:
max-speed = <100>; // Set max speed to 100 Mbps due to imx6 Ethernet errata
in the `phy: ethernet-phy@1` node. This caps the speed which fixed my issue due to the gigabit ethernet errata on the imx6.
Turns out I think I had multiple issues. The first might have been that I was missing some kernel configs. I'm not sure which ones specifically though. But the primary fix was manually setting the ethernet speed to a slower speed. First I did it with `ethtool -s enp0s3 autoneg on speed 100 duplex full`. But a more useful fix was to set the max speed of the PHY in the device tree:
max-speed = <100>; // Set max speed to 100 Mbps due to imx6 Ethernet errata
in the `phy: ethernet-phy@1` node. This caps the speed which fixed my issue due to the gigabit ethernet errata on the imx6.
Hello,
Tyr to change the fec.c installed on your BSP, After we changed the buffer defines in the fec driver it works for us.
#define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF))
/* The FEC stores dest/src/type, data, and checksum for receive packets.
*/
-#define PKT_MAXBUF_SIZE | 1518 |
#define PKT_MAXBUF_SIZE | 1534 | |
#define PKT_MINBUF_SIZE | 64 | |
#define PKT_MAXBLR_SIZE | 1520 |
#define PKT_MAXBLR_SIZE | 1536 |
/*
* The 5270/5271/5280/5282/532x RX control register also contains maximum frame
* size bits. Other FEC hardware does not, so we need to take that into
Regards
hi,
I test the 6.1.36-2.1.0 version on imx6q-sabresd. There is no such error. The following is my dts about FEC node. You can also reference the imx6qdl-sabresd.dtsi file of the kernel 6.1.36-2.1.0 version.
Regards