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.

TDA4VH-Q1: tda4vh linux native serdes4 sgmii issue

Part Number: TDA4VH-Q1

Hi Expert
I'm running into a problem with the SGMII SerDes4 lane2(sgmii7) lane3(sgmii8)Linux native driver in SDK 9.2:  
SEDES PLL isn't locked.

my dts:
&main_cpsw0 {
	status = "okay";
	pinctrl-names = "default";
};
&main_cpsw0_port7 {
	status = "okay";
	phy-mode = "sgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 7>, <&serdes4_sgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};

&main_cpsw0_port8 {
	status = "okay";
	phy-mode = "sgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 8>, <&serdes4_sgmii_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};
&serdes4 {
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;
    
    serdes4_sgmii_link: phy@0 {
        reg = <0>;
        cdns,num-lanes = <4>;
        #phy-cells = <0>;
        resets =  <&serdes_wiz4 1>, <&serdes_wiz4 2>,
                    <&serdes_wiz4 3>, <&serdes_wiz4 4>;
        cdns,phy-type = <PHY_TYPE_SGMII>;   
    };
};


&serdes_ln_ctrl {
	idle-states = 
		<J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_IP1_UNUSED>,
		<J784S4_SERDES0_LANE2_PCIE3_LANE0>, <J784S4_SERDES0_LANE3_IP4_UNUSED>,
		<J784S4_SERDES1_LANE0_PCIE0_LANE0>, <J784S4_SERDES1_LANE1_QSGMII_LANE4>,
		<J784S4_SERDES1_LANE2_PCIE2_LANE0>, <J784S4_SERDES1_LANE3_IP4_UNUSED>,
		<J784S4_SERDES2_LANE0_QSGMII_LANE5>, <J784S4_SERDES2_LANE1_QSGMII_LANE6>,
		<J784S4_SERDES2_LANE2_QSGMII_LANE1>, <J784S4_SERDES2_LANE3_QSGMII_LANE2>,
		<J784S4_SERDES4_LANE0_IP3_UNUSED>, <J784S4_SERDES4_LANE1_IP3_UNUSED>,
		<J784S4_SERDES4_LANE2_QSGMII_LANE7>, <J784S4_SERDES4_LANE3_QSGMII_LANE8>;
};
Scenario 1:
When I use the following configuration:
&serdes4 {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	/* SERDES4 lane2/3 for SGMII7/8 (2 lanes) */
	serdes4_sgmii_link: phy@2 {
		reg = <2>;
		cdns,num-lanes = <2>;
		#phy-cells = <0>;
		cdns,phy-type = <PHY_TYPE_SGMII>;
		resets = <&serdes_wiz4 3>, <&serdes_wiz4 4>;
	};
};

The system reports the following errors during boot:

[    2.331112] cdns-torrent-phy 5050000.serdes: Timeout waiting for CMN ready
[    2.337976] phy phy-5050000.serdes.14: phy poweron failed --> -110
[    2.344253] am65-cpsw-nuss: probe of c000000.ethernet failed with error -110
[    2.352586] debugfs: Directory 'pd:74' with parent 'pm_genpd' already present!


Scenario 2:
When I use the following configuration:
&serdes4 {
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;
    
    serdes4_sgmii_link: phy@0 {
        reg = <0>;
        cdns,num-lanes = <0>; // Note: num-lanes set to 0 here
        #phy-cells = <0>;
        //resets =  <&serdes_wiz4 3>, <&serdes_wiz4 4>;
        resets =  <&serdes_wiz4 1>, <&serdes_wiz4 2>,
                  <&serdes_wiz4 3>, <&serdes_wiz4 4>;
        cdns,phy-type = <PHY_TYPE_SGMII>;   
    };
};

The initial boot errors mentioned above do not occur.
root@j784s4-evm:~# devmem2 0x0010405c
/dev/mem opened.
Memory mapped at address 0xffffb116c000.
Read at address  0x0010405C (0xffffb116c05c): 0x0000000

root@j784s4-evm:~# devmem2 0x00104060
/dev/mem opened.
Memory mapped at address 0xffffbb136000.
Read at address  0x00104060 (0xffffbb136060): 0x00000003
root@j784s4-evm:~# ./j7_devmem2_cpsw9g_check_status.sh 
    Platform: J7 TDA4VH 
    Command:  k3conf  
MDIO_ALIVE_REG (0x0c000f08) = 0x00000000  
MDIO_LINK_REG (0x0c000f0c) = 0x00000000  
please input your port: 1-8 7
CTRLMMR_ENET 7 CTRL (0x0010405c) = 0x00000003  
        PORT_MODE_SEL          : 3h SGMII
        RGMII_ID_MODE          : 0h Internal Transmit Desaly
CPSW SS RGMII 7 STATUS (0x0c000048) = 0x00000000  
        FULLDUPLEX           : 0h Half duplex
        SPEED                : 0h 10Mbps
        LINK                 : 0h Links is down
CPSW_SS_STATUS_SGMII_LINK_REG (0x0c000078) = 0x00000000  
        SGMII1_LINK          : 0h No
CPSW_SS_SGMII_CONTROL_REG_ 7 (0x0c000710) = 0x00000000  
        TEST_PATTERN_EN      : 0h operation
        MASTER               : 0h Slave Mode
        LOOPBACK             : 0h Not in internal loopback mode
        MR_NP_LOADED         : 0h --------
        FAST_LINK_TIMER      : 0h link timer 10ms in FIBER mode and 1.6ms in SGMII mode
        MA_AN_RESTART        : 0h Write 1h and tehn 0h to this bit caused the auto negotiation
        MR_AN_ENABLE         : 0h wirte 1 to this bit enbales the auto negotiation progess
CPSW_SS_SGMII_STATUS_REG_ 7 (0x0c000714) = 0x00000000  
        LOCK                  : 0h SEDES PLL isn't locked
        MR_AN_COMPLETE        : 0h no AUTO Negotiation is not complete
        AN_EEROR              : 0h no negotiation error
        LINK                  : 0h link is not up
root@j784s4-evm:~# k3conf  dump clock 407
|------------------------------------------------------------------------------|
| VERSION INFO                                                                 |
|------------------------------------------------------------------------------|
| K3CONF | (version 0.3-nogit built Wed Mar 06 14:29:58 UTC 2024)              |
| SoC    | J784S4 SR1.0                                                        |
| SYSFW  | ABI: 3.1 (firmware version 0x0009 '9.0.6--v09.00.06 (Kool Koala))') |
|------------------------------------------------------------------------------|

|----------------------------------------------------------------------------------------------------------------------------------|
| Device ID | Clock ID | Clock Name                                                            | Status          | Clock Frequency |
|----------------------------------------------------------------------------------------------------------------------------------|
|   407     |     2    | DEV_SERDES_10G4_CLK                                                   | CLK_STATE_READY | 125000000       |
|   407     |     3    | DEV_SERDES_10G4_CMN_REFCLK_M                                          | CLK_STATE_READY | 0               |
|   407     |     3    | DEV_SERDES_10G4_CMN_REFCLK_M                                          | CLK_STATE_READY | 0               |
|   407     |     4    | DEV_SERDES_10G4_CMN_REFCLK_P                                          | CLK_STATE_READY | 0               |
|   407     |     4    | DEV_SERDES_10G4_CMN_REFCLK_P                                          | CLK_STATE_READY | 0               |
|   407     |     5    | DEV_SERDES_10G4_CORE_REF1_CLK                                         | CLK_STATE_READY | 156250000       |
|   407     |     6    | DEV_SERDES_10G4_CORE_REF_CLK                                          | CLK_STATE_READY | 100000000       |
|   407     |     7    | DEV_SERDES_10G4_CORE_REF_CLK_PARENT_GLUELOGIC_HFOSC0_CLKOUT           | CLK_STATE_READY | 19200000        |
|   407     |     8    | DEV_SERDES_10G4_CORE_REF_CLK_PARENT_BOARD_0_HFOSC1_CLK_OUT            | CLK_STATE_READY | 0               |
|   407     |     9    | DEV_SERDES_10G4_CORE_REF_CLK_PARENT_HSDIV4_16FFT_MAIN_3_HSDIVOUT4_CLK | CLK_STATE_READY | 156250000       |
|   407     |    10    | DEV_SERDES_10G4_CORE_REF_CLK_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT4_CLK | CLK_STATE_READY | 100000000       |
|   407     |    12    | DEV_SERDES_10G4_IP1_LN0_REFCLK                                        | CLK_STATE_READY | 0               |
|   407     |    13    | DEV_SERDES_10G4_IP1_LN0_RXCLK                                         | CLK_STATE_READY | 0               |
|   407     |    14    | DEV_SERDES_10G4_IP1_LN0_RXFCLK                                        | CLK_STATE_READY | 0               |
|   407     |    15    | DEV_SERDES_10G4_IP1_LN0_TXCLK                                         | CLK_STATE_READY | 0               |
|   407     |    16    | DEV_SERDES_10G4_IP1_LN0_TXFCLK                                        | CLK_STATE_READY | 0               |
New Issue:
However, after the system has been running for over 5 minutes, the following error appears:

root@j784s4-evm:~# ping 172.20.54.66
PING 172.20.54.66 (172.20.54.66): 56 data bytes
[ 337.058062] ------------[ cut here ]------------
[ 337.062681] NETDEV WATCHDOG: eth0 (am65-cpsw-nuss): transmit queue 0 timed out
[ 337.069914] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:525 dev_watchdog+0x214/0x220
[ 337.078172] Modules linked in: pci_endpoint_test overlay cfg80211 rfkill rpmsg_ctrl ti_am335x_adc kfifo_buf rpmsg_char omap_rng spidev crct10dif_ce phy_can_transceiver wave5 videobuf2_dma_contig pci_j76
[ 337.133466] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G O 6.1.80-ti-g2e423244f8c0 #1
[ 337.142317] Hardware name: Texas Instruments J784S4 EVM (DT)
[ 337.147959] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 337.154901] pc : dev_watchdog+0x214/0x220
[ 337.158898] lr : dev_watchdog+0x214/0x220
[ 337.162894] sp : ffff80000800be30
[ 337.166194] x29: ffff80000800be30 x28: 0000000000000005 x27: 0000000000000020
[ 337.173313] x26: ffff8000089fd550 x25: ffff8000091679c0 x24: ffff000f0bf2b1a8
[ 337.180430] x23: ffff800009167000 x22: 0000000000000000 x21: ffff000801a0839c
[ 337.187548] x20: ffff000801a08000 x19: ffff000801a08448 x18: ffffffffffffffff
[ 337.194665] x17: 6f2064656d697420 x16: 3020657565757120 x15: 74696d736e617274
[ 337.201783] x14: 203a297373756e2d x13: ffff800009181440 x12: 0000000000000744
[ 337.208900] x11: 000000000000026c x10: ffff8000091d9440 x9 : ffff800009181440
[ 337.216018] x8 : 00000000ffffefff x7 : ffff8000091d9440 x6 : 0000000000000000
[ 337.223135] x5 : ffff000f0bf2ab60 x4 : 0000000000000040 x3 : 0000000000000001
[ 337.230253] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008002de3c0
[ 337.237371] Call trace:
[ 337.239805] dev_watchdog+0x214/0x220
[ 337.243455] call_timer_fn.constprop.0+0x24/0x80
[ 337.248060] __run_timers.part.0+0x1f4/0x234
[ 337.252316] run_timer_softirq+0x3c/0x7c
[ 337.256224] _stext+0x124/0x28c
[ 337.259354] ____do_softirq+0x10/0x20
[ 337.263003] call_on_irq_stack+0x24/0x4c
[ 337.266911] do_softirq_own_stack+0x1c/0x30
[ 337.271080] __irq_exit_rcu+0xb4/0xe0
[ 337.274730] irq_exit_rcu+0x10/0x20
[ 337.278205] el1_interrupt+0x38/0x70
[ 337.281770] el1h_64_irq_handler+0x18/0x2c
[ 337.285853] el1h_64_irq+0x64/0x68
[ 337.289240] arch_cpu_idle+0x18/0x2c
[ 337.292803] default_idle_call+0x30/0x6c
[ 337.296712] do_idle+0x248/0x2c0
[ 337.299930] cpu_startup_entry+0x38/0x40
[ 337.303840] secondary_start_kernel+0x11c/0x140
[ 337.308356] __secondary_switched+0xb0/0xb4
[ 337.312526] ---[ end trace 0000000000000000 ]---
[ 337.317138] am65-cpsw-nuss c000000.ethernet eth0: txq:0 DRV_XOFF:0 tmo:8928 dql_avail:-38 free_desc:505
[ 343.202063] am65-cpsw-nuss c000000.ethernet eth0: txq:0 DRV_XOFF:0 tmo:14816 dql_avail:-38 free_desc:505
[ 348.066060] am65-cpsw-nuss c000000.ethernet eth0: txq:0 DRV_XOFF:0 tmo:19680 dql_avail:-38 free_desc:505



Best Regards,
James