You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.1 KiB
94 lines
2.1 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2021-2021. All rights reserved.
|
|
* Description: Entries for drviers and applications
|
|
* Author: Hisilicon
|
|
* Create: 2021-04-26
|
|
*/
|
|
#include "soc_osal.h"
|
|
#include "td_type.h"
|
|
#include "drv_mbx.h"
|
|
#include "drv_log.h"
|
|
#include "dmcu_mem.h"
|
|
#include "dmcu_dbg.h"
|
|
#include "dmcu_comm.h"
|
|
#include "dmcu_app.h"
|
|
#ifdef CONFIG_DRIVERS_RPMSG
|
|
#include "rpmsg/drv_rpmsg_ext.h"
|
|
#endif
|
|
|
|
static td_s32 core_init(td_void)
|
|
{
|
|
mcu_dmcu_status *mcu_status = get_mcu_status();
|
|
td_s32 ret = TD_SUCCESS;
|
|
#ifdef CONFIG_DRIVERS_RPMSG
|
|
ret = rpmsg_init();
|
|
if (ret != TD_SUCCESS) {
|
|
osal_printk("rpmsg_init fail, ret:0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
mcu_status->bit.rpmsg_init = 1;
|
|
#endif
|
|
|
|
#ifdef CONFIG_DRIVERS_MBX_DMCU
|
|
ret = drv_mbx_init(DMCU0);
|
|
if (ret != 0) {
|
|
printf("drv_mbx_init DMCU0 failed\n");
|
|
return ret;
|
|
}
|
|
mcu_status->bit.drv_mbx_init = 1;
|
|
#endif
|
|
|
|
ret = dmcu_comm_ctrl_init();
|
|
if (ret != TD_SUCCESS) {
|
|
printf("dmcu_comm_ctrl_init failed\n");
|
|
return ret;
|
|
}
|
|
mcu_status->bit.dmcu_comm_ctrl_init = 1;
|
|
|
|
#ifdef CONFIG_SOCT_LOG_SUPPORT
|
|
ret = soc_log_init();
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("log init fail\n");
|
|
return ret;
|
|
}
|
|
mcu_status->bit.soc_log_init = 1;
|
|
#endif
|
|
|
|
dmcu_dbg_init();
|
|
mcu_status->bit.dmcu_dbg_init = 1;
|
|
|
|
ret = dmcu_mem_init();
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("dmcu_mem_init failed\n");
|
|
return ret;
|
|
}
|
|
|
|
mcu_status->bit.dmcu_mem_init = 1;
|
|
return ret;
|
|
}
|
|
|
|
td_void app_init(td_void)
|
|
{
|
|
td_s32 ret;
|
|
mcu_dmcu_status *mcu_status = get_mcu_status();
|
|
|
|
ret = core_init();
|
|
if (ret != TD_SUCCESS) {
|
|
osal_printk("core init fail, ret:0x%x\n", ret);
|
|
return;
|
|
}
|
|
|
|
#ifdef SOCT_PQ_SUPPORT
|
|
pq_dmcu_server_init();
|
|
mcu_status->bit.pq_dmcu_server_init = 1;
|
|
#endif
|
|
|
|
#ifdef CONFIG_SOCT_VO_ENABLE_DMCU
|
|
drv_dmcu_server_init();
|
|
mcu_status->bit.drv_dmcu_server_init = 1;
|
|
#endif
|
|
drv_panel_dmcu_server_init();
|
|
mcu_status->bit.drv_panel_dmcu_server_init = 1;
|
|
return;
|
|
}
|