Merge branch 'dev_ck_v2.1_whf' into 'dev_ck_v2.1'
oam修改dm获取方式 See merge request ucp/driver/ucp4008_platform_spu!15
This commit is contained in:
commit
f3dc68a2f2
@ -34,6 +34,7 @@ void phy_para_init(int32_t protocol, int32_t option)
|
||||
int32_t i = 0;
|
||||
|
||||
memset_ext((void*)PROTO_SEL_ADDR, 0, 0x1000); // init sm for drv, 0x0a4d7000~0x0a4d7FFF
|
||||
__ucps2_synch(0);
|
||||
|
||||
do_write(PROTO_SEL_ADDR, protocol);
|
||||
do_write(PROTO_OPT_ADDR, option);
|
||||
|
@ -128,6 +128,16 @@ typedef struct _tagCpriSetDelayRsp
|
||||
uint8_t u8rsv[2];
|
||||
}stCpriSetDelayRsp;
|
||||
|
||||
typedef struct _tagOamMsgTransferHeader {
|
||||
uint8_t numMsg;
|
||||
uint8_t cellIndex;
|
||||
uint16_t rsv;
|
||||
uint32_t msgType;
|
||||
uint32_t msgLen;
|
||||
uint32_t msgData[0];
|
||||
} stOamMsgTransferHeader;
|
||||
|
||||
|
||||
void cpri_delay_init();
|
||||
|
||||
void cpri_link_status_init();
|
||||
|
@ -30,9 +30,12 @@ typedef struct tEcsRfmDmLocalMgt {
|
||||
#ifdef INTEGRATED_BS
|
||||
|
||||
#endif
|
||||
|
||||
stFhAlarmStat* pAlarmStatus;
|
||||
stMtimerPara* pMtimerPara[MTIMER_MAX_NUM];
|
||||
stOamMsgTransferHeader* pOamMsgPtr;
|
||||
stCpriSetLinkDelay* pOamBaseDelaySetRspPtr ;
|
||||
stCpriGetLinkDelay* pOamBaseDelayQryRspPtr ;
|
||||
stCpriGetRndDelay* pOamFiberDelayQryRspPtr ;
|
||||
} EcsRfmDmLocalMgt_t;
|
||||
|
||||
EcsRfmDmLocalMgt_t* get_ecs_rfm_dm_local_mgt(void);
|
||||
|
@ -35,7 +35,12 @@ void ecs_rfm_dm_alloc(void)
|
||||
pEcsDmLocalMgt->pCpriDelay = (stCpriDelayMeasure*)memSectionAlloc(pMemSection, sizeof(stCpriDelayMeasure), MEM_ALIGNED_4BYTES, "pCpriDelay");
|
||||
#endif
|
||||
pEcsDmLocalMgt->pAlarmStatus = (stFhAlarmStat*)memSectionAlloc(pMemSection, sizeof(stFhAlarmStat), MEM_ALIGNED_4BYTES, "pAlarmStatus");
|
||||
for (int i = 0; i < MTIMER_MAX_NUM; i++)
|
||||
pEcsDmLocalMgt->pOamMsgPtr = (stOamMsgTransferHeader*)memSectionAlloc(pMemSection, sizeof(stOamMsgTransferHeader), MEM_ALIGNED_4BYTES, "pOamMsg");
|
||||
pEcsDmLocalMgt->pOamBaseDelaySetRspPtr = (stCpriSetLinkDelay*)memSectionAlloc(pMemSection, sizeof(stCpriSetLinkDelay), MEM_ALIGNED_4BYTES, "pOamBaseDelaySetRsp");
|
||||
pEcsDmLocalMgt->pOamBaseDelayQryRspPtr = (stCpriGetLinkDelay*)memSectionAlloc(pMemSection, sizeof(stCpriGetLinkDelay), MEM_ALIGNED_4BYTES, "pOamBaseDelayQryRsp");
|
||||
pEcsDmLocalMgt->pOamFiberDelayQryRspPtr = (stCpriGetRndDelay*)memSectionAlloc(pMemSection, sizeof(stCpriGetRndDelay), MEM_ALIGNED_4BYTES, "OamFiberDelayQryRsp");
|
||||
|
||||
for (int i = 0; i < MTIMER_MAX_NUM; i++)
|
||||
{
|
||||
pEcsDmLocalMgt->pMtimerPara[i] = (stMtimerPara*)memSectionAlloc(pMemSection, sizeof(stMtimerPara), MEM_ALIGNED_4BYTES, "pMtimerPara[i]");
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
// +FHDR------------------------------------------------------------
|
||||
// Copyright (c) 2022 SmartLogic.
|
||||
// ALL RIGHTS RESERVED
|
||||
// -----------------------------------------------------------------
|
||||
// Filename : ecs_rfm_spu0_oam.c.h
|
||||
// Author : huanfeng.wang
|
||||
// Created On : 2023-05-22
|
||||
// Last Modified :
|
||||
// -----------------------------------------------------------------
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// -FHDR------------------------------------------------------------
|
||||
|
||||
#ifndef __ECS_RFM_SPU0_OAM_H__
|
||||
#define __ECS_RFM_SPU0_OAM_H__
|
||||
|
||||
#include "typedef.h"
|
||||
|
||||
void spu_oam_init(void);
|
||||
uint32_t spu_rx_callback_oam(const char* buf,uint32_t payloadSize);
|
||||
|
||||
#endif
|
||||
|
@ -1,111 +0,0 @@
|
||||
// +FHDR------------------------------------------------------------
|
||||
// Copyright (c) 2022 SmartLogic.
|
||||
// ALL RIGHTS RESERVED
|
||||
// -----------------------------------------------------------------
|
||||
// Filename : ecs_rfm_spu0_oam.c
|
||||
// Author : huanfeng.wang
|
||||
// Created On : 2023-05-22
|
||||
// Last Modified :
|
||||
// -----------------------------------------------------------------
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// -FHDR------------------------------------------------------------
|
||||
|
||||
#include "typedef.h"
|
||||
#include "ucp_printf.h"
|
||||
#include "ucp_utility.h"
|
||||
#include "ucp_tick.h"
|
||||
#include "msg_transfer_queue.h"
|
||||
#include "ecs_rfm_spu0_oam.h"
|
||||
#include "app_interface.h"
|
||||
|
||||
#define RFM_OAM_MSG_SIZE (8)
|
||||
#define RFM_MSG_TYPE (0)
|
||||
|
||||
|
||||
static uint32_t g_u32_rfm0_oam_alloc_err = 0; //(31) 0xB7E0147C
|
||||
static uint32_t g_u32_rfm0_oam_send_err = 0; //(32) 0xB7E01480
|
||||
static uint32_t g_u32_rfm0_oam_recv_num = 0; //(33) 0xB7E01484
|
||||
static uint32_t g_u32_rfm0_oam_send_ok = 0; //(34) 0xB7E01488
|
||||
|
||||
uint32_t spu_rx_callback_oam(const char* buf,uint32_t payloadSize)
|
||||
{
|
||||
/* RFM0接收OAM消息后发给RFM1 */
|
||||
uint32_t core_id = get_core_id();
|
||||
int32_t ret = 0;
|
||||
char *addr = NULL;
|
||||
//uint32_t u32_clock_tick = 0;
|
||||
|
||||
UCP_PRINT_LOG("spu_rx_callback_oam,buf[0x%x] payloadSize[%d]", buf, payloadSize);
|
||||
|
||||
//rdmcycle(&u32_clock_tick);
|
||||
//do_write((buf+16), u32_clock_tick); //RFM receive tick
|
||||
g_u32_rfm0_oam_recv_num++;
|
||||
|
||||
addr = osp_alloc_msg(RFM_OAM_MSG_SIZE);
|
||||
if (NULL == addr)
|
||||
{
|
||||
UCP_PRINT_ERROR("spu_rx_callback_oam,addr is nullpayloadSize[%d]", payloadSize);
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 31), ++g_u32_rfm0_oam_alloc_err);
|
||||
return payloadSize;
|
||||
}
|
||||
|
||||
/* 第一字节:msg_transfer中的地址
|
||||
第二字节:bufer 的长度*/
|
||||
do_write(addr, (uint32_t)buf);
|
||||
do_write((addr+4), payloadSize);
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 43), buf);/*0xb7e014ac*/
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 44), payloadSize);
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 45), addr);
|
||||
|
||||
//rdmcycle(&u32_clock_tick);
|
||||
//do_write((buf+20), u32_clock_tick); //RFM forward tick
|
||||
|
||||
ret = osp_send_msg_oam((uint32_t)(addr), // osp_send_msg_oam
|
||||
RFM_OAM_MSG_SIZE,
|
||||
0xab, /*SPU_OAM_MSG_TYPE*/
|
||||
10, /* src que id*/
|
||||
11, /* dst que id*/
|
||||
40, /* src task id*/
|
||||
40); /* dst task id*/
|
||||
if (0 != ret)
|
||||
{
|
||||
UCP_PRINT_ERROR("spu_rx_callback_oam,ret[%d] nullpayloadSize[%d] g_u32_rfm0_oam_send_err[%d]",
|
||||
ret, payloadSize, g_u32_rfm0_oam_send_err);
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 32), ++g_u32_rfm0_oam_send_err);
|
||||
return payloadSize;
|
||||
}
|
||||
g_u32_rfm0_oam_send_ok++;
|
||||
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 33), g_u32_rfm0_oam_recv_num);
|
||||
debug_write(DBG_DDR_COMMON_IDX(core_id, 34), g_u32_rfm0_oam_send_ok);
|
||||
|
||||
UCP_PRINT_LOG("spu_rx_callback_oam,g_u32_rfm0_oam_recv_num[%d] g_u32_rfm0_oam_send_ok[%d] g_u32_rfm0_oam_send_err[%d]",
|
||||
g_u32_rfm0_oam_recv_num, g_u32_rfm0_oam_send_ok, g_u32_rfm0_oam_send_err);
|
||||
|
||||
return payloadSize;
|
||||
}
|
||||
|
||||
void spu_oam_init(void)
|
||||
{
|
||||
uint16_t inst_id = 0;
|
||||
uint16_t transfer_type = 0;
|
||||
uint16_t cu_flag = C_PLANE;
|
||||
int32_t handle_id = 0;
|
||||
|
||||
for (inst_id=0; inst_id<MAX_INSTANCE_NUM; inst_id++) {
|
||||
transfer_type = OAM;
|
||||
handle_id = msg_transfer_callback_register(transfer_type, inst_id,cu_flag, spu_rx_callback_oam);
|
||||
if (handle_id < 0) {
|
||||
UCP_PRINT_ERROR("spu_oam_init transfer_type:OAM, handle_id[0x%08x] error.",handle_id);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "log_server.h"
|
||||
#include "ucp_drv_common.h"
|
||||
#include "cpri_delay.h"
|
||||
#include "ecs_rfm_dm_mgt.h"
|
||||
|
||||
OamMsgTransferHeader_t *g_oam_msg_ptr = NULL;
|
||||
SpuOamBaseDelaySetRsp_t *g_oam_base_delay_set_rsp_ptr = NULL;
|
||||
@ -33,11 +34,11 @@ void oam_msg_init(void)
|
||||
{
|
||||
uint8_t u8core_id = (uint8_t)get_core_id();
|
||||
|
||||
MEM_SECTION_INFO *pMemSection = GetRfmDm1Section();
|
||||
g_oam_msg_ptr = memSectionAlloc(pMemSection, sizeof(OamMsgTransferHeader_t)+12, MEM_ALIGNED_4BYTES, "pOamMsg");
|
||||
g_oam_base_delay_set_rsp_ptr = memSectionAlloc(pMemSection, sizeof(SpuOamBaseDelaySetRsp_t), MEM_ALIGNED_4BYTES, "OamBaseDelaySetRsp");
|
||||
g_oam_base_delay_qry_rsp_ptr = memSectionAlloc(pMemSection, sizeof(SpuOamBaseDelayQryRsp_t), MEM_ALIGNED_4BYTES, "OamBaseDelayQryRsp");
|
||||
g_oam_fiber_delay_qry_rsp_ptr = memSectionAlloc(pMemSection, sizeof(SpuOamFiberDelayQryRsp_t), MEM_ALIGNED_4BYTES, "OamFiberDelayQryRsp");
|
||||
EcsRfmDmLocalMgt_t* pEcsDmLocalMgt = get_ecs_rfm_dm_local_mgt();
|
||||
g_oam_msg_ptr = (OamMsgTransferHeader_t *)pEcsDmLocalMgt->pOamMsgPtr;
|
||||
g_oam_base_delay_set_rsp_ptr = (SpuOamBaseDelaySetRsp_t *)pEcsDmLocalMgt->pOamBaseDelaySetRspPtr;
|
||||
g_oam_base_delay_qry_rsp_ptr = (SpuOamBaseDelayQryRsp_t *)pEcsDmLocalMgt->pOamBaseDelayQryRspPtr;
|
||||
g_oam_fiber_delay_qry_rsp_ptr = (SpuOamFiberDelayQryRsp_t *)pEcsDmLocalMgt->pOamFiberDelayQryRspPtr;
|
||||
|
||||
memset_ucp(g_oam_base_delay_set_rsp_ptr->u8rsv, 0, 2);
|
||||
memset_ucp(g_oam_base_delay_qry_rsp_ptr->u8rsv, 0, 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user