From 2cc9680d5cc2b905ac8c405bc8f7cb53b784c0c0 Mon Sep 17 00:00:00 2001 From: Tinku Mannan Date: Fri, 20 Feb 2015 16:55:02 -0500 Subject: [PATCH] Fix for SDOCM00114893 --- ti/runtime/netapi/src/netapi_init.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ti/runtime/netapi/src/netapi_init.c b/ti/runtime/netapi/src/netapi_init.c index 87bc8a9..68168e0 100755 --- a/ti/runtime/netapi/src/netapi_init.c +++ b/ti/runtime/netapi/src/netapi_init.c @@ -747,26 +747,35 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, netapi_VM_MempoolAttr[0].phys_addr = 0; netapi_VM_MempoolAttr[0].size = 0; +#ifdef NETAPI_USE_DDR_AND_MSMC /* Init attributes for un-cached MSMC */ netapi_VM_MempoolAttr[1].attr = HPLIB_ATTR_UN_CACHED; netapi_VM_MempoolAttr[1].phys_addr = CSL_MSMC_SRAM_REGS; netapi_VM_MempoolAttr[1].size = TUNE_NETAPI_PERM_MEM_SZ; +#endif #else - netapi_VM_MempoolAttr[1].attr = HPLIB_ATTR_KM_CACHED0; - netapi_VM_MempoolAttr[1].phys_addr = 0; - netapi_VM_MempoolAttr[1].size = 0; - /* Init attributes for un-cached MSMC */ netapi_VM_MempoolAttr[0].attr = HPLIB_ATTR_UN_CACHED; netapi_VM_MempoolAttr[0].phys_addr = CSL_MSMC_SRAM_REGS; netapi_VM_MempoolAttr[0].size = TUNE_NETAPI_PERM_MEM_SZ; +#ifdef NETAPI_USE_DDR_AND_MSMC + netapi_VM_MempoolAttr[1].attr = HPLIB_ATTR_KM_CACHED0; + netapi_VM_MempoolAttr[1].phys_addr = 0; + netapi_VM_MempoolAttr[1].size = 0; +#endif #endif /* initialize all the memory we are going to use - chunk for buffers, descriptors - memory mapped peripherals we use, such as QMSS, PA, etc */ +#ifdef NETAPI_USE_DDR_AND_MSMC result = hplib_vmInit(&netapi_VM_VirtAddr[0], 2, &netapi_VM_MempoolAttr[0]); +#else + result = hplib_vmInit(&netapi_VM_VirtAddr[0], + 1, + &netapi_VM_MempoolAttr[0]); +#endif if (result != hplib_OK) { @@ -776,7 +785,9 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, if (global_master_process == NETAPI_TRUE) { hplib_initMallocArea(0); +#ifdef NETAPI_USE_DDR_AND_MSMC hplib_initMallocArea(1); +#endif #ifdef NETAPI_ENABLE_SECURITY #define SEC_CONTEXT_SZ 384 //not tunable /* allocate 2x number of tunnels since we need one for inflow and one for data mode */ -- 2.26.2