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: Issues adding new switch port to the switch.

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Setup :

Board : J784s4_evm

Test on processors R5F : mcu2_0, mcu2_1, mcu3_0, mcu3_1, mcu4_0  and mpu : A72 in SD card boot mode

SDK version : 9.01

Processors OS : linux , FreeRTOS

Test : Adding processors to the ethernet network with the switch CPSW_9g. Current config : mcu2_0 as server, mpu and mcu2_1, 3_0, 3_1, 4_0 connected in switch port only as clients

Context :

Hello Ti members,

I'm currently trying to connect as many R5F processors as possible to the switch CPSW_9g with the ethernet firmware given. 

I worked step by step adding one new clients at a time, and all the processors were added sucessfuly until the mcu4_0.

After investigation, it seems the issue come from adding the 5th switch port to connect the mcu4_0 to the switch.

 

So my question is : Is there a limitation to the number of switch port we can add to the switch ?

Thank you in advance and if you have any question, please ask.

Regards,

Matthias

  • Hi,

    So my question is : Is there a limitation to the number of switch port we can add to the switch ?

    Yes, CPSW9G has Max of 8 Tx channels allowed with UDMA using PSIL threads.

    Out of 8, 3 are using in EthFw So, client can use Max of 5. If we remove MAC only Ports we can increase to 5 clients. But, Ethfw has virtual Switch Port numbers are defined to 4 from "EthRemoteCfg_VirtPort_e" (reason might be other SoCs may not have MCU4_0 and MCU4_1 cores, also few are MAC only Ports which also will use resources)

    Please refer to User Guide for more details.


    If you want 5th virtual switch client you can add Switch Port Macro in "EthRemoteCfg_VirtPort_e"  at end and use it, same to be used in clients as well.


    Best Regards,
    Sudheer

  • Hi,

    Thank you for your response.

    I indeed constated the limitation in Tx channels, this is why I removed the MAC only ports, the AUTOSAR configuration (I use FreeRTOS) and the PTP and SW interVLAN ch so the server take only one Tx channel.

    I have tested each configuration separetly and validate those modification before adding the 5th clients ( I also tried to add the 5th clients without disabling those Tx ch out of desperation but nothing work). 

    I have added the modification you proposed in ethremotecfg_virtport.h and cpsw_proxy_server.h  as shown below :

    I also validated the mcu4_0 client by interchanging the switch_port_3 and 4 with the mcu3_1 client. The mcu4_0 worked well but not the mcu3_1, so the issue is due to the new declared switch_port_4.

    I get those errors on A72 and mcu2_0 server display: 

    As you can see the A72 doesn't work too. It's weird because the A72 tried to add a new virtport 9 but I never asked him to do that. It's seems like there is a memory conflict between the new born switch_port_4 and the A72 setup.

    I don't know if you have more information on your side, if that the case I'm eager to hear that.

    Regards,

    Matthias

  • Hi,

    As you can see the A72 doesn't work too. It's weird because the A72 tried to add a new virtport 9 but I never asked him to do that. It's seems like there is a memory conflict between the new born switch_port_4 and the A72 setup.

    It seems like you have enabled MAC Only Port mapping to A72 client (MPU1_0) under "gEthApp_allocCfg".

    Can you check by Disabling MAC Only Macro (ENABLE_MAC_ONLY_PORTS) itself.

    Best Regards,
    Sudheer

  • Hello, 

    Yes I already commented the ENABLE_MAC_ONLY_PORTS macro in concerto.mak files, so it's weird that it try to enable a MAC port. I tried to run the program by commenting the .virtMacPortMask in gEthApp_allocCfg too but it's the same error. 

    I allocated the client mcu4_0 in the A6000000 adresses maybe it's link to that... 

    Below is the screen of the memory map of the mcu2_0 and mcu3_1

    On the other hand I tried to add the switch_port_4 with the changes evoqued before without adding the mcu4_0. I get a different error linked to the switch port :

    So it's seems that adding a new client bring conflict with the A72 core, and adding the switch port with the changes I described before doesn't work.

  • Hi,

    Also, can you please check by increasing the "ENET_CFG_RX_FLOWS_NUM"
    Can you please share changes made by you from TI SDK as a patch for review.

    FYI,
    We haven't validated with more clients it may conflict with resources and memory requirement.


    Best Regards,
    Sudheer

  • Hello,

    Sure, I made a patch from default SDK to the Add_newSWport file with only the add-on the new switchport tested on the mcu2_1 client. Those changement doesn't seems to work on their hown because I can't ping the mcu2_1 client.

    The patch is linked below. I couldn't insert the file as a .patch so it's a .txt but you can convert it back.

    diff --git a/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/concerto.mak b/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/concerto.mak
    index 2bc9b4a..04c4598 100755
    --- a/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/concerto.mak
    +++ b/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/concerto.mak
    @@ -38,7 +38,7 @@ ifeq ($(TARGET_PLATFORM),J7200)
     endif
     
     # Enable MAC-only ports. Comment out for switch only ports
    -DEFS += ENABLE_MAC_ONLY_PORTS
    +#DEFS += ENABLE_MAC_ONLY_PORTS
     
     ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
       DEFS += MAKEFILE_BUILD
    @@ -114,7 +114,7 @@ ifeq ($(TARGET_PLATFORM),J7200)
     endif
     
     # Enable MAC-only ports. Comment out for switch only ports
    -DEFS += ENABLE_MAC_ONLY_PORTS
    +#DEFS += ENABLE_MAC_ONLY_PORTS
     
     ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
       DEFS += MAKEFILE_BUILD
    diff --git a/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/main.c b/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/main.c
    index 6db78f5..770a1c1 100644
    --- a/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/main.c
    +++ b/ethfw/apps/app_remoteswitchcfg_client/mcu_2_1/main.c
    @@ -414,7 +414,7 @@ CpswRemoteApp_Obj gRemoteAppObj =
         {
             {
                 .hCpswProxy  = NULL,
    -            .virtPort    = ETHREMOTECFG_SWITCH_PORT_1,
    +            .virtPort    = ETHREMOTECFG_SWITCH_PORT_4,
                 .macPorts    = gRemoteAppMacPorts,
                 .numMacPorts = ENET_ARRAYSIZE(gRemoteAppMacPorts),
                 .hwPushNum   = CPSW_CPTS_HWPUSH_2,
    diff --git a/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/concerto.mak b/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/concerto.mak
    index ea83f6c..92ed4f4 100755
    --- a/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/concerto.mak
    +++ b/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/concerto.mak
    @@ -40,10 +40,10 @@ ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
     endif
     
     # Comment out to disable QSGMII ports in J721E EVM
    -DEFS += ENABLE_QSGMII_PORTS
    +#DEFS += ENABLE_QSGMII_PORTS
     
     # Enable MAC-only ports. Comment out for switch only ports
    -DEFS += ENABLE_MAC_ONLY_PORTS
    +#DEFS += ENABLE_MAC_ONLY_PORTS
     
     ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
       ifeq ($(TARGET_PLATFORM),J7200)
    @@ -133,7 +133,7 @@ endif
     DEFS += ENABLE_QSGMII_PORTS
     
     # Enable MAC-only ports. Comment out for switch only ports
    -DEFS += ENABLE_MAC_ONLY_PORTS
    +# DEFS += ENABLE_MAC_ONLY_PORTS
     
     ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
       ifeq ($(TARGET_PLATFORM),J7200)
    @@ -218,7 +218,7 @@ DEFS += ENABLE_QSGMII_PORTS
     # Enable MAC-only ports. Comment out for switch only ports
     # Disabled in profiling setting as there is single port
     ifneq ($(ETHFW_BOOT_TIME_PROFILING),yes)
    -  DEFS += ENABLE_MAC_ONLY_PORTS
    +  #DEFS += ENABLE_MAC_ONLY_PORTS
     endif
     
     ifneq ($(filter $(TARGET_OS),FREERTOS SAFERTOS),)
    diff --git a/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c b/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c
    index b13b96e..8e1a6d4 100644
    --- a/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c
    +++ b/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c
    @@ -201,7 +201,7 @@
     
     /* Default virtual port mask for shared multicast addresses: all virtual switch ports */
     #define ETHAPP_DFLT_VIRT_PORT_MASK              (ETHFW_BIT(ETHREMOTECFG_SWITCH_PORT_0) | \
    -                                                 ETHFW_BIT(ETHREMOTECFG_SWITCH_PORT_1) | \
    +                                                 ETHFW_BIT(ETHREMOTECFG_SWITCH_PORT_4) | \
                                                      ETHFW_BIT(ETHREMOTECFG_SWITCH_PORT_2))
     
     #if defined(SAFERTOS)
    @@ -609,7 +609,7 @@ static EthFw_VirtPortCfg gEthApp_virtPortCfg[] =
         },
         {
             .remoteCoreId = IPC_MCU2_1,
    -        .portId       = ETHREMOTECFG_SWITCH_PORT_1,
    +        .portId       = ETHREMOTECFG_SWITCH_PORT_4,
         },
     #if defined(ENABLE_MAC_ONLY_PORTS)
         {
    @@ -627,7 +627,7 @@ static EthFw_VirtPortCfg gEthApp_autosarVirtPortCfg[] =
     {
         {
             .remoteCoreId = IPC_MCU2_1,
    -        .portId       = ETHREMOTECFG_SWITCH_PORT_1,
    +        .portId       = ETHREMOTECFG_SWITCH_PORT_4,
         },
         {
             .remoteCoreId = IPC_MCU1_0,
    @@ -640,7 +640,7 @@ static EthFw_AllocCfg gEthApp_allocCfg[] =
             {
                 .clientId = ETHREMOTECFG_CLIENTID_AUTOSAR,
                 .remoteProcId = IPC_MCU2_1,
    -            .virtSwitchPortMask = ENET_MACPORT_MASK(ETHREMOTECFG_SWITCH_PORT_1),
    +            .virtSwitchPortMask = ENET_MACPORT_MASK(ETHREMOTECFG_SWITCH_PORT_4),
     #if defined(ENABLE_MAC_ONLY_PORTS)
                 .virtMacPortMask = 0,
     #endif
    @@ -656,7 +656,7 @@ static EthFw_AllocCfg gEthApp_allocCfg[] =
             {
                 .clientId = ETHREMOTECFG_CLIENTID_RTOS,
                 .remoteProcId = IPC_MCU2_1,
    -            .virtSwitchPortMask = ENET_MACPORT_MASK(ETHREMOTECFG_SWITCH_PORT_1),
    +            .virtSwitchPortMask = ENET_MACPORT_MASK(ETHREMOTECFG_SWITCH_PORT_4),
     #if defined(ENABLE_MAC_ONLY_PORTS)
                 .virtMacPortMask = ENET_MACPORT_MASK(ETHREMOTECFG_MAC_PORT_4),
     #endif
    @@ -746,6 +746,8 @@ static uint32_t gEthApp_remoteClientPrivVlanIdMap[ETHREMOTECFG_SWITCH_PORT_LAST+
         [ETHREMOTECFG_SWITCH_PORT_0] = 1100U, /* Linux client */
         [ETHREMOTECFG_SWITCH_PORT_1] = 1200U, /* AUTOSAR or RTOS client */
         [ETHREMOTECFG_SWITCH_PORT_2] = 1300U, /* AUTOSAR client */
    +    [ETHREMOTECFG_SWITCH_PORT_3] = 1400U, /* AUTOSAR or RTOS client */
    +    [ETHREMOTECFG_SWITCH_PORT_4] = 1500U, /* AUTOSAR or RTOS client */
     };
     #endif
     
    diff --git a/ethfw/ethremotecfg/protocol/ethremotecfg_virtport.h b/ethfw/ethremotecfg/protocol/ethremotecfg_virtport.h
    index c8461bb..2fe2721 100644
    --- a/ethfw/ethremotecfg/protocol/ethremotecfg_virtport.h
    +++ b/ethfw/ethremotecfg/protocol/ethremotecfg_virtport.h
    @@ -106,16 +106,19 @@ typedef enum EthRemoteCfg_VirtPort_e
         ETHREMOTECFG_SWITCH_PORT_0,
     
         /*! Virtual switch port 1. */
    -    ETHREMOTECFG_SWITCH_PORT_1,
    +    ETHREMOTECFG_SWITCH_PORT_1, //for the client mcu2_1
     
         /*! Virtual switch port 2. */
    -    ETHREMOTECFG_SWITCH_PORT_2,
    +    ETHREMOTECFG_SWITCH_PORT_2, //for the client mcu3_0
     
         /*! Virtual switch port 3. */
    -    ETHREMOTECFG_SWITCH_PORT_3,
    +    ETHREMOTECFG_SWITCH_PORT_3, //for the client mcu3_1
    +
    +    /*! Virtual switch port 4. */
    +    ETHREMOTECFG_SWITCH_PORT_4,  //this new switch port will be needed for the client mcu4_0
     
         /*! Last virtual switch port id. */
    -    ETHREMOTECFG_SWITCH_PORT_LAST = ETHREMOTECFG_SWITCH_PORT_3,
    +    ETHREMOTECFG_SWITCH_PORT_LAST = ETHREMOTECFG_SWITCH_PORT_4,
     
         /*! Virtual MAC port 1. */
         ETHREMOTECFG_MAC_PORT_1,
    diff --git a/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h b/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h
    index b3cf9cf..b86633a 100644
    --- a/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h
    +++ b/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h
    @@ -176,7 +176,7 @@ extern "C" {
     #define CPSWPROXYSERVER_REMOTE_CLIENT_PORTS_MAX       (2U)
     
     /*! Max number of remote client virtual ports */
    -#define CPSWPROXYSERVER_REMOTE_CLIENT_VIRTPORT_MAX    (4U)
    +#define CPSWPROXYSERVER_REMOTE_CLIENT_VIRTPORT_MAX    (5U)
     
     /*!
      * \brief Application callback function pointer to initialize Ethernet Firmware data
    

    Thank you for your help.

    Regards,

    Matthias

  • Hi, 

    May I know are there any other modifications made ? 

    How Tx channels are controlled for the allocation to ETHFW? 

    Also, have you tried for the flows increasing as stated in above? 

    Best Regards, 

    Sudheer

  • Hello,

    Yes I tried to increase the ENET_CFG_RX_FLOWS_NUM value but I got the same error.

    Yes I did more modifications beside that :

    - Create a flag to enable or not AUTOSAR, because the default configuration give resources that I needed for my RTOS configuration.

    - Add the other R5F client (from the default mcu2_1 client) with the according modification in the server firmware

    - Modifiate enet driver so it support mcu4_0 and mcu4_1 and the intercore communications of the new clients

    - Disable PTP and SW interVLAN to liberate additional Tx ch

    - Disable MAC only port because it is not needed and it liberate additional Tx ch

    The patch file I gave you is a branch from the default firmware without all the modification listed. So the issue of the new virtual branch shouldn't be connected to the other modifications.

    I didn't give you the patch file from a branch with all the modications because it may be too big to review for the issue I encounter.

    From what I have tested it seems adding the mcu4_0 client with the memory allocation I defined doesn't cause any issue as long as I stay at 4 clients (my clients were : mcu2_1, mcu3_0, mcu4_0, A72, and when I had a 5th client like the mcu3_1, the A72 try to connect a virtport 9 as shown before). Maybe it's because the 5th client is suppose to be connected with the Tx channel of the initial virtual mac port of the A72, and it's still connected even if I have disable the mac port.

    I control the channel allocation for the mcu2_0 with the ethfw_api.c file. Then adding the clients in the mcu2_0 allocate dynamically the channels to the adresses specified.

    Regards,

    Matthias

  • Hi,

    May I know your use-case of having multiple ethernet clients? As TI SDK is not supporting multiple clients more than 4.

    Best Regards,
    Sudheer

  • Hello,

    We headed toward the TDA4VH soc because it has a 9 ports switch to connect more than 4 items to the switch, and we need the same amount of processors connected to treat those items.

    Do you know the reason why the SDK doesn't support more thant 4 clients ? Is it a software issue that we can solve on our own or it's precompiled files or HW issues ?  

    Thank you.

    Regards,

    Matthias

  • Hi,

    Do you know the reason why the SDK doesn't support more thant 4 clients ? Is it a software issue that we can solve on our own or it's precompiled files or HW issues ? 

    From SDK and User Manual we have reserved Tx channels for specific use on each core (server & clients).
    So, as per the resources usage SDK enabled only 3 client cores with MAC Only and Switch.

    It may not be an HW Issue, It will most likely SW Issue.

    Best Regards,
    Sudheer

  • Hi,

    Can you provide more information from the SDK team on what changes need to be made to have additional clients ?

    The issues seems to come from conflict with A72 sw on a Tx channel. And from the addition of more switch port. Maybe from the patch I provided, you could lead me on the additionnal changes needed to be made.

    Thank you in advance.

    Regards,

    Matthias

  • Hi,

    Let me check internally once, and get back to you.
    Can you please add prints inside alloc_rx_flow and share the log, where it was failing.

    Best Regards,
    Sudheer