diff --git a/osp/src/ospCfgToBin.c b/osp/src/ospCfgToBin.c index 5abde86..c434d6e 100644 --- a/osp/src/ospCfgToBin.c +++ b/osp/src/ospCfgToBin.c @@ -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; }