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.

DRA821U: How to use CPSWng with u-boot

Part Number: DRA821U
Other Parts Discussed in Thread: J7200XSOMXEVM

Tool/software:

Hi Team,

We have designed a custom board based on the J7200XSOMXEVM reference design.

We are developing the software for the custom board with PROCESSOR-SDK-LINUX-RT-J7200 (10.00.07.03).

The custom board uses three Ethernet ports: CPSW2g (MCU-RMII1) and CPSWng (RGMII2, RGMII3).

We want to use RGMII2 in u-boot to boot via NFS via TFTP, but RGMII2 is not recognized.

The CPSWng related settings in the device tree are written below.

	ethernet1_pins_default: ethernet1-default-pins {
		pinctrl-single,pins = <
			J721E_IOPAD(0x4c, PIN_INPUT, 4) /* (V19) MCAN5_RX.RGMII3_RD0 */
			J721E_IOPAD(0x50, PIN_INPUT, 4) /* (T13) MCAN6_TX.RGMII3_RD1 */
			J721E_IOPAD(0x54, PIN_INPUT, 4) /* (U14) MCAN6_RX.RGMII3_RD2 */
			J721E_IOPAD(0x58, PIN_INPUT, 4) /* (U16) MCAN7_TX.RGMII3_RD3 */
			J721E_IOPAD(0x48, PIN_INPUT, 4) /* (V21) MCAN5_TX.RGMII3_RXC */
			J721E_IOPAD(0x5c, PIN_INPUT, 4) /* (U15) MCAN7_RX.RGMII3_RX_CTL */
			J721E_IOPAD(0x60, PIN_OUTPUT, 4) /* (T15) MCAN8_TX.RGMII3_TD0 */
			J721E_IOPAD(0x64, PIN_OUTPUT, 4) /* (U19) MCAN8_RX.RGMII3_TD1 */
			J721E_IOPAD(0x68, PIN_OUTPUT, 4) /* (T14) MCAN9_TX.RGMII3_TD2 */
			J721E_IOPAD(0x6c, PIN_OUTPUT, 4) /* (U18) MCAN9_RX.RGMII3_TD3 */
			J721E_IOPAD(0x74, PIN_OUTPUT, 4) /* (U20) MCAN10_RX.RGMII3_TXC */
			J721E_IOPAD(0x70, PIN_OUTPUT, 4) /* (U17) MCAN10_TX.RGMII3_TX_CTL */
		>;
	};

	ethernet0_pins_default: ethernet0-default-pins {
		pinctrl-single,pins = <
			J721E_IOPAD(0x7c, PIN_INPUT, 4) /* (Y13) MCAN11_RX.RGMII2_RD0 */
			J721E_IOPAD(0x80, PIN_INPUT, 4) /* (AA15) MCAN12_TX.RGMII2_RD1 */
			J721E_IOPAD(0x84, PIN_INPUT, 4) /* (AA14) MCAN12_RX.RGMII2_RD2 */
			J721E_IOPAD(0x88, PIN_INPUT, 4) /* (AA18) MCAN13_TX.RGMII2_RD3 */
			J721E_IOPAD(0x78, PIN_INPUT, 4) /* (Y14) MCAN11_TX.RGMII2_RXC */
			J721E_IOPAD(0x8c, PIN_INPUT, 4) /* (AA16) MCAN13_RX.RGMII2_RX_CTL */
			J721E_IOPAD(0x90, PIN_OUTPUT, 4) /* (W17) MCAN15_TX.RGMII2_TD0 */
			J721E_IOPAD(0x94, PIN_OUTPUT, 4) /* (W20) MCAN15_RX.RGMII2_TD1 */
			J721E_IOPAD(0x98, PIN_OUTPUT, 4) /* (V14) UART2_RXD.RGMII2_TD2 */
			J721E_IOPAD(0x9c, PIN_OUTPUT, 4) /* (V13) UART2_TXD.RGMII2_TD3 */
			J721E_IOPAD(0x28, PIN_OUTPUT, 4) /* (W21) MCAN1_TX.RGMII2_TXC */
			J721E_IOPAD(0xa0, PIN_OUTPUT, 4) /* (U12) GPIO0_41.RGMII2_TX_CTL */
		>;
	};

	dp83867_mdio_pins_default: dp83867-mdio-default-pins {
		pinctrl-single,pins = <
			J721E_IOPAD(0xa8, PIN_OUTPUT, 5) /* (W19) UART8_TXD.MDIO0_MDC */
			J721E_IOPAD(0xa4, PIN_INPUT, 5) /* (W14) UART8_RXD.MDIO0_MDIO */
		>;
	};

	&cpsw0 {
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&ethernet0_pins_default>, <&ethernet1_pins_default>;
	};

	&cpsw0_port2 {
		status = "okay";
		phy-mode = "rgmii-rxid";
		phy-handle = <&cpsw5g_phy0>;
	};

	&cpsw0_port3 {
		status = "okay";
		phy-mode = "rgmii-rxid";
	};

	&cpsw5g_mdio {
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&dp83867_mdio_pins_default>;

		cpsw5g_phy0: ethernet0-phy@0 {
			reg = <0>;
			ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
			ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
			ti,min-output-impedance;
		};
	};

