IMX8M fec add 2nd phy

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8M fec add 2nd phy

830 Views
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 Kudos
Reply
8 Replies

819 Views
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 Kudos
Reply

814 Views
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 Kudos
Reply

800 Views
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 Kudos
Reply

777 Views
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 Kudos
Reply

771 Views
ilanganor1
Contributor III

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

0 Kudos
Reply

763 Views
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 Kudos
Reply

812 Views
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 Kudos
Reply