IMX8M fec add 2nd phy

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX8M fec add 2nd phy

682件の閲覧回数
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 返答(返信)

671件の閲覧回数
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 件の賞賛

666件の閲覧回数
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 件の賞賛

652件の閲覧回数
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 件の賞賛

629件の閲覧回数
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 件の賞賛

623件の閲覧回数
ilanganor1
Contributor III

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

0 件の賞賛

615件の閲覧回数
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 件の賞賛

664件の閲覧回数
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 件の賞賛

673件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport
0 件の賞賛