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.

AM3358: CPSW demo options

Part Number: AM3358

Hi. there


processors.wiki.ti.com/.../SK_ETH
According to the above URL, there are three modes in AM335x Starter Kit.

The three modes include switch mode, dual MAC mode, and gateway mode.

By default, the Starter kit’s Ethernet ports are automatically configured in dual-mac mode.

I can choose from ethernet submenu like this:
eth1 enable : dual-mac mode
ethe1_eth0 nat : gateway mode

Q1. How can I activate switch mode?

Q2. Is there a way to change the mode in the console?

Q3. How can I check if the switch mode is working properly?


Thank you in advance.

  • Hi,

    In the link provided by Biser is this section on how to enable dual emac, Dual EMAC Device tree entry, you will want to reverse these steps in the DTS file for the board and rebuild it.

    The decision whether to use switch mode or dual mac mode must be made at DTS build time. There is not an option to be able to change the mode at run time through the console. The mode choice is fundamental to how the driver initializes.

    The easiest way I can think of to check if the switch mode is working correctly is to daisy chain the two ports on the EVM-SK if you have it and see if the devices on either side of the switch are seeing network traffic. The switch of the AM335x should pass all traffic that is not intended for it.

    Best Regards,

    Schuyler


  • Dear. Schuyler

    Thank you for your answer.

    Here's the information I can provide:
    ======================================================
    Board : TMDSSK3358-AM335x Starter Kit.
    SDK : ti-processor-sdk-linux-am335x-evm-06.01.00.08-Linux-x86.
    ======================================================

    Q1. The driver configuration at the URL you provided is different from the driver configuration at what I have verified.
           what should I do?

          

           make menuconfig
           Device Drivers > Network device support > Ethernet driver support
           

    Q2. Should I modify the dts file like this? ( am335x-evmsk.dts )

    &mac {
      pinctrl-names = "default", "sleep";
      pinctrl-0 = <&cpsw_default>;
      pinctrl-1 = <&cpsw_sleep>;
      #dual_emac = <1>;
      status = "okay";
    };

    &davinci_mdio {
      pinctrl-names = "default", "sleep";
      pinctrl-0 = <&davinci_mdio_default>;
      pinctrl-1 = <&davinci_mdio_sleep>;
      status = "okay";
    };

    &cpsw_emac0 {
      phy_id = <&davinci_mdio>, <0>;
      phy-mode = "rgmii-txid";
      #dual_emac_res_vlan = <1>;
    };

    &cpsw_emac1 {
      phy_id = <&davinci_mdio>, <1>;
      phy-mode = "rgmii-txid";
      #dual_emac_res_vlan = <2>;
    };


    Regards,
    Simon

  • Hi,

    The modifications you have made to the DTS file are correct. Though you should not have to touch the kernel configuration or rebuild the kernel to get switch support.

    Best Regards,

    Schuyler