TDA4VM: TDA4VM 0902: Serdes2 4 x 1 lane net can't work

Part Number: TDA4VM
Other Parts Discussed in Thread: TDA4VH

Tool/software:

Hi,
     I want make my device tree like this,

    This is my device tree code.

     

// SPDX-License-Identifier: GPL-2.0
/**
 * DT Overlay for CPSW9G in dual port fixed-link USXGMII mode using ENET-1
 * and ENET-2 Expansion slots of J784S4 EVM.
 *
 * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mux/ti-serdes.h>
#include <dt-bindings/phy/phy-cadence.h>
#include <dt-bindings/phy/phy.h>

&main_cpsw0 {
	status = "okay";
	pinctrl-names = "default";
};

&main_cpsw0_port1 {
	status = "okay";
	phy-mode = "usxgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 1>, <&serdes2_usxgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <10000>;
		full-duplex;
	};
};

&main_cpsw0_port2 {
	status = "okay";
	phy-mode = "usxgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 2>, <&serdes2_usxgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <10000>;
		full-duplex;
	};
};

&main_cpsw0_port5 {
	status = "okay";
	phy-mode = "qsgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 5>, <&serdes2_sgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};
&main_cpsw0_port6 {
	status = "okay";
	phy-mode = "qsgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 6>, <&serdes2_sgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};


&serdes_wiz2 {
	status = "okay";
	assigned-clock-parents = <&k3_clks 406 9>;
};

&serdes2 {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	serdes2_sgmii_link: phy@0 {
		reg = <0>;
		cdns,num-lanes = <2>;
		#phy-cells = <0>;
		cdns,phy-type = <PHY_TYPE_SGMII>;
		resets = <&serdes_wiz2 1>, <&serdes_wiz2 2>;
	};

	serdes2_usxgmii_link: phy@2 {
		reg = <2>;
		cdns,num-lanes = <2>;
		#phy-cells = <0>;
		cdns,phy-type = <PHY_TYPE_USXGMII>;
		resets = <&serdes_wiz2 3>, <&serdes_wiz2 4>;
	};
	
};

&serdes_ln_ctrl {
	idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_PCIE1_LANE1>,
		      <J784S4_SERDES0_LANE2_IP3_UNUSED>, <J784S4_SERDES0_LANE3_USB>,
		      <J784S4_SERDES1_LANE0_PCIE0_LANE0>, <J784S4_SERDES1_LANE1_PCIE0_LANE1>,
		      <J784S4_SERDES1_LANE2_PCIE0_LANE2>, <J784S4_SERDES1_LANE3_PCIE0_LANE3>,
		      <J784S4_SERDES2_LANE0_QSGMII_LANE5>, <J784S4_SERDES2_LANE1_QSGMII_LANE6>,
		      <J784S4_SERDES2_LANE2_QSGMII_LANE1>, <J784S4_SERDES2_LANE3_QSGMII_LANE2>;
};

and dmesg output 

   

root@j784s4-evm:~# dmesg | grep eth
[    0.000000] psci: probing for conduit method from DT.
[    1.035384] optee: probing for conduit method.
[    1.496067] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000
[    1.508918] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4
[    1.516125] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
[    1.526416] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:500000000, add_val:1 pps:1
[    1.536238] am65-cpsw-nuss c000000.ethernet: initializing am65 cpsw nuss version 0x6BA03102, cpsw version 0x6BA82902 Ports: 9 quirks:00000000
[    1.603680] am65-cpsw-nuss c200000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000
[    1.616421] am65-cpsw-nuss c200000.ethernet: Use random MAC address
[    1.622675] am65-cpsw-nuss c200000.ethernet: initialized cpsw ale version 1.4
[    1.629793] am65-cpsw-nuss c200000.ethernet: ALE Table size 64
[    1.635910] am65-cpsw-nuss c200000.ethernet: CPTS ver 0x4e8a010b, freq:200000000, add_val:4 pps:0
[    2.152066] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000
[    2.164927] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4
[    2.172134] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
[    2.182401] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:500000000, add_val:1 pps:1
[    2.192279] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
[    2.199929] am65-cpsw-nuss c000000.ethernet: initializing am65 cpsw nuss version 0x6BA03102, cpsw version 0x6BA82902 Ports: 9 quirks:00000000
[    2.326304] am65-cpsw-nuss: probe of c000000.ethernet failed with error -110
[    2.387692] am65-cpsw-nuss c200000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000
[    2.400439] am65-cpsw-nuss c200000.ethernet: Use random MAC address
[    2.406694] am65-cpsw-nuss c200000.ethernet: initialized cpsw ale version 1.4
[    2.413812] am65-cpsw-nuss c200000.ethernet: ALE Table size 64
[    2.419927] am65-cpsw-nuss c200000.ethernet: CPTS ver 0x4e8a010b, freq:200000000, add_val:4 pps:0
[    2.429729] am65-cpsw-nuss c200000.ethernet: set new flow-id-base 82
[    4.857992] systemd[1]: /lib/systemd/system/bt-enable.service:9: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, a.
[    4.917741] systemd[1]: /etc/systemd/system/sync-clocks.service:11: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file.
[   10.768388] am65-cpsw-nuss c200000.ethernet eth1: PHY [c200f00.mdio:00] driver [TI DP83867] (irq=POLL)
[   10.777836] am65-cpsw-nuss c200000.ethernet eth1: configuring for phy/rgmii-rxid link mode
[   10.799784] am65-cpsw-nuss 46000000.ethernet eth0: PHY [46000f00.mdio:00] driver [TI DP83867] (irq=POLL)
[   10.809264] am65-cpsw-nuss 46000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
[   13.900014] am65-cpsw-nuss 46000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   13.908755] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    error -110
 and When i disable the 
&serdes_wiz2 {
status = "okay";
 /*assigned-clock-parents = <&k3_clks 406 9>;*/ /*disable*/
};

