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.

AM6422: Does u-boot2024.04 support to enable 2 ethernet ports?

Part Number: AM6422
Other Parts Discussed in Thread: TMDS64EVM, SK-AM64B

Tool/software:

I am using AM6422 and u-boot2024.04

the ethernet port1 which is defined in deveice tree works well under u-boot.

I want to enable the ethernet port 2 under u-boot for hardware test.

I know I must modify the dts for ethernet port 2.  And what else is needed also ?

  • Hello,

    First, which type of ethernet are you planning on enabling? I.e. CPSW or PRU_ICSSG ethernet?

    If you are using u-boot2024.04, are you using Linux SDK 10.1? Please let us know what SDK version you are using.

    Are you currently developing on a custom board using AM6422 or an AM64x EVM?

    In the past I have been able to enable the 2nd CPSW ethernet port on an AM62x with only DTS changes. This was back on uboot2023.04. I haven't tried on u-boot2024.04 and AM64x devices before. It may be worth trying to change the U-boot DTS first and see if there are issues.

    I've referenced the DTS changes I made to enable the 2nd CPSW ethernet port on AM62x below as a reference in case you are planning to enable CPSW ethernet on your AM64x board. 

     arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi | 35 +++++++++++++++++++--
     1 file changed, 33 insertions(+), 2 deletions(-)
    
    diff --git a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    index 4265b434..0b093edb 100644
    --- a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    +++ b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    @@ -146,7 +146,7 @@
     	reg-names = "cpsw_nuss", "mac_efuse";
     	/delete-property/ ranges;
     	/* This is WA because MDIO driver is not DM enabled */
    -	pinctrl-0 = <&main_mdio1_pins_default &main_rgmii1_pins_default>;
    +	pinctrl-0 = <&main_mdio1_pins_default &main_rgmii1_pins_default &main_rgmii2_pins_default>;
     	bootph-pre-ram;
     
     	cpsw-phy-sel@04044 {
    @@ -157,9 +157,40 @@
     };
     
     &cpsw_port2 {
    -	status = "disabled";
    +	phy-mode = "rgmii-rxid";
    +	phy-handle = <&cpsw3g_phy1>;
    +	bootph-pre-ram;
     };
     
    +&cpsw3g_mdio {
    +	cpsw3g_phy1: ethernet-phy@1 {
    +		reg = <1>;
    +		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    +		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    +		ti,min-output-impedance;
    +	};
    +};
    +
    +&main_pmx0 {
    +	main_rgmii2_pins_default: main-rgmii2-pins-default {
    +		pinctrl-single,pins = <
    +			AM62X_IOPAD(0x184, PIN_INPUT, 0) /* (AE23) RGMII2_RD0 */
    +			AM62X_IOPAD(0x188, PIN_INPUT, 0) /* (AB20) RGMII2_RD1 */
    +			AM62X_IOPAD(0x18c, PIN_INPUT, 0) /* (AC21) RGMII2_RD2 */
    +			AM62X_IOPAD(0x190, PIN_INPUT, 0) /* (AE22) RGMII2_RD3 */
    +			AM62X_IOPAD(0x180, PIN_INPUT, 0) /* (AD23) RGMII2_RXC */
    +			AM62X_IOPAD(0x17c, PIN_INPUT, 0) /* (AD22) RGMII2_RX_CTL */
    +			AM62X_IOPAD(0x16c, PIN_OUTPUT, 0) /* (Y18) RGMII2_TD0 */
    +			AM62X_IOPAD(0x170, PIN_OUTPUT, 0) /* (AA18) RGMII2_TD1 */
    +			AM62X_IOPAD(0x174, PIN_OUTPUT, 0) /* (AD21) RGMII2_TD2 */
    +			AM62X_IOPAD(0x178, PIN_OUTPUT, 0) /* (AC20) RGMII2_TD3 */
    +			AM62X_IOPAD(0x168, PIN_OUTPUT, 0) /* (AE21) RGMII2_TXC */
    +			AM62X_IOPAD(0x164, PIN_OUTPUT, 0) /* (AA19) RGMII2_TX_CTL */
    +		>;
    +	};
    +};
    +
    +
     &main_bcdma {
     	bootph-pre-ram;
     	reg = <0x00 0x485c0100 0x00 0x100>,
    -- 
    2.34.1
    

    -Daolin

  • Hi Daolin,

    1. I want to enable 2 CPSW ethernet ports. the first CPSW works well in u-boot. 

    2. I am using u-boot2024.04, but not using  Linux SDK 10.1.  I am using VxWorks7, not linux.

    3.we are currently developing on a custom board uing AM6422. And we reffer to the hardware desing of AM64x EVM board(TMDS64EVM) and SK-AM64B

    4.referring to  I have completed the DTS changes as flows, but the second CPSw is not probed through "dm tree" command info.

    &cpsw_port2 {
    + bootph-all;
    phy-mode = "rgmii-rxid";
    - phy-handle = <&cpsw3g_phy3>;
    + phy-handle = <&cpsw3g_phy1>;
    };

    &cpsw3g_mdio {
    @@ -662,6 +512,14 @@
    ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    };
    +

    + cpsw3g_phy1: ethernet-phy@1 {
    + bootph-all;
    + reg = <1>;
    + ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    + };
    };

  • Hello, 

    - phy-handle = <&cpsw3g_phy3>;
    + phy-handle = <&cpsw3g_phy1>;
    + cpsw3g_phy1: ethernet-phy@1 {
    + bootph-all;
    + reg = <1>;

    In your custom board, is the Ethernet PHY address for the 2nd CPSW port 1 or 3? Please note that on the TMDS64EVM, the PHY on 2nd CPSW port is actually at address 3 if I remember correctly.

    Are you able to see the 2nd CPSW port with "net list" command in U-boot?

    -Daolin

  • Are you able to see the 2nd CPSW port with "net list" command in U-boot? --- no

    In my custom board, the 1st CPSW port is 1, the 2nd is 2.

  • Hello,

    I just checked on the SK-AM64B EVM to see if its DTS enables the 2nd CPSW Ethernet port and if it works in U-boot (v2024.04). 

    It looks like the DTS (k3-am642-sk.dts) for SK-AM64B already enables the 2nd CPSW Ethernet port in U-boot and I verified this by checking that the 2nd CPSW port is detected and can obtain and IP address and send packets to a connected host PC. See the below log:

    U-Boot 2024.04-ti-g29d0c23d67ee (Nov 29 2024 - 11:41:54 +0000)
    
    SoC:  AM64X SR2.0 HS-FS
    Model: Texas Instruments AM642 SK
    Board: AM64B-SKEVM rev A
    DRAM: 2 GiB
    Core: 89 devices, 31 uclasses, devicetree: separate
    NAND: 0 MiB
    MMC:  mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:   serial@2800000
    Out:  serial@2800000
    Err:  serial@2800000
    Failed to probe prueth driver
    Net:  eth0: ethernet@8000000port@1, eth1: ethernet@8000000port@2
    Hit any key to stop autoboot: 0 
    => net list
    eth0 : ethernet@8000000port@1 1c:63:49:1a:d2:a9 active
    eth1 : ethernet@8000000port@2 70:ff:76:1f:42:ef 
    => setenv autoload n
    => dhcp
    ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
    am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed
    am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error
    link up on port 2, speed 1000, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 172.168.1.21 (1047 ms)
    => net list
    eth0 : ethernet@8000000port@1 1c:63:49:1a:d2:a9 
    eth1 : ethernet@8000000port@2 70:ff:76:1f:42:ef active
    => ping 172.168.1.1
    link up on port 2, speed 1000, full duplex
    Using ethernet@8000000port@2 device
    host 172.168.1.1 is alive
    =>

    I would suggest comparing the DTS of your custom board with the SK-AM64B custom board to see if there are any differences in configuring the CPSW ports. 

    Let us know if you have follow-up questions

    -Daolin

  • great, thanks a lot, I will compare the DTS. If I have any question, I will contact to you.

  • it works, thanks a lot!

    In addition to making changes to the main device tree source (k3-am642-evm.dts), I also updated the U-Boot-specific configuration in k3-am642-evm-u-boot.dtsi. And then the second CPSW port2 is detected.

    eg005692@9151fb7f3cb0:/opt/tisdk/board-support/ti-u-boot-2024.04+git$ git diff arch/arm/dts/k3-am642-evm-u-boot.dtsi
    diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi
    index 5d7cbe04..ad3030ab 100644
    --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi
    +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi
    @@ -137,6 +137,10 @@
            bootph-all;
    };

    +&cpsw3g_phy1 {
    +       bootph-all;
    +};
    +
    &rgmii1_pins_default {
            bootph-all;
    };
    @@ -162,7 +166,7 @@
    };

    &cpsw_port2 {
    -       status = "disabled";
    +       bootph-all;
    };

    &gpmc0 {

    => net list
    eth0 : ethernet@8000000port@1 1c:63:49:1d:2e:cd active
    eth1 : ethernet@8000000port@2 5e:3e:57:22:3b:78
    => printenv ethact
    ethact=ethernet@8000000port@1
    => setenv ethact ethernet@8000000port@2
    => net list
    eth0 : ethernet@8000000port@1 1c:63:49:1d:2e:cd active
    eth1 : ethernet@8000000port@2 5e:3e:57:22:3b:78
    => saveenv
    Saving Environment to MMC... Writing to MMC(0)... OK
    => dhcp
    link up on port 2, speed 1000, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 10.0.1.245 (1005 ms)
    Using ethernet@8000000port@2 device
    TFTP from server 10.0.1.1; our IP address is 10.0.1.245
    Filename 'pxelinux.0'.
    Load address: 0x82000000
    Loading: T ################################################## 25.9 KiB
    4.9 KiB/s
    done
    Bytes transferred = 26478 (676e hex)
    => net list
    eth0 : ethernet@8000000port@1 1c:63:49:1d:2e:cd
    eth1 : ethernet@8000000port@2 5e:3e:57:22:3b:78 active
    => ping 10.0.1.1
    link up on port 2, speed 1000, full duplex
    Using ethernet@8000000port@2 device
    host 10.0.1.1 is alive
    =>