lishuang.xie 295a44d46b 1. fix Bug#1061
2. fix Bug#1081
3. fix Bug#1079
4. update New Feature#945
5. component debug_init call in spu_lib_debug_init() functon
6. testcase:
   6.1 spu(case34)+arm(case5): pass
   6.2 spu(case44)+arm(case5): pass
   6.3 spu(case21)+arm(case21):pass
   6.4 spu(case14)+arm(case3): pass
2023-09-25 09:46:27 +08:00

83 lines
1.5 KiB
C

// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : ape_top.c
// Author : xianfeng.du
// Created On : 2022-06-25
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "typedef.h"
#include "smartos.h"
#include "ape_drv.h"
#include "ucp_handshake.h"
#include "ucp_utility.h"
#include "ucp_printf.h"
#include "msg_transfer_mem.h"
#include "msg_transfer_queue.h"
#include "pet_sm_mgt.h"
#include "osp_init.h"
static int32_t gCoreId = 0;
ALWAYS_INLINE int32_t get_core_id(void)
{
return gCoreId;
}
void set_core_id(void)
{
__ucps2_iCacheConfig(f_DoubleEnable, f_BypassEnable);
gCoreId = smart_get_cpuid();
if (0 > gCoreId)
{
debug_write(DBG_DDR_ERR_IDX(0, 13), gCoreId);
}
UCP_PRINT_EMPTY("Hello world from APE,coreId[0x%x]", gCoreId);
__ucps2_synch(0);
return;
}
int32_t soc_drv_init()
{
int apeId = get_core_id();
if (0 == apeId)
{
pet_sm_init();
osp_var_init();
}
return 0;
}
void spu_drv_init(void)
{
pet_sm_alloc();
ape_drv_init();
return;
}
void spu_msg_transfer_init(void)//ape level
{
msg_transfer_mem_alloc();
handshake_slave_with_master();
msg_transfer_queue_init();
return;
}