This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2SX: KSZ9031RNXIA PHY not detected

Part Number: TDA2SX

Dear TI,

I am working on our tda2sx custom board with visionsdk verison 3.06 and the related release linux kernel version 4.4.84.
I was tring to make the ethernet interface working fine these days. But it seems that the mac controller cannot detect the phy chip.

dmesg info:

dts node decompiled from my dtb file:

ethernet@48484000 {
			compatible = "ti,dra7-cpsw", "ti,cpsw";
			ti,hwmods = "gmac";
			clocks = <0x11b 0x11c>;
			clock-names = "fck", "cpts";
			cpdma_channels = <0x8>;
			ale_entries = <0x400>;
			bd_ram_size = <0x2000>;
			mac_control = <0x20>;
			slaves = <0x1>;
			active_slave = <0x0>;
			cpts_clock_mult = <0x784cfe14>;
			cpts_clock_shift = <0x1d>;
			reg = <0x48484000 0x1000 0x48485200 0x2e00>;
			#address-cells = <0x1>;
			#size-cells = <0x1>;
			ti,no-idle;
			interrupts = <0x0 0x14e 0x4 0x0 0x14f 0x4 0x0 0x150 0x4 0x0 0x151 0x4>;
			ranges;
			syscon = <0x8>;
			status = "okay";
			dual_emac;

			mdio@48485000 {
				compatible = "ti,cpsw-mdio";
				#address-cells = <0x1>;
				#size-cells = <0x0>;
				ti,hwmods = "davinci_mdio";
				bus_freq = <0xf4240>;
				reg = <0x48485000 0x100>;
				linux,phandle = <0x11d>;
				phandle = <0x11d>;
			};

			slave@48480200 {
				mac-address = [00 00 00 00 00 00];
				phy_id = <0x11d 0x0>;
				phy-mode = "rgmii";
				dual_emac_res_vlan = <0x1>;
			};

			slave@48480300 {
				mac-address = [00 00 00 00 00 00];
				phy_id = <0x11d 0x3>;
				phy-mode = "rgmii";
				dual_emac_res_vlan = <0x2>;
				status = "disabled";
				ti,no-idle;
				ti,no-reset-on-init;
			};

			cpsw-phy-sel@4a002554 {
				compatible = "ti,dra7xx-cpsw-phy-sel";
				reg = <0x4a002554 0x4>;
				reg-names = "gmii-sel";
			};
		};

The following picture is the phy schematic.

I got two questions here.
1. The ifconfig command list three ports(eth0, eth1, lo), while i have disabled the cpsw_emac1 in the dts file. As we have only gmac_sw0 used in our board, how should i disalble the eth1 interface?
2. What should i do to make the eth0 interface working fine?

Another fact is that if i conect the board to my pc. I can get the connection information from the windows side as follow.

In my opinion, this may say that the phy chip is working, but the mac layer cannot make communication with it.

I am very new to linux kernel development. Hope for your reply.

Regards,
Liu Gan

  • Hi all,

    Anyone can help me on this?

    Regards,
    Liu Gan.

  • Hi Liu,

    On looking at the given dtb file, it seems like you have enabled dual-emac mode.

    This will consider the two MAC ports as two different ethernet devices, hence three devices (eth0, eth1,lo) are listed in ifconfig.

    "lo" will always be present as this is for loopback.

    Regards

    Santhana Bharathi

  • Hi Santhana,

    Thanks very much for your help. I deleted the dual-emac property, and now there is only the eth0 interface left.

    This is my new decompiled the dts file section:

    ethernet@48484000 {
    			compatible = "ti,dra7-cpsw", "ti,cpsw";
    			ti,hwmods = "gmac";
    			clocks = <0x11b 0x11c>;
    			clock-names = "fck", "cpts";
    			cpdma_channels = <0x8>;
    			ale_entries = <0x400>;
    			bd_ram_size = <0x2000>;
    			mac_control = <0x20>;
    			slaves = <0x2>;
    			active_slave = <0x0>;
    			cpts_clock_mult = <0x784cfe14>;
    			cpts_clock_shift = <0x1d>;
    			reg = <0x48484000 0x1000 0x48485200 0x2e00>;
    			#address-cells = <0x1>;
    			#size-cells = <0x1>;
    			ti,no-idle;
    			interrupts = <0x0 0x14e 0x4 0x0 0x14f 0x4 0x0 0x150 0x4 0x0 0x151 0x4>;
    			ranges;
    			syscon = <0x8>;
    			status = "okay";
    
    			mdio@48485000 {
    				compatible = "ti,cpsw-mdio";
    				#address-cells = <0x1>;
    				#size-cells = <0x0>;
    				ti,hwmods = "davinci_mdio";
    				bus_freq = <0xf4240>;
    				reg = <0x48485000 0x100>;
    				linux,phandle = <0x11d>;
    				phandle = <0x11d>;
    			};
    
    			slave@48480200 {
    				mac-address = [00 00 00 00 00 00];
    				phy_id = <0x11d 0x0>;
    				phy-mode = "rgmii";
    				dual_emac_res_vlan = <0x1>;
    			};
    
    			slave@48480300 {
    				mac-address = [00 00 00 00 00 00];
    				phy_id = <0x11d 0x3>;
    				phy-mode = "rgmii";
    				dual_emac_res_vlan = <0x2>;
    				status = "disabled";
    				ti,no-idle;
    				ti,no-reset-on-init;
    			};
    
    			cpsw-phy-sel@4a002554 {
    				compatible = "ti,dra7xx-cpsw-phy-sel";
    				reg = <0x4a002554 0x4>;
    				reg-names = "gmii-sel";
    			};
    		};

    But the phy chip still cannot be detected. Can you provide some debug suggests on that?

    Regards,
    Liu Gan

  • Hi all,

    A strange phenomenon.

    If i configured the mdio_clk & mdio_d pins to output, then i can get wave output from the mdio_clk line.
    But if i modify the mido_d pins to i/o, as common understand, then i get nothing from both the mdio_clk and mdio_d lines.

    Hope further help on this problem.

    Regards,
    Liu Gan

  • Hi all,

    Finally i found this is a resistor place issue.
    We add two 0 Ohm resistors in the mdc and mdio lines. But they are proved to 150 KOhm......

    After we replace the two resistors, the ethernet working fine.

    Regards,
    Liu Gan