So we have a custom board based on the i.MX287 EVK with a Micrel KSZ8895 Ethernet switch connected to the i.MX287 FEC. Since this isn't a typical PHY (you cannot use it to auto-negotiate, get link status etc) we need to bypass the regular PHY-management or somehow implement a fixed-link PHY driver. While booting into a Linux 3.14.3 kernel the fec driver does correctly state a direct connection to a switch, but is not able to find a PHY to attach to afterwards:
[ 3.001590] fec 800f0000.ethernet eth0: no PHY, assuming direct connection to switch
[ 3.009643] libphy: PHY fixed-0:00 not found
[ 3.013975] fec 800f0000.ethernet eth0: could not attach to PHY
I have tried to add the fixed PHY driver (CONFIG_FIXED_PHY) but it would seem it does not hook into libphy.
Will I need to implement this fixed PHY driver on my own or have I simply missed something in my configuration?
Solved! Go to Solution.
So, after looking through various mailing lists I came upon this thread on the infradead mailing list:
[RFC PATCH 0/3] Add DT support for fixed PHYs
This detailed a number of patches where the author adds fixed-link PHY support to the Marvell Armada-type driver using the fixed-link Device Tree binding used for the PowerPC architecture. Using two out of the three patches he posted to the mailing list and modifying the Freescale FEC driver in the kernel I managed to implement the same feature and get the Ethernet switch running. Attached below are the patches I used. This will allow you to add a new binding to the mac0 node in the Device Tree for the i.MX28 called fixed-link which details the fixed-link setup (speed, duplex etc etc). Note that if the driver finds a fixed-link binding it will disable the hardware MDIO interface. This is done because otherwise the driver will find one of the Ethernet switches PHYs and attempt to use that instead of the fixed PHY we just added. See the files in Documentation/devicetree/bindings that are added from the patches for more information.
Note that these patches are made against the linux-fslc recipe in Yocto Daisy (1.6). Current kernel version 3.14.3.
So, after looking through various mailing lists I came upon this thread on the infradead mailing list:
[RFC PATCH 0/3] Add DT support for fixed PHYs
This detailed a number of patches where the author adds fixed-link PHY support to the Marvell Armada-type driver using the fixed-link Device Tree binding used for the PowerPC architecture. Using two out of the three patches he posted to the mailing list and modifying the Freescale FEC driver in the kernel I managed to implement the same feature and get the Ethernet switch running. Attached below are the patches I used. This will allow you to add a new binding to the mac0 node in the Device Tree for the i.MX28 called fixed-link which details the fixed-link setup (speed, duplex etc etc). Note that if the driver finds a fixed-link binding it will disable the hardware MDIO interface. This is done because otherwise the driver will find one of the Ethernet switches PHYs and attempt to use that instead of the fixed PHY we just added. See the files in Documentation/devicetree/bindings that are added from the patches for more information.
Note that these patches are made against the linux-fslc recipe in Yocto Daisy (1.6). Current kernel version 3.14.3.
Hello,
I would please like to ask,
Is the solution also support sending ethernet frames ?
I mean, isn't it also required to tell the ethernet driver of the cpu, to netif_start_queue ?
Regards,
ranran
Works well. Thanks !
Hi Otto,
I have the same problem on my imx6dl customer board, But the kernel I am used is 3.14.52.
where can I get one copy the source code match with the patch?
Thanks!
Wenming
Wenming,
did you ever find a resolution for this, for your situation?
Hi Henric,
Thanks a lot for sharing your solution and information. It is very appreciated.
Best Regards,
Alejandro