1. New Feature#891

spe cfg file addr change(malloc --> 0x9A00 0000)
   when phy get the cfg file addr return the phy addr, not the vir addr
This commit is contained in:
lishuang.xie 2023-07-22 22:12:02 +08:00
parent f99b0bbef3
commit a2ae96715d

View File

@ -33,6 +33,7 @@
#define ARM_SPE_CFG_PHY_SIZE (0x1400000) /* 约定在20M以内 */
#define ARM_SPE_CFG_INFO_ONE sizeof(osp_spe_cfg_file_reg)
#define ARM_SPE_CFG_INFO_SIZE (ARM_SPE_CFG_INFO_ONE * APE_CFG_FILE_NUM)
#define ARM_SPE_CFG_OFFSET (0x0A000000) /* 目前改到APE_TEXT段从0x9A00 0000开始故需要偏移0x0A00 0000 */
#if 0
#define ARM_SPE_CFG_PHY_ADDR (0xB8000000) /* 指定配置文件首地址 */
@ -321,6 +322,7 @@ int32_t osp_spe_cfg_file_init()
g_spe_osp_cfg_file_idx = 0;
g_spe_static_mem_size = 0;
#if 0
g_spe_ptr_static_mem = malloc(ARM_SPE_CFG_PHY_SIZE);
if (NULL == g_spe_ptr_static_mem)
{
@ -328,17 +330,17 @@ int32_t osp_spe_cfg_file_init()
return OSP_ERROR;
}
return OSP_OK;
#endif
#if 0
g_spe_ptr_static_mem = get_static_mem(ARM_STACK, &g_spe_static_mem_size);
g_spe_ptr_static_mem = get_static_mem(APE_TEXT, &g_spe_static_mem_size);
if (0 == g_spe_static_mem_size)
{
UCP_PRINT_ERROR("get_static_mem(ARM_STACK) error......\r\n");
return OSP_ERROR;
}
g_spe_ptr_static_mem += ARM_SPE_CFG_OFFSET; /* 在内存规划中,配置文件的起始地址需要偏移 */
return OSP_OK;
#endif
}
int32_t osp_read_spe_cfg_to_bin(char* in_path)
@ -586,7 +588,9 @@ int32_t osp_get_cfg_file(char* name, uint64_t *paddr, uint32_t *psize)
head = g_spe_osp_cfg_file_reg + loop;
if (0 == memcmp(head->name, name, strlen(name)))
{
*paddr = head->vir_addr;
/* 物理层需要物理地址,而还是虚拟地址 */
osp_virt_to_phy(APE_TEXT, head->vir_addr, paddr);
//*paddr = head->vir_addr;
*psize = head->len;
return OSP_OK;
}