Tool/software:
Hello Team,
On our custom board, previously we were working on below sdk version.
ti-processor-sdk-linux-j7-evm-08_01_00_07-Linux
ti-processor-sdk-rtos-j721e-evm-08_01_00_13
Now, we are migrating to below sdk version:
ti-processor-sdk-linux-adas-j721e-evm-09_02_00_05
ti-processor-sdk-rtos-j721e-evm-09_02_00_05
>On MCU_2_0 side, we ported the ethfw mac port changes. And on A72 side, we enabled cpsw_proxy_client driver.
We are able to ping to main interface to and from host and board (eth0).
> Now, we applied the below patch to enable VLAN.
diff --git a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c index 6b1b25d59..74f93a7ad 100644 --- a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c +++ b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/apps/app_remoteswitchcfg_server/mcu_2_0/main.c @@ -377,6 +377,13 @@ static void EthApp_startSwInterVlan(char *recvBuff, static void EthApp_startHwInterVlan(char *recvBuff, char *sendBuff); #endif +static int32_t EthApp_addRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + +static void EthApp_delRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); static void EthApp_lwipMain(void *a0, void *a1); @@ -1310,6 +1317,10 @@ static int32_t EthApp_initEthFw(void) } } + /* Set static configuration functions */ + ethFwCfg.addStaticCfg = &EthApp_addRemoteCoreStaticCfg; + ethFwCfg.delStaticCfg = &EthApp_delRemoteCoreStaticCfg; + #if defined(ETHFW_VEPA_SUPPORT) memcpy(ethFwCfg.vepaCfg.privVlanId, gEthApp_remoteClientPrivVlanIdMap, diff --git a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.c b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.c index 05f7bc36f..b3b303ec7 100644 --- a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.c +++ b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.c @@ -322,6 +322,12 @@ typedef struct CpswProxyServer_Obj_s CpswProxyServer_VirtPortCfg virtPortCfg[CPSWPROXYSERVER_REMOTE_CLIENT_VIRTPORT_MAX]; /* Number of remote virtual ports that remotes cores can attach to */ uint32_t numVirtPorts; + + /* Add static configuration that is applicable only to specific remote cores */ + CpswProxyServer_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + CpswProxyServer_delStaticCfg delStaticCfg; } CpswProxyServer_Obj; /* ========================================================================== */ @@ -1323,6 +1329,21 @@ static int32_t CpswProxyServer_registerMacHandlerCb(CpswProxyServer_ClientHandle macAddr[3U], macAddr[4U], macAddr[5U]); } + if (ENET_SOK == status) + { + if (hServer->addStaticCfg != NULL) + { + status = hServer->addStaticCfg(hServer->hEnet, hostId, flowIdxOffset); + + ETHFWTRACE_ERR_IF((status != ENET_SOK), status, "Failed to add static config for coreId=%u\n", hostId); + } + } + + if (status != ENET_SOK) + { + status = ETHREMOTECFG_CMDSTATUS_EFAIL; + } + return CPSWPROXY_ENET2RPMSG_ERR(status); } @@ -1424,6 +1445,16 @@ static int32_t CpswProxyServer_unregisterMacHandlerCb(CpswProxyServer_ClientHand macAddr[3U], macAddr[4U], macAddr[5U]); } + ETHFWTRACE_ERR_IF((status != ENET_SOK), status, "Failed EnetAppUtils_unregDstMacRxFlow\n"); + + if (ENET_SOK == status) + { + if (hServer->delStaticCfg != NULL) + { + hServer->delStaticCfg(hServer->hEnet, hostId, flowIdxOffset); + } + } + return CPSWPROXY_ENET2RPMSG_ERR(status); } @@ -2883,6 +2914,9 @@ int32_t CpswProxyServer_init(CpswProxyServer_Config_t *cfg) hServer->initDone = BTRUE; } + hServer->addStaticCfg = cfg->addStaticCfg; + hServer->delStaticCfg = cfg->delStaticCfg; + ETHFWTRACE_INFO("CpswProxyServer: initialization %s (core: mcu2_0)", (status == ETHFW_SOK) ? "completed" : "failed"); diff --git a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h index 79db799df..55af38214 100644 --- a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h +++ b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/cpsw_proxy_server.h @@ -175,6 +175,35 @@ extern "C" { /*! Max number of remote client virtual ports */ #define CPSWPROXYSERVER_REMOTE_CLIENT_VIRTPORT_MAX (6U) +/*! + * \brief Add static configuration. + * + * Add static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + * + * \return 0 if no error. Negative value otherwise. + */ +typedef int32_t (*CpswProxyServer_addStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + +/*! + * \brief Delete static configuration. + * + * Delete static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + */ +typedef void (*CpswProxyServer_delStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + + /*! * \brief Application callback function pointer to initialize Ethernet Firmware data * @@ -373,6 +402,12 @@ typedef struct CpswProxyServer_Config_s /*! Number of remote client alloc objects */ uint32_t numAllocObj; + + /* Add static configuration that is applicable only to specific remote cores */ + CpswProxyServer_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + CpswProxyServer_delStaticCfg delStaticCfg; } CpswProxyServer_Config_t; /*! diff --git a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/ethfw_api.c b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/ethfw_api.c index d95eb6203..db05dca71 100644 --- a/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/ethfw_api.c +++ b/ti-processor-sdk-rtos-j721e-evm-09_02_00_05/ethfw/ethremotecfg/server/src/ethfw_api.c @@ -148,7 +148,7 @@ #define ETHFW_MAC_ONLY_PORTS_VLAN_ID (0U) /*! VLAN id used for all MAC ports in switch mode (non MAC-only mode) */ -#define ETHFW_SWITCH_PORTS_VLAN_ID (3U) +#define ETHFW_SWITCH_PORTS_VLAN_ID (2U) /*! Max number of CPSW MAC ports supported */ #if defined(SOC_J721E) || defined(SOC_J784S4) @@ -228,6 +228,12 @@ typedef struct EthFw_Obj_s /* Number of remote clients with resource allocation */ uint32_t numClients; + + /* Add static configuration that is applicable only to specific remote cores */ + EthFw_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + EthFw_delStaticCfg delStaticCfg; } EthFw_Obj; typedef struct EthFw_Autosar_EpId_s @@ -873,6 +879,10 @@ void EthFw_initConfigParams(Enet_Type enetType, memset(config, 0, sizeof(*config)); + /* Initialize Static config function pointers */ + config->addStaticCfg = NULL; + config->delStaticCfg = NULL; + /* MAC port ownership */ config->ports = NULL; config->numPorts = 0U; @@ -979,6 +989,9 @@ EthFw_Handle EthFw_init(Enet_Type enetType, EnetAppUtils_assert(udmaCfg->hUdmaDrv != NULL); memset(&gEthFwObj, 0, sizeof(gEthFwObj)); + /* Save static config function pointers */ + gEthFwObj.addStaticCfg = config->addStaticCfg; + gEthFwObj.delStaticCfg = config->delStaticCfg; /* Get the allocated resources for all remote clients */ gEthFwObj.numClients = config->numAlloc; @@ -1291,6 +1304,9 @@ int32_t EthFw_initRemoteConfig(EthFw_Handle hEthFw) cfg.enabledPortMask = gEthFwObj.enabledPortMask; cfg.macOnlyPortMask = gEthFwObj.macOnlyPortMask; + /* Static configuration callbacks */ + cfg.addStaticCfg = gEthFwObj.addStaticCfg; + cfg.delStaticCfg = gEthFwObj.delStaticCfg; status = CpswProxyServer_init(&cfg); ETHFWTRACE_ERR_IF((status != ETHFW_SOK), status, "Failed to init CPSW Proxy"); @@ -1494,7 +1510,8 @@ static void EthFw_handleProfileInfoNotify(uint32_t hostId, /* Nothing to do */ } #ifdef ENABLE_ETH_STATS_DUMP -static void EthFw_printStatsNonZero(const char *pcString, uint64_t statVal) +static void EthFw_printStatsNonZero(const char *pcString, + uint64_t statVal) { if (0U != statVal) { @@ -1502,7 +1519,9 @@ static void EthFw_printStatsNonZero(const char *pcString, uint64_t statVal) } } -static void EthFw_printStatsWithIdxNonZero(const char *pcString, uint32_t idx, uint64_t statVal) +static void EthFw_printStatsWithIdxNonZero(const char *pcString, + uint32_t idx, + uint64_t statVal) { if (0U != statVal) { @@ -1568,20 +1587,20 @@ static void EthFw_printHostPortStats9G(CpswStats_HostPort_Ng *st) for (i = 0U; i < ENET_ARRAYSIZE(st->txPri); i++) { - EthFw_printStatsWithIdxNonZero(" txPri[%u] = %llu\n", i, st->txPri[i]); + EthFw_printStatsWithIdxNonZero(" txPri[%u] = %llu\n", i, st->txPri[i]); } for (i = 0U; i < ENET_ARRAYSIZE(st->txPriBcnt); i++) { - EthFw_printStatsWithIdxNonZero(" txPriBcnt[%u] = %llu\n", i, st->txPriBcnt[i]); + EthFw_printStatsWithIdxNonZero(" txPriBcnt[%u] = %llu\n", i, st->txPriBcnt[i]); } for (i = 0U; i < ENET_ARRAYSIZE(st->txPriDrop); i++) { - EthFw_printStatsWithIdxNonZero(" txPriDrop[%u] = %llu\n", i, st->txPriDrop[i]); + EthFw_printStatsWithIdxNonZero(" txPriDrop[%u] = %llu\n", i, st->txPriDrop[i]); } for (i = 0U; i < ENET_ARRAYSIZE(st->txPriDropBcnt); i++) { - EthFw_printStatsWithIdxNonZero(" txPriDropBcnt[%u] = %llu\n", i, st->txPriDropBcnt[i]); + EthFw_printStatsWithIdxNonZero(" txPriDropBcnt[%u] = %llu\n", i, st->txPriDropBcnt[i]); } }
Can you please help us here, what are we missing ?
Note : We are loading the mcu20 firmware from Linux.