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 = <ðphy1>;
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 ?
@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
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?
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.
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
how should I moidfy then my DTS to support both phy? as you can see from schematics requirments
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.
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