dev(): Правки для перехода на новую версию mcu_plus_sdk_am64x_09_01_00_41
This commit is contained in:
parent
cb1c461102
commit
aad5a08dcc
@ -257,6 +257,8 @@ bool free_rtos::Eth::Open()
|
|||||||
|
|
||||||
EnetAppUtils_print("%s: Open enet driver\r\n", name_.c_str());
|
EnetAppUtils_print("%s: Open enet driver\r\n", name_.c_str());
|
||||||
|
|
||||||
|
EnetApp_driverInit();
|
||||||
|
|
||||||
status = EnetApp_driverOpen(enetType_, instId_);
|
status = EnetApp_driverOpen(enetType_, instId_);
|
||||||
if (ENET_SOK != status) {
|
if (ENET_SOK != status) {
|
||||||
EnetAppUtils_print("%s: fail to open enet driver\r\n", name_.c_str());
|
EnetAppUtils_print("%s: fail to open enet driver\r\n", name_.c_str());
|
||||||
|
|||||||
@ -53,12 +53,14 @@ void free_rtos::EthRxFlow::initRxFreePktQ(void * appPriv, EnetDma_PktQ * p_packe
|
|||||||
EnetDma_Pkt *pPktInfo;
|
EnetDma_Pkt *pPktInfo;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int32_t status;
|
int32_t status;
|
||||||
|
uint32_t scatterSegmentSize[1] = {ENET_MEM_LARGE_POOL_PKT_SIZE};
|
||||||
|
|
||||||
for (i = 0U; i < qCount; ++i)
|
for (i = 0U; i < qCount; ++i)
|
||||||
{
|
{
|
||||||
pPktInfo = EnetMem_allocEthPkt(appPriv,
|
pPktInfo = EnetMem_allocEthPkt(appPriv,
|
||||||
ENET_MEM_LARGE_POOL_PKT_SIZE,
|
ENETDMA_CACHELINE_ALIGNMENT,
|
||||||
ENETDMA_CACHELINE_ALIGNMENT);
|
1,
|
||||||
|
scatterSegmentSize);
|
||||||
EnetAppUtils_assert(pPktInfo != NULL);
|
EnetAppUtils_assert(pPktInfo != NULL);
|
||||||
|
|
||||||
ENET_UTILS_SET_PKT_APP_STATE(&pPktInfo->pktState, ENET_PKTSTATE_APP_WITH_FREEQ);
|
ENET_UTILS_SET_PKT_APP_STATE(&pPktInfo->pktState, ENET_PKTSTATE_APP_WITH_FREEQ);
|
||||||
@ -171,9 +173,9 @@ bool free_rtos::EthRxFlow::open(TEthMacPorts port_id, int32_t enetDmaRxChId, UBa
|
|||||||
rx_flow_idx_ = rxChInfo.rxFlowIdx;
|
rx_flow_idx_ = rxChInfo.rxFlowIdx;
|
||||||
dma_handle_ = rxChInfo.hRxCh;
|
dma_handle_ = rxChInfo.hRxCh;
|
||||||
|
|
||||||
if (rxChInfo.macAddressValid)
|
if (rxChInfo.numValidMacAddress != 0)
|
||||||
{
|
{
|
||||||
EnetUtils_copyMacAddr(mac_addr_.bytes, rxChInfo.macAddr);
|
EnetUtils_copyMacAddr(mac_addr_.bytes, rxChInfo.macAddr[0]);
|
||||||
mac_addr_.addr&= ETH_FRAME_MAC_ADDR_MASK;
|
mac_addr_.addr&= ETH_FRAME_MAC_ADDR_MASK;
|
||||||
|
|
||||||
eth_stack_.set_mac_address(mac_addr_.addr);
|
eth_stack_.set_mac_address(mac_addr_.addr);
|
||||||
@ -183,7 +185,6 @@ bool free_rtos::EthRxFlow::open(TEthMacPorts port_id, int32_t enetDmaRxChId, UBa
|
|||||||
EnetAppUtils_assert(rxChInfo.sizeThreshEn == 0U);
|
EnetAppUtils_assert(rxChInfo.sizeThreshEn == 0U);
|
||||||
EnetAppUtils_assert(rxChInfo.maxNumRxPkts >= numPkts[enetDmaRxChId]);
|
EnetAppUtils_assert(rxChInfo.maxNumRxPkts >= numPkts[enetDmaRxChId]);
|
||||||
EnetAppUtils_assert(rxChInfo.chIdx == port_id);
|
EnetAppUtils_assert(rxChInfo.chIdx == port_id);
|
||||||
EnetAppUtils_assert(rxChInfo.useDefaultFlow == true);
|
|
||||||
|
|
||||||
if (dma_handle_ == nullptr)
|
if (dma_handle_ == nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -71,30 +71,8 @@ void EnetApp_initLinkArgs(Enet_Type enetType,
|
|||||||
if (boardPhyCfg != NULL)
|
if (boardPhyCfg != NULL)
|
||||||
{
|
{
|
||||||
EnetPhy_initCfg(phyCfg);
|
EnetPhy_initCfg(phyCfg);
|
||||||
if ((ENET_ICSSG_DUALMAC == enetType) && (2U == instId))
|
|
||||||
{
|
|
||||||
phyCfg->phyAddr = CONFIG_ENET_ICSS0_PHY1_ADDR;
|
|
||||||
}
|
|
||||||
else if ((ENET_ICSSG_DUALMAC == enetType) && (3U == instId))
|
|
||||||
{
|
|
||||||
phyCfg->phyAddr = CONFIG_ENET_ICSS0_PHY2_ADDR;
|
|
||||||
}
|
|
||||||
else if ((ENET_ICSSG_SWITCH == enetType) && (1U == instId))
|
|
||||||
{
|
|
||||||
if (macPort == ENET_MAC_PORT_1)
|
|
||||||
{
|
|
||||||
phyCfg->phyAddr = CONFIG_ENET_ICSS0_PHY1_ADDR;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
phyCfg->phyAddr = CONFIG_ENET_ICSS0_PHY2_ADDR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnetAppUtils_assert(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
phyCfg->phyAddr = boardPhyCfg->phyAddr;
|
||||||
phyCfg->isStrapped = boardPhyCfg->isStrapped;
|
phyCfg->isStrapped = boardPhyCfg->isStrapped;
|
||||||
phyCfg->loopbackEn = false;
|
phyCfg->loopbackEn = false;
|
||||||
phyCfg->skipExtendedCfg = boardPhyCfg->skipExtendedCfg;
|
phyCfg->skipExtendedCfg = boardPhyCfg->skipExtendedCfg;
|
||||||
|
|||||||
@ -25,13 +25,15 @@ static void eth_initTxFreePktQ(void * appPriv, EnetDma_PktQ * p_packet_queue, ui
|
|||||||
{
|
{
|
||||||
EnetDma_Pkt *pPktInfo;
|
EnetDma_Pkt *pPktInfo;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
uint32_t scatterSegmentSize[1] = {ENET_MEM_LARGE_POOL_PKT_SIZE};
|
||||||
|
|
||||||
/* Initialize TX EthPkts and queue them to txFreePktInfoQ */
|
/* Initialize TX EthPkts and queue them to txFreePktInfoQ */
|
||||||
for (i = 0U; i < qCount; i++)
|
for (i = 0U; i < qCount; i++)
|
||||||
{
|
{
|
||||||
pPktInfo = EnetMem_allocEthPkt(appPriv,
|
pPktInfo = EnetMem_allocEthPkt(appPriv,
|
||||||
ENET_MEM_LARGE_POOL_PKT_SIZE,
|
ENETDMA_CACHELINE_ALIGNMENT,
|
||||||
ENETDMA_CACHELINE_ALIGNMENT);
|
1,
|
||||||
|
scatterSegmentSize);
|
||||||
EnetAppUtils_assert(pPktInfo != NULL);
|
EnetAppUtils_assert(pPktInfo != NULL);
|
||||||
|
|
||||||
ENET_UTILS_SET_PKT_APP_STATE(&pPktInfo->pktState, ENET_PKTSTATE_APP_WITH_FREEQ);
|
ENET_UTILS_SET_PKT_APP_STATE(&pPktInfo->pktState, ENET_PKTSTATE_APP_WITH_FREEQ);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user