the eth1~4 will be create, but also can't work.

how can I fix it? 

thanks

dongzhang

  • Hi,

    Can you please tell me the purpose of you modifications in the device tree.

    What is the configuration you want to achieve?

    Regards,

    Tanmay

  • hi, 
        I need to use 4 network ports at the same time,


    serdes2:
    lane0 work at 1G 
    lane1 work at 1G 
    lane2 work at 10G 
    lane3 work at 10G 
    So I made some modifications based on k3-j784s4-evm-usxgmii-exp1-exp2 copy.dtso

    but got the error,[    2.326304] am65-cpsw-nuss: probe of c000000.ethernet failed with error -110

    thanks

    dongzhang

  • Hi,

    Sorry, missed that you had posted this earlier.

    Can you provide the values for the following registers:

    • 0x05020404
    • 0x05020408
    • 0x0502040C
    • 0x05020480
    • 0x05020484
    • 0x05020488
    • 0x0502048C
    • 0x050204C0
    • 0x050204C4
    • 0x050204C8
    • 0x050204CC
    • 0x05020500
    • 0x05020504
    • 0x05020508
    • 0x0502050C
    • 0x05020540
    • 0x05020544
    • 0x05020548
    • 0x0502054C
    • 0x0502E000

    Also, I think the device you are using is TDA4VH not TDA4VM. Can you confirm this.

    Regards,
    Tanmay

  • Sorry,Is TDA4VH
    when close  /*assigned-clock-parents = <&k3_clks 406 9>;*/

    root@j784s4-evm:~# ./test_reg.sh 
    /dev/mem opened.
    Memory mapped at address 0xffffa2c62000.
    Read at address  0x05020404 (0xffffa2c62404): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffffabef4000.
    Read at address  0x05020408 (0xffffabef4408): 0x18100000
    /dev/mem opened.
    Memory mapped at address 0xffffbb1d3000.
    Read at address  0x0502040C (0xffffbb1d340c): 0xA2800000
    /dev/mem opened.
    Memory mapped at address 0xffff905c2000.
    Read at address  0x05020480 (0xffff905c2480): 0x70000000
    /dev/mem opened.
    Memory mapped at address 0xffffab146000.
    Read at address  0x05020484 (0xffffab146484): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffff9c348000.
    Read at address  0x05020488 (0xffff9c348488): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff9afe3000.
    Read at address  0x0502048C (0xffff9afe348c): 0x00000002
    /dev/mem opened.
    Memory mapped at address 0xffff86b8a000.
    Read at address  0x050204C0 (0xffff86b8a4c0): 0x70000000
    /dev/mem opened.
    Memory mapped at address 0xffffbf240000.
    Read at address  0x050204C4 (0xffffbf2404c4): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffff90ed0000.
    Read at address  0x050204C8 (0xffff90ed04c8): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff85a11000.
    Read at address  0x050204CC (0xffff85a114cc): 0x00000002
    /dev/mem opened.
    Memory mapped at address 0xffff889a5000.
    Read at address  0x05020500 (0xffff889a5500): 0x703C00C0
    /dev/mem opened.
    Memory mapped at address 0xffff9cd55000.
    Read at address  0x05020504 (0xffff9cd55504): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffffaba61000.
    Read at address  0x05020508 (0xffffaba61508): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff8f1c7000.
    Read at address  0x0502050C (0xffff8f1c750c): 0x00000012
    /dev/mem opened.
    Memory mapped at address 0xffffb1b09000.
    Read at address  0x05020540 (0xffffb1b09540): 0x703C00C0
    /dev/mem opened.
    Memory mapped at address 0xffff8343b000.
    Read at address  0x05020544 (0xffff8343b544): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffff88eb9000.
    Read at address  0x05020548 (0xffff88eb9548): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff97915000.
    Read at address  0x0502054C (0xffff9791554c): 0x00000012
    /dev/mem opened.
    Memory mapped at address 0xffffafbb1000.
    Read at address  0x0502E000 (0xffffafbb1000): 0x00C30051
    

    when enable it

    root@j784s4-evm:~# ./test_reg.sh 
    /dev/mem opened.
    Memory mapped at address 0xffff8d97a000.
    Read at address  0x05020404 (0xffff8d97a404): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff89a78000.
    Read at address  0x05020408 (0xffff89a78408): 0x18100000
    /dev/mem opened.
    Memory mapped at address 0xffff93686000.
    Read at address  0x0502040C (0xffff9368640c): 0xA2800000
    /dev/mem opened.
    Memory mapped at address 0xffff95865000.
    Read at address  0x05020480 (0xffff95865480): 0x70000000
    /dev/mem opened.
    Memory mapped at address 0xffff8fde3000.
    Read at address  0x05020484 (0xffff8fde3484): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffff99677000.
    Read at address  0x05020488 (0xffff99677488): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffffa76a7000.
    Read at address  0x0502048C (0xffffa76a748c): 0x00000002
    /dev/mem opened.
    Memory mapped at address 0xffffb3789000.
    Read at address  0x050204C0 (0xffffb37894c0): 0x70000000
    /dev/mem opened.
    Memory mapped at address 0xffffa6980000.
    Read at address  0x050204C4 (0xffffa69804c4): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffffbee1e000.
    Read at address  0x050204C8 (0xffffbee1e4c8): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff95fae000.
    Read at address  0x050204CC (0xffff95fae4cc): 0x00000002
    /dev/mem opened.
    Memory mapped at address 0xffff8d73a000.
    Read at address  0x05020500 (0xffff8d73a500): 0x703C00C0
    /dev/mem opened.
    Memory mapped at address 0xffffaf66d000.
    Read at address  0x05020504 (0xffffaf66d504): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffffb9db5000.
    Read at address  0x05020508 (0xffffb9db5508): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff9443e000.
    Read at address  0x0502050C (0xffff9443e50c): 0x00000012
    /dev/mem opened.
    Memory mapped at address 0xffff97d3a000.
    Read at address  0x05020540 (0xffff97d3a540): 0x703C00C0
    /dev/mem opened.
    Memory mapped at address 0xffff99fa3000.
    Read at address  0x05020544 (0xffff99fa3544): 0x00010002
    /dev/mem opened.
    Memory mapped at address 0xffff9c065000.
    Read at address  0x05020548 (0xffff9c065548): 0x00000000
    /dev/mem opened.
    Memory mapped at address 0xffff8eb3c000.
    Read at address  0x0502054C (0xffff8eb3c54c): 0x00000012
    /dev/mem opened.
    Memory mapped at address 0xffffb861f000.
    Read at address  0x0502E000 (0xffffb861f000): 0x00820050

    dongzhang

  • Unlocking this thread.

  • Hi,

    As you are using the SerDes for SGMII + USXGMII, you need to use as Multi-link configuration i.e. need to use two reference clocks ref, ref1 clock.
    SGMII -> refclk ->100MHz
    USXGMII -> ref1clk ->156.25MHz.

    Clock ID -> 5 , parent is 9
    Clock ID ->6, parent is 10

    Please refer to below TISCI document for clock IDs of SerDes2.
    https://software-dl.ti.com/tisci/esd/09_02_07/5_soc_doc/j784s4/clocks.html#clocks-for-serdes-10g2-device

    Best Regards,
    Sudheer

  • Hi,
      Sorry, I need to modify and test this problem in a few days.
    Thanks
    Dongzhang

  • Hi,

      Sorry, I need to modify and test this problem in a few days.

    Sure, Please check with above suggested changes and let us know if you are still having an issue.

    Best Regards,
    Sudheer