VF61 second ethernet PHY

Hello,

I have trouble with second ethernet. I need to have two separete networks connected to device. At first I tried to use esw device, which works as expected. I can connect from both ports and it works as it should.

When I tried to separate interfaces, I swapped aliases from ethernet0 = &esw; to ethernet0 = &fec0; ethernet1 = &fec1;. Then I replaced esw

&esw {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_fec0 &pinctrl_fec1>; 
   status = "okay";
};

with fec1

&fec1 { status = "okay"; };

and fec0

&fec0 {
   phy-mode = "rmii";
   pinctrl-names = "names";
   pinctrl-0 = <&pinctrl_fec0>;
   status = "okay";
}

After these changes device booted and fec1 worked, as it should, but interface for fec0 could not attach PHY:

[   12.927131] fec 400d0000.ethernet eth0: could not attach to PHY

and after using ifconfig eth0 up the output was this:

root@colibri-vf:~# ifconfig eth0 up
[ 1556.257113] fec 400d0000.ethernet eth0: could not attach to PHY
ifconfig: SIOCSIFFLAGS: Connection timed out

I use same connection as recommended in here.
Do you have any idea, how to fix this?

With regards
ELT_MZ.

Dear @ELT_MZ

Is there a reason why you didn’t define any phy-handle in your fec1 node? What kind of phy did you assemble on your board?

It seems that your fec doesn’t find any connected phy or at least it doesn’t know where to look at. Could you check if you can define the phy-handle with a mdio subnode according to the official documentation or the example of &fec1? You would find the documentation for the devicetree bindings here:

  • Documentation/devicetree/bindings/net/fsl-fec.txt
  • Documentation/devicetree/bindings/net/phy.txt

Also if you comment the next time, could you send your device tree files?

Best regards
Diego

Hello @diego_b.tx ,

I tried to your advice, but I don’t know how to set phy-handler correctly. I am tring to use KSZ8041NL as PHY, connected as recommended here. Could you help?

Note: When I try to use ifconfig eth0 up, the device outputs only ifconfig: SIOCSIFFLAGS: Connection timed out now.

Here is current devicetree ( device-tree.dtsi ).

With regards

ELT_MZ.

Hi @ELT_MZ

The mdio part should somehow look like:

mdio {
	#address-cells = <1>;
	#size-cells = <0>;

	ethphy1: ethernet-phy@0  {
		reg = <!!!phy address!!!>;
	};
};

Do you see other messages if you do a “dmesg”? Can you maybe share the whole log?

Regards,
Stefan

Hi Stefan,

thank you for advice, there was colision, which I missed with back_light.

Regards,
ELT_MZ

Hi @ELT_MZ

You are welcome.

Best regards,
Jaski