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.

DRA821U: DRA821 sdk8.2 ethfw can not run on J7200-EVM

Part Number: DRA821U
Other Parts Discussed in Thread: DRA821

DRA821 sdk8.2 ethfw can not run on J7200-EVM, it display error message on UART console when run with CCS,

Enabling clocks!
=======================================================
CPSW Ethernet Firmware
=======================================================
ETHFW: Shared multicasts (software fanout):
01:00:5e:00:00:01
01:00:5e:00:00:fb
01:00:5e:00:00:fc
33:33:00:00:00:01
33:33:ff:1d:92:c2
01:80:c2:00:00:00
01:80:c2:00:00:03
ETHFW: Reserved multicasts:
01:80:c2:00:00:0e
01:1b:19:00:00:00
EnetMcm: CPSW_5G on MAIN NAVSS
EnetRm_open: Resource partition validation failed: -3
EnetMod_open: cpsw5g.rm: Failed to open: -3
Cpsw_openInternal: Failed to open RM: -3
Cpsw_closeInternal: Assertion @ Line: 930 in src/per/cpsw.c: hCpsw->hRxRsvdFlow != NULL
Enabling clocks!

===============================

after check the code, for now SDK8.2 ethfw support virtual ethernet port base IPC channel, it adds more MAC address, which is larger than system definition,

following modification can fix this issue

enet/examples/utils/enet_board_j7xevm.c

==============================
void EnetBoard_getMacAddrList(uint8_t macAddr[][ENET_MAC_ADDR_LEN],
uint32_t maxMacEntries,
uint32_t *pAvailMacEntries)
{
//#if !defined(ENETAPPUTILS_BYPASS_I2C)
#if 0 // use the fixed MAC address
uint8_t macAddrBuf[ENET_RM_NUM_MACADDR_MAX * BOARD_MAC_ADDR_BYTES];
Board_STATUS boardStatus;
uint32_t macAddrCnt, tempCnt;
uint32_t allocMacEntries = 0;
uint32_t i, j;

EnetAppUtils_assert(pAvailMacEntries != NULL);

if (Board_detectBoard(BOARD_ID_GESI))
{
/* Read number of MAC addresses in GESI board */
boardStatus = Board_readMacAddrCount(BOARD_ID_GESI, &macAddrCnt);
EnetAppUtils_assert(boardStatus == BOARD_SOK);
EnetAppUtils_assert(macAddrCnt <= ENET_RM_NUM_MACADDR_MAX);

/* Read MAC addresses */
boardStatus = Board_readMacAddr(BOARD_ID_GESI,
macAddrBuf,
sizeof(macAddrBuf),
&tempCnt);
EnetAppUtils_assert(boardStatus == BOARD_SOK);
EnetAppUtils_assert(tempCnt == macAddrCnt);

/* Save only those required to meet the max number of MAC entries */
macAddrCnt = EnetUtils_min(macAddrCnt, maxMacEntries);
for (i = 0U; i < macAddrCnt; i++)
{
ENET_UTILS_COMPILETIME_ASSERT(ENET_MAC_ADDR_LEN == BOARD_MAC_ADDR_BYTES);
memcpy(macAddr[i], &macAddrBuf[i * BOARD_MAC_ADDR_BYTES], ENET_MAC_ADDR_LEN);
}

allocMacEntries = macAddrCnt;
}

if (Board_detectBoard(BOARD_ID_ENET))
{
/* Read number of MAC addresses in QUAD Eth board */
boardStatus = Board_readMacAddrCount(BOARD_ID_ENET, &macAddrCnt);
EnetAppUtils_assert(boardStatus == BOARD_SOK);
EnetAppUtils_assert(macAddrCnt <= ENET_RM_NUM_MACADDR_MAX);

/* Read MAC addresses */
boardStatus = Board_readMacAddr(BOARD_ID_ENET,
macAddrBuf,
sizeof(macAddrBuf),
&tempCnt);
EnetAppUtils_assert(boardStatus == BOARD_SOK);
EnetAppUtils_assert(tempCnt == macAddrCnt);

/* Save only those required to meet the max number of MAC entries */
macAddrCnt = EnetUtils_min(macAddrCnt, maxMacEntries - allocMacEntries);
for (i = 0U, j = allocMacEntries; i < macAddrCnt; i++, j++)
{
ENET_UTILS_COMPILETIME_ASSERT(ENET_MAC_ADDR_LEN == BOARD_MAC_ADDR_BYTES);
memcpy(macAddr[j], &macAddrBuf[i * BOARD_MAC_ADDR_BYTES], ENET_MAC_ADDR_LEN);
}

allocMacEntries += macAddrCnt;
}

*pAvailMacEntries = allocMacEntries;

if (allocMacEntries == 0U)
{
EnetAppUtils_print("EnetBoard_getMacAddrList Failed - GESI/ENET board not present\n");
EnetAppUtils_assert(false);
}
#else
/*
* Workaround for EthFw/u-boot I2C conflicts:
* EthFw reads MAC addresses from GESI and QUAD_ETH boards during EthFw
* initialization which are stored in EEPROM memories and are read via
* I2C. These I2C accesses tend to occur around the same u-boot is also
* performing I2C accesses, causing transactions to timeout or other
* similar symptoms.
*
* I2C sharing is a known limitation but no current solution exists at
* this time. As a temporary workaround, EthFw will use fixed MAC
* addresses in Linux builds. For RTOS build, MAC addresses will still
* be read from EEPROM as such I2C contention isn't an problem.
*/
uint8_t macAddrBuf[][ENET_MAC_ADDR_LEN] =
{
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0x92U, 0xC1U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0x92U, 0xC2U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0x92U, 0xC3U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0x92U, 0xC4U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0x92U, 0xC5U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0X8BU, 0xC4U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0X8BU, 0xC5U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0X8BU, 0xC6U },
{ 0x70U, 0xFFU, 0x76U, 0x1DU, 0X8BU, 0xC7U },
};
uint32_t macAddrCnt = ENET_ARRAYSIZE(macAddrBuf);

/* Save only those required to meet the max number of MAC entries */
*pAvailMacEntries = EnetUtils_min(macAddrCnt, maxMacEntries);
memcpy(&macAddr[0U][0U], &macAddrBuf[0U][0U], *pAvailMacEntries * ENET_MAC_ADDR_LEN);
#endif
}

===========================

enet/examples/utils/V1/enet_apprmcfg.c

static EnetRm_ResPrms gEnetAppRmDefCfg_5G =
{
.coreDmaResInfo =
{
[0] =
{
.coreId = IPC_MPU1_0,
.numTxCh = 1U,
.numRxFlows = 1U,
.numMacAddress = 2U,    // change 1 to 2 to for virtual ethernet port
},
[1] =
{
.coreId = IPC_MCU2_0,
.numTxCh = 4U,
.numRxFlows = 5U,
.numMacAddress = 2U,
},
[2] =
{
.coreId = IPC_MCU2_1,
.numTxCh = 1U,
.numRxFlows = 2U,
.numMacAddress = 2U,
},
[3] =
{
.coreId = IPC_MCU1_0,
.numTxCh = 2U,
.numRxFlows = 2U,
.numMacAddress = 2U,
},
},
.numCores = 4U,
};