i.MX287 FEC connected to Ethernet switch

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX287 FEC connected to Ethernet switch

跳至解决方案
6,918 次查看
henriceriksson
Contributor I

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?

标签 (3)
1 解答
1,924 次查看
henriceriksson
Contributor I

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.

在原帖中查看解决方案

6 回复数
1,925 次查看
henriceriksson
Contributor I

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.

1,924 次查看
rans
Senior Contributor I

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

0 项奖励
1,924 次查看
ottob
Contributor IV

Works well. Thanks !

0 项奖励
1,924 次查看
wenmingfeng
Contributor III

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

0 项奖励
1,924 次查看
mascenzipsi
Senior Contributor I

Wenming,

did you ever find a resolution for this, for your situation?

0 项奖励
1,924 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi Henric,

Thanks a lot for sharing your solution and information. It is very appreciated.

Best Regards,

Alejandro

0 项奖励