Merge branch 'dev_ck_v2.1_feature#1250#' into 'dev_ck_v2.1'
update feature#1250 Support hearbeat function See merge request ucp/driver/ucp4008_platform_arm!31
This commit is contained in:
commit
fa4a1d0174
@ -78,6 +78,14 @@ brief: drv function init
|
||||
*/
|
||||
int32_t drv_init(void);
|
||||
|
||||
/*
|
||||
name: get_heartbeat_status
|
||||
para: null
|
||||
brief: get the status of spu cores
|
||||
return value: 0:success other:bitmap for all cores(1:missing heartbeat)
|
||||
*/
|
||||
uint32_t get_heartbeat_status(void);
|
||||
|
||||
/**********************************************************************************************/
|
||||
/* testmac interface */
|
||||
|
||||
|
@ -10,5 +10,7 @@ typedef struct __OspHeartBeatInfo_t
|
||||
|
||||
int8_t OspHeartbeatPro(void);
|
||||
|
||||
uint32_t get_heartbeat_status(void);
|
||||
|
||||
#endif /* __OSP_HEARTBEAT__ */
|
||||
|
||||
|
@ -45,11 +45,43 @@ uint8_t* gu8virRegAddr = NULL;
|
||||
uint8_t* gu8VirSubctrlAddr = NULL;
|
||||
uint8_t* gu8VirRstCfgAddr = NULL;
|
||||
|
||||
uint32_t g32heartbeatCounter[MAX_NUM_SPU] = {0};
|
||||
|
||||
uint32_t get_heartbeat_status(void)
|
||||
{
|
||||
volatile uint32_t vu32counter = 0;
|
||||
uint32_t u32coreHeartbeatBitmap = SUCCESS;
|
||||
uint32_t u32coreHeartbeatMask = 0xEFF;
|
||||
uint8_t u8loop = 0;
|
||||
|
||||
PetSmLocalMgt_t* pPetSmLocalMgt = get_pet_sm_local_mgt();
|
||||
UcpHandshake_t* pHandshake = pPetSmLocalMgt->pHandshake;
|
||||
|
||||
for (u8loop = 0; u8loop < MAX_NUM_SPU; u8loop++)
|
||||
{
|
||||
vu32counter = pHandshake->heartbeat[u8loop];
|
||||
if (vu32counter == g32heartbeatCounter[u8loop])
|
||||
{
|
||||
u32coreHeartbeatBitmap |= (1 << u8loop);
|
||||
}
|
||||
|
||||
/* update */
|
||||
g32heartbeatCounter[u8loop] = vu32counter;
|
||||
}
|
||||
|
||||
u32coreHeartbeatBitmap &= u32coreHeartbeatMask;
|
||||
|
||||
UCP_PRINT_WARN("[get_heartbeat_status]: HeartbeatBitMap = 0x%x\r\n", u32coreHeartbeatBitmap);
|
||||
|
||||
return u32coreHeartbeatBitmap;
|
||||
}
|
||||
|
||||
|
||||
/* 获取对应核的心跳计数 */
|
||||
uint32_t OspGetHeartbeat(uint8_t u8CoreId)
|
||||
{
|
||||
PetSmLocalMgt_t* pPetSmLocalMgt = get_pet_sm_local_mgt();
|
||||
UcpHandshake_t* pHandshake = pPetSmLocalMgt->pHandshake;
|
||||
PetSmLocalMgt_t* pPetSmLocalMgt = get_pet_sm_local_mgt();
|
||||
UcpHandshake_t* pHandshake = pPetSmLocalMgt->pHandshake;
|
||||
return pHandshake->heartbeat[u8CoreId];
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "ospSwQueue.h"
|
||||
#include "pet_sm_mgt.h"
|
||||
#include "msg_transfer_layer.h"
|
||||
#include "ospHeartbeat.h"
|
||||
|
||||
|
||||
#define MAX_CMD_LEN (150) /*the max length of a shell command */
|
||||
@ -69,6 +70,7 @@ OSP_CMD_RTN ospCmdRtnTbl[MAX_CMD_NUM] =
|
||||
//{"s", (OSP_FUNCPTR)osp_shell_mem_wrapper, (OSP_FUNCPTR)osp_shell_set_mem, "s addr val: set addr memory(length is 4)", 2},
|
||||
//{"phym", (OSP_FUNCPTR)osp_shell_mem_wrapper, (OSP_FUNCPTR)osp_display_phy_mem, "show phy mempry info", 2},
|
||||
//{"c", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_show_tsk_diag_cnt, "show Task Diag Cnt", 1},
|
||||
//{"sw", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_show_swqueue_info, "show arm print level", 0},
|
||||
{"net", (OSP_FUNCPTR)osp_show_udp, NULL, "show net info", 0},
|
||||
//{"sw", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_show_swqueue_info, "show arm print level", 0},
|
||||
{"level", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_set_print_level, "set arm print level", 1},
|
||||
@ -92,9 +94,11 @@ OSP_CMD_RTN ospCmdRtnTbl[MAX_CMD_NUM] =
|
||||
//{"set_clock", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_set_clk_mode, "set clock module", 1},
|
||||
{"recmd_ape", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_reget_ape_cmd, "get ape cmd again", 0},
|
||||
{"intr_ape", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_ape_csu_int_cnt, "show intr info", 0},
|
||||
// {"level_ape", (OSP_FUNCPTR)osp_shell_wrapper,(OSP_FUNCPTR)osp_ape_set_log_level, "set ape log level", 1},
|
||||
// {"csu_stop_ape", (OSP_FUNCPTR)osp_shell_wrapper,(OSP_FUNCPTR)osp_ape_csu_stop_cfg, "set csu start or stop", 2},
|
||||
// {"i_ape", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_show_ape_taskinfo, "show ape task info", 0},
|
||||
{"hb", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)get_heartbeat_status, "test heartbeat", 0},
|
||||
|
||||
//{"level_ape", (OSP_FUNCPTR)osp_shell_wrapper,(OSP_FUNCPTR)osp_ape_set_log_level, "set ape log level", 1},
|
||||
//{"csu_stop_ape", (OSP_FUNCPTR)osp_shell_wrapper,(OSP_FUNCPTR)osp_ape_csu_stop_cfg, "set csu start or stop", 2},
|
||||
//{"i_ape", (OSP_FUNCPTR)osp_shell_wrapper, (OSP_FUNCPTR)osp_show_ape_taskinfo, "show ape task info", 0},
|
||||
};
|
||||
|
||||
int32_t SHELL_CMD_NUM = OSP_NELEMENTS(ospCmdRtnTbl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user