The cpsw driver included in u-boot (ti-u-boot-2024.04+git/drivers/net/ti/am65-cpsw-nuss.c) does not contain any description of "ti,j721e-cpswxg-nuss", but is it possible to use CPSWng with u-boot?

If possible, could you tell me how to set it up?

Regards,

mizutani

  • Hi,

    Yes, It is possible to set-up CPSWnG for u-boot.

    The device tree changes in the following files can act as reference for you.

    Serded2_cps9g_SGMII_u-boot_J784s4_08_06_00_12.zip

    Please ignore the changes for serdes in these files.

    I do not have a j7200 SDK 10.0 set of patches. Let me know if you face issues with this.

    Regards,
    Tanmay 

  • Hi,

    Based on the information provided, we modified the program and were able to confirm that it recognized CPSWng.

    am65_cpsw_nuss ethernet@c000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00294104 Ports:4
    Net:
    Warning: ethernet@c000000port@2 (eth1) using random MAC address - 52:35:73:d2:3b:af
    eth1: ethernet@c000000port@2
    348 bytes read in 2 ms (169.9 KiB/s)
    Loaded environment from MicroSD
    Hit any key to stop autoboot:  0
    => net list
    eth1 : ethernet@c000000port@2 52:35:73:d2:3b:af active

    However, when I assigned an IP address and checked with PING, it did not work.

    => setenv ipaddr 192.168.22.111
    => ping 192.168.22.1
    k3-navss-ringacc ringacc@3c000000: Ring Accelerator probed rings:1024, gp-rings[120,200] sci-dev-id:211
    k3-navss-ringacc ringacc@3c000000: dma-ring-reset-quirk: disabled
    am65_cpsw_nuss_port ethernet@c000000port@2: K3 CPSW: rflow_id_base: 4
    ethernet@c000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT !
    am65_cpsw_nuss_port ethernet@c000000port@2: phy_startup failed
    am65_cpsw_nuss_port ethernet@c000000port@2: am65_cpsw_start end error
    ping failed; host 192.168.22.1 is not alive

    The contents of the DP83867 registers obtained using mii and mdio are shown below.

    0 - 0x1140
    1 - 0x7949
    2 - 0x2000
    3 - 0xa231
    4 - 0x1e1
    5 - 0x0
    6 - 0x64
    7 - 0x2001
    8 - 0x0
    9 - 0x300
    10 - 0x0
    11 - 0x0
    12 - 0x0
    13 - 0x401f
    14 - 0xc1f
    15 - 0x3000
    16 - 0x5048
    17 - 0x302
    18 - 0x0
    19 - 0x40
    20 - 0x29c7
    21 - 0x0
    22 - 0x0
    23 - 0x40
    24 - 0x6150
    25 - 0x4040

    What can I do to track down the cause?

    Regards,

    mizutani

  • Hi,

    Let me compare the registers with my setup and get back to you.

    Regards,
    Tanmay

  • Hi,

    We found an error in the strap configuration of the DP83867.

    After correcting the strap configuration, we were able to confirm that the ping went through.

    Thank you for your assistance.

  • Great news....

    I am closing the ticket now. Please respond if you want to reopen this ticket again.

    Regards,
    Tanmay