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.

AM5716: Indipendant Ports with Dual Mac Mode

Part Number: AM5716

Hello Everyone

In the company I work the network is configured in a way where if a switch is connected the port used gets blocked. Because of that we want to use the Sitara AM571x in Dual Mac Mode to have two separate networks connected to the processor. Currently, I have the following setup:

I try to ping different connections:

PC A to Sitara Port 2: Possible (As expected)

PC A to Sitara Port 1: Not Possible(As expected)

PC B to Sitara Port 1: Possible (As expected)

PC B to Sitara Port 2: Not Possible (As expected)

PC A to PC B: Possible (Not as expected)

So my question is now if there is a way to configure the Sitara so no packages can be exchanged between PC A and PC B? We are usingTI-RTOS. For my test I used IPV6 Addresses because on what ever reason the Sitaras Port 1, and 2 can not be in the same subnet and because we want to use dhcp on Port 1 we do no use IPV4 on port 2 because you do not know the settings beforehand.

Kind Regards

Marco

  • Marco,

    I agree that PC A to PC B connection should not be expected with dual-MAC mode configured. Are you using the Processor RTOS or Linux package?

    Best regards,

    Dave

  • Dear Dave

    Thanks for the fast reply. We are using RTOS:

    XDCtools 3.50.7.20

    NDK 3.60.0.13

    SYS/BOS 6.73.0.12

    PDK 1.0.12


    To enable dual mac mode i add an aditinal entry to the NIMDeviceTable:

    NIMUDeviceTable[Index++].init =  &CpswEmacInit;
    NIMUDeviceTable[Index++].init =  &CpswEmacInit;
    NIMUDeviceTable[Index++].init =  NULL;

    Than i add static ips or a dhcp client to the interfaces. Am I missing a step?

    Regards Marco

  • Marco,

    Can you take a look at the dual-MAC example that's included for the AM572x in the SDK package? See <pdk>\packages\ti\transport\ndk\nimu\example\am572x\armv7\bios and compare the two idk config files. In the <pdk>\packages\ti\transport\ndk\nimu\example\src\main_AM57xx.c file you can see the additional setup performed for dual-MAC in the sections with #ifdef NIMU_DUAL_MAC_MODE

    Best regards,

    Dave

  • Dave,

    Thanks for the suggestion. I run the example on a idkAM571x development board with the same result. A ping from PC A to PC B is possible as well. The only thing I changed in the example is to use DHCP on Idx 2.

    Any ideas how to solve this? In some networks there are security mechanisms to prevent switches to be connected to the network. So if the Sitara AM571x is connected to a network with the above configuration the port could be blocked. Because we don't know how our customers networks are configured this could cause some serious issues.

  • Marco,

    I have an update, and indeed your observation is correct.

    As outlined in the TRM, section 24.11.4.8.5.2 (https://www.ti.com/lit/pdf/spruhz7), the CPSW can be put into dual MAC mode, with isolated paths as you are indicating. The emac driver does not have a configuration option for this setting, however. You can update these registers directly through CSL in your application after calling emac_open to over-ride what is done by the emac driver.

    Some additional background: The ALE is enabled by default by the emac driver to run in non-promiscuous mode with port state set to FORWARD. In this configuration, it does make sense that the PING will work as indicated by your observations. There is no port 2 port connection by the NDK stack, but the packet will get forwarded from one port to another by the CPSW sub-system.

    An alternate option to programming the VLAN-aware configuration outlined in the TRM section referenced above if you with to work within the emac driver: You can put the ALE in bypass mode to prevent packet forwarding from one port to another. In this mode all packets will only go to the host port . This can be done in EMAC_cpswSetALEPortCfg function (this is called during emac_open). After call to CSL_CPSW_enableAle you need to call CSL_CPSW_enableAleBypass (). 

    Code snippet:

    static void EMAC_cpswSetALECfg(void)

    {

        EMAC_Cpsw3gInitConfig*   cpsw3gCfg = &EMAC_LOCAL_DEVICE->Config;

        /* Local Pointer to Ale Configuration */

        EMAC_AleConfig*          lpAleConfig = &cpsw3gCfg->aleCfg;

     

        CSL_CPSW_clearAleTable((CSL_cpswHandle) cpsw3gCfg->baseConfig.ss_base);

        CSL_CPSW_enableAle((CSL_cpswHandle) cpsw3gCfg->baseConfig.ss_base);

     

        /* in AleByPass, all packets get sent to the host, all packets sent from application need to be directed */

        CSL_CPSW_enableAleBypass(((CSL_cpswHandle) cpsw3gCfg->baseConfig.ss_base);

        /* Clear out toggle bits */

        lpAleConfig->aleModeFlags &= ~(CPSW_CONFIG_ALE_CLRTABLE

                                     | CPSW_CONFIG_ALE_AGEOUTNOW);

     

        /* Configure ALE Prescale register */

        CSL_CPSW_setAlePrescaleReg((CSL_cpswHandle) cpsw3gCfg->baseConfig.ss_base, lpAleConfig->alePrescale);

    }

    Best regards,

    Dave

  • Dear Dave

    Thanks a lot for your help with the first few tests we did it looks like its working fine now.

    I placed the method you mentioned in the ndk's open hook. If someone is stumbling on this thread with a similar problem. Here is the include needed for the code above: #include <ti/csl/csl_cpswAux.h>. Further i had to change the ip of the second non dhcp using port to an ip outside of the other ports dhcp servers subnet mask otherwhise there was problem with the board sending dhcp requests declining them and sending dhcp requests over and over again till all ips are used up.

    Kind Regards

    Marco