u32 bsp_nvm_flushEx(u32 off,u32 len,u32 itemid) { u32 ret = NV_ERROR; struct nv_icc_stru icc_req = {0}; struct nv_icc_stru icc_cnf = {0}; struct nv_global_ddr_info_stru* ddr_info = (struct nv_global_ddr_info_stru*)NV_GLOBAL_INFO_ADDR; nv_debug(NV_API_FLUSH,0,0,0,0); if(NV_INIT_OK != ddr_info->ccore_init_state) { nv_debug(NV_API_FLUSH,1,ddr_info->ccore_init_state,0,0); return BSP_ERR_NV_MEM_INIT_FAIL; } icc_req.msg_type = NV_ICC_REQ; icc_req.data_len = len; icc_req.data_off = off; icc_req.ret = 93; /*use to test ,no meaning*/ icc_req.itemid = itemid; icc_req.slice = bsp_get_slice_value(); ret = nv_icc_send((u8*)&icc_req,sizeof(icc_req)); if(ret) { nv_debug(NV_API_FLUSH,2,0,ret,0); return ret; } /*lint -save -e534*/ if(osl_sem_downtimeout(&g_nv_ctrl.cc_sem,NV_MAX_WAIT_TICK)) { nv_printf("down time out\n"); } /*lint -restore +e534*/ memcpy(&icc_cnf,g_nv_ctrl.nv_icc_buf,sizeof(icc_cnf)); if(icc_cnf.msg_type != NV_ICC_CNF) { nv_debug(NV_API_FLUSH,3,0,0,icc_cnf.msg_type); /*lint -save -e515 -e516*/ printf_nv("\n[%s]\n",__FUNCTION__); /*lint -restore*/ nv_help(NV_API_FLUSH); return BSP_ERR_NV_INVALID_PARAM; } return icc_cnf.ret; }
u32 bsp_nvm_flushEx(u32 off,u32 len,u32 itemid) { u32 ret = NV_ERROR; struct nv_icc_stru icc_req = {0}; struct nv_global_ddr_info_stru* ddr_info = (struct nv_global_ddr_info_stru*)NV_GLOBAL_INFO_ADDR; if(NV_INIT_OK != ddr_info->mcore_init_state) { return BSP_ERR_NV_MEM_INIT_FAIL; } icc_req.msg_type = NV_ICC_REQ; icc_req.data_len = len; icc_req.data_off = off; icc_req.ret = 93; /*use to test ,no meaning*/ icc_req.itemid = itemid; icc_req.slice = bsp_get_slice_value(); ret = nv_icc_send((u8*)&icc_req,sizeof(icc_req)); return ret; }