IMX8M fec add 2nd phy

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

IMX8M fec add 2nd phy

712 次查看
ilanganor1
Contributor III

I need to support two phys under fec 

 

this is how I add in dts:

&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqos1>;
phy-mode = "rgmii-id";
phy-handle = <&ethphy1>;
status = "okay";

mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;

ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};

ethphy2: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};

};
};

is that the correct way ? 

0 项奖励
回复
8 回复数

701 次查看
ilanganor1
Contributor III

@jimmychan , not sure how it relates to my question

in my case single phy already works
I am trying to add 2nd phy and I am not sure if I do it correctlly

0 项奖励
回复

696 次查看
jimmychan
NXP TechSupport
NXP TechSupport

As I saw your device tree setting, the phy address and the reg<> number is not the same. I was thinking  you may not set it right. So sent you a reference.

How you connect the phys and the fec? could you show more details?

0 项奖励
回复

682 次查看
Yakovs
Contributor I

Hello Jimmy,

Below is the HW connectivity of two PHYs, iMX8QP and third party MCU.

Please note that the SMI (MDC, MDIO) is connected from the iMX8 to both PHYs (PHY 0 & PHY 1).
In other words, only the iMX8 configures both PHYs.

Yakovs_0-1707234883669.png

 

0 项奖励
回复

659 次查看
jimmychan
NXP TechSupport
NXP TechSupport

How do you want to control the 2nd phy? when the phy-handle is the 1st phy.

You may modify the source code that meet your usage.

https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/net/ethernet/freescale/fec_main.c

0 项奖励
回复

653 次查看
ilanganor1
Contributor III

how should I moidfy then my DTS to support both phy? as you can see from schematics requirments

0 项奖励
回复

645 次查看
jimmychan
NXP TechSupport
NXP TechSupport

for example, as the 2nd phy is same as the 1st phy, you may add the code to initial the 2nd phy when the 1st phy initial. Or maybe you add a new 'of' ctrl paremeter pass from the device tree to driver. When the driver get this parameter, the driver could initial two phys.

0 项奖励
回复

694 次查看
ilanganor1
Contributor III

oh thats ok, the name is diffrent just because I have also another eth port and I needed to use other names

 

so it's really phy 0 and phy 1 as I defined

0 项奖励
回复

703 次查看
jimmychan
NXP TechSupport
NXP TechSupport
0 项奖励
回复