PASDK69: Added support for Non-cacheable DDR memory.
authorChitresh Gupta <chitresh.g@pathpartnertech.com>
Mon, 5 Dec 2016 11:53:35 +0000 (17:23 +0530)
committerChitresh Gupta <chitresh.g@pathpartnertech.com>
Mon, 5 Dec 2016 11:53:35 +0000 (17:23 +0530)
12 files changed:
pasdk/common/audioStreamProc_common.h
pasdk/common/paf_alg_malloc.c
pasdk/common/paf_alg_print.c
pasdk/common/paf_heapMgr.c
pasdk/common/paf_heapMgr.h
pasdk/shared/ipc.cfg.xs
pasdk/test_arm/application/app.cfg
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_arm/framework/systemInit.c
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/audioStreamOutProc.c
pasdk/test_dsp/framework/systemInit.c

index 56501ccc796e761da7526f5b5205cdf8465eb965..54682ba5f8c6268c0080a18c5742f0017787b423 100644 (file)
@@ -153,17 +153,20 @@ All rights reserved.
 //
 // Heap & Memory Allocation Definitions
 //
-#define HEAP_ID_INTERNAL        *pP->heap.pHeapIdIntern     //*pP->heap.pIntern
-#define HEAP_ID_INTERNAL1       *pP->heap.pHeapIdIntern1    //*pP->heap.pIntern1
-#define HEAP_ID_EXTERNAL        *pP->heap.pHeapIdExtern     //*pP->heap.pExtern
-#define HEAP_ID_INTERNAL1_SHM   gPafHeapIdInt1Shm
-#define HEAP_ID_EXTERNAL_SHM    gPafHeapIdExtShm
-#define HEAP_INTERNAL           (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL)
-#define HEAP_INTERNAL1          (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1)
-#define HEAP_EXTERNAL           (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL)
-#define HEAP_INTERNAL1_SHM      (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1_SHM)
-#define HEAP_EXTERNAL_SHM       (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_SHM)
-#define HEAP_CLEAR              pP->heap.clear
+#define HEAP_ID_INTERNAL                  *pP->heap.pHeapIdIntern     //*pP->heap.pIntern
+#define HEAP_ID_INTERNAL1                 *pP->heap.pHeapIdIntern1    //*pP->heap.pIntern1
+#define HEAP_ID_EXTERNAL                  *pP->heap.pHeapIdExtern     //*pP->heap.pExtern
+#define HEAP_ID_INTERNAL1_SHM             gPafHeapIdInt1Shm
+#define HEAP_ID_EXTERNAL_SHM              gPafHeapIdExtShm
+#define HEAP_ID_EXTERNAL_NONCACHED_SHM    gPafHeapIdExtNonCachedShm
+
+#define HEAP_INTERNAL                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL)
+#define HEAP_INTERNAL1                    (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1)
+#define HEAP_EXTERNAL                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL)
+#define HEAP_INTERNAL1_SHM                (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1_SHM)
+#define HEAP_EXTERNAL_SHM                 (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_SHM)
+#define HEAP_EXTERNAL_NONCACHED_SHM       (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_NONCACHED_SHM)
+#define HEAP_CLEAR                         pP->heap.clear
 
 #define HEAP_ID_INPBUF      *pP->heap.pHeapIdInpbuf     //*pP->heap.pInpbuf
 #define HEAP_ID_OUTBUF      *pP->heap.pHeapIdOutbuf     //*pP->heap.pOutbuf
index b613bf75109e38f285acc8e6ca1dc0037e409392..86563a3e63fc5e70a8c00dfd54b8a609e532e492 100644 (file)
@@ -59,6 +59,8 @@ All rights reserved.
 #include "paf_alg.h"
 #include "paf_alg_priv.h"
 
+#include "paf_ialg.h"
+
 #include "common.h"
 #include "paf_heapMgr.h"
 
@@ -203,11 +205,12 @@ PAF_ALG_allocMemory_ (
                     TRACE_GEN((&TR_MOD, "PAF_ALG_allocMemory_.%d: Setup memory regions.", __LINE__));
                     //PAF_ALG_setup(&pafConfig,IRAM,SDRAM,IRAM,0); // option: use L3RAM
                     PAF_ALG_setup(&pafConfig,
-                            gPafHeapIdInt,      (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt),
-                            gPafHeapIdInt1,     (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1),
-                            gPafHeapIdExt,      (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExt),
-                            gPafHeapIdInt1Shm,  (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1Shm),
-                            gPafHeapIdExtShm,   (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtShm),
+                            gPafHeapIdInt,               (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt),
+                            gPafHeapIdInt1,              (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1),
+                            gPafHeapIdExt,               (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExt),
+                            gPafHeapIdInt1Shm,           (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1Shm),
+                            gPafHeapIdExtShm,            (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtShm),
+                            gPafHeapIdExtNonCachedShm,   (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtNonCachedShm),
                             0);
                     TRACE_GEN((&TR_MOD, "PAF_ALG_allocMemory_.%d: alloc %d bytes from space %d", __LINE__, memTab[i].size, memTab[i].space));
                     //if(!(memTab[i].base=(void *)MEM_alloc(
@@ -434,6 +437,10 @@ PAF_ALG_memSpaceToHeapId_ (
             TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeapId_.%d: IALG_ESDATA (IALG_EXTERNAL_SHM) (0x%x) 0x%x", __LINE__, space, p->eHeapIdShm));
             return p->eHeapIdShm;
 
+        case IALG_ENCSDATA:   // K2G: used for DDR shared non-cacheable memory
+            TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeapId_.%d: IALG_ENCSDATA (PAF_HEAP_ID_EXT_NON_CACHED_SHM) (0x%x) 0x%x", __LINE__, space, p->eHeapIdNCShm));
+            return p->eHeapIdNCShm;
+
         default:
             TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeapId_.%d: default (0x%x) 0x%x", __LINE__, space, p->eHeapId));
             return p->eHeapId;
@@ -480,6 +487,10 @@ PAF_ALG_memSpaceToHeap_ (
             TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeap_.%d: IALG_ESDATA (0x%x) 0x%x", __LINE__, space, p->eHeapIdShm));
             return p->hEHeapShm;
 
+        case IALG_ENCSDATA:   // K2G: used for DDR shared non-cacheable memory
+            TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeap_.%d: IALG_ENCSDATA (0x%x) 0x%x", __LINE__, space, p->eHeapIdNCShm));
+            return p->hEHeapNCShm;
+
         default:
             TRACE_GEN((&TR_MOD, "PAF_ALG_memSpaceToHeap_.%d: default (0x%x) 0x%x", __LINE__, space, p->eHeapId));
             return p->hEHeap;
@@ -507,6 +518,8 @@ PAF_ALG_setup_ (
     HeapMem_Handle hLHeapShm,
     Int eHeapIdShm,
     HeapMem_Handle hEHeapShm,
+    Int eHeapIdNCShm,
+    HeapMem_Handle hEHeapNCShm,
     Int clr
 )
 { 
@@ -515,18 +528,20 @@ PAF_ALG_setup_ (
 #endif    
     
     /* initialize heap Ids */
-    p->iHeapId      = iHeapId; 
-    p->lHeapId      = lHeapId;
-    p->eHeapId      = eHeapId;
-    p->lHeapIdShm   = lHeapIdShm;
-    p->eHeapIdShm   = eHeapIdShm;
+    p->iHeapId        = iHeapId; 
+    p->lHeapId        = lHeapId;
+    p->eHeapId        = eHeapId;
+    p->lHeapIdShm     = lHeapIdShm;
+    p->eHeapIdShm     = eHeapIdShm;
+    p->eHeapIdNCShm   = eHeapIdNCShm;
     
     /* initialize heap handles */
-    p->hIHeap       = hIHeap;
-    p->hLHeap       = hLHeap;
-    p->hEHeap       = hEHeap;
-    p->hLHeapShm    = hLHeapShm;
-    p->hEHeapShm    = hEHeapShm;
+    p->hIHeap         = hIHeap;
+    p->hLHeap         = hLHeap;
+    p->hEHeap         = hEHeap;
+    p->hLHeapShm      = hLHeapShm;
+    p->hEHeapShm      = hEHeapShm;
+    p->hEHeapNCShm    = hEHeapNCShm;
     
     /* initialize clear flag */
     p->clr=clr;
index 9385b44440e9eb530b8740ff5b3159c20b64c705..3f9f002582cd7c2ad152ef1812f2071c9c359a02 100644 (file)
@@ -194,7 +194,7 @@ PAF_ALG_headerPrint()
     printf("\n\nAlgorithm Memory requirement:\n");
     printf("  Key:  \n");
     printf("    Beta ID can be decoded from stdbeta.h, oembeta.h or cusbeta.h in pa\\sio\\acp1.\n");
-    printf("    The number in parentheses is the heap.  (0) is L2.  (1) is MSMC.  (2) is DDR3.  (3) is MSMC SHM.  (4) is DDR SHM.\n");
+    printf("    The number in parentheses is the heap.  (0) is L2.  (1) is MSMC.  (2) is DDR3.  (3) is MSMC SHM.  (4) is DDR SHM.  (5) is DDR NON-CACHED SHM.\n");
     printf("%8s\t","BetaId");
     for(i=PAF_IALG_COMMON_MEM0;i<=PAF_IALG_COMMON_MEMN;++i){
         if(i==0) printf("%8s\t","SCRATCH");
index 7532cb54a7961ab78a406cb687a41d9e0e7e63a7..3a45dc73ed3a67683f3ce27e0c5418cc31ac2f9a 100644 (file)
@@ -38,11 +38,12 @@ All rights reserved.
 
 #include "paf_heapMgr.h"
 
-Int gPafHeapIdInt       = PAF_HEAP_ID_INT;
-Int gPafHeapIdInt1      = PAF_HEAP_ID_INT1;
-Int gPafHeapIdExt       = PAF_HEAP_ID_EXT;
-Int gPafHeapIdInt1Shm   = PAF_HEAP_ID_INT1_SHM;
-Int gPafHeapIdExtShm    = PAF_HEAP_ID_EXT_SHM;
+Int gPafHeapIdInt             = PAF_HEAP_ID_INT;
+Int gPafHeapIdInt1            = PAF_HEAP_ID_INT1;
+Int gPafHeapIdExt             = PAF_HEAP_ID_EXT;
+Int gPafHeapIdInt1Shm         = PAF_HEAP_ID_INT1_SHM;
+Int gPafHeapIdExtShm          = PAF_HEAP_ID_EXT_SHM;
+Int gPafHeapIdExtNonCachedShm = PAF_HEAP_ID_EXT_NON_CACHED_SHM;
 
 // heap handle array
 //static IHeap_Handle gHeapIdToHandle[PAF_NUM_HEAPS] =
@@ -52,6 +53,7 @@ IHeap_Handle gHeapIdToHandle[PAF_NUM_HEAPS] =
     NULL,
     NULL,
     NULL,
+    NULL,
     NULL
 };
 
@@ -61,14 +63,16 @@ Void pafHeapMgr_init(
     IHeap_Handle hIntHeap1,
     IHeap_Handle hExtHeap,
     IHeap_Handle hIntHeap1Shm,
-    IHeap_Handle hExtHeapShm
+    IHeap_Handle hExtHeapShm,
+    IHeap_Handle hExtHeapNonCachedShm
 )
 {
-    gHeapIdToHandle[PAF_HEAP_ID_INT]        = hIntHeap;
-    gHeapIdToHandle[PAF_HEAP_ID_INT1]       = hIntHeap1;
-    gHeapIdToHandle[PAF_HEAP_ID_EXT]        = hExtHeap;
-    gHeapIdToHandle[PAF_HEAP_ID_INT1_SHM]   = hIntHeap1Shm;
-    gHeapIdToHandle[PAF_HEAP_ID_EXT_SHM]    = hExtHeapShm;
+    gHeapIdToHandle[PAF_HEAP_ID_INT]                = hIntHeap;
+    gHeapIdToHandle[PAF_HEAP_ID_INT1]               = hIntHeap1;
+    gHeapIdToHandle[PAF_HEAP_ID_EXT]                = hExtHeap;
+    gHeapIdToHandle[PAF_HEAP_ID_INT1_SHM]           = hIntHeap1Shm;
+    gHeapIdToHandle[PAF_HEAP_ID_EXT_SHM]            = hExtHeapShm;
+    gHeapIdToHandle[PAF_HEAP_ID_EXT_NON_CACHED_SHM] = hExtHeapNonCachedShm;
 }
 
 /* Write heap handle to PAF heap manager for provided index */
index 3555681375cf851388c3a14d7bb23c74d9763f50..5bda76e80b237543c00aba79189ccc3c171cde59 100644 (file)
@@ -39,20 +39,22 @@ All rights reserved.
 #include <xdc/std.h>
 #include <xdc/runtime/IHeap.h>
 
-#define PAF_NUM_PRVMEM_HEAPS    ( 3 )
-#define PAF_NUM_SHMEM_HEAPS     ( 2 )
-#define PAF_NUM_HEAPS           ( PAF_NUM_PRVMEM_HEAPS + PAF_NUM_SHMEM_HEAPS )
-#define PAF_HEAP_ID_INT         ( 0 )   // L2 SRAM
-#define PAF_HEAP_ID_INT1        ( 1 )   // MSMC SRAM
-#define PAF_HEAP_ID_EXT         ( 2 )   // DDR3
-#define PAF_HEAP_ID_INT1_SHM    ( 3 )   // MSMC SRAM, Shared
-#define PAF_HEAP_ID_EXT_SHM     ( 4 )   // DDR3, Shared
+#define PAF_NUM_PRVMEM_HEAPS            ( 3 )
+#define PAF_NUM_SHMEM_HEAPS             ( 3 )
+#define PAF_NUM_HEAPS                   ( PAF_NUM_PRVMEM_HEAPS + PAF_NUM_SHMEM_HEAPS )
+#define PAF_HEAP_ID_INT                 ( 0 )   // L2 SRAM
+#define PAF_HEAP_ID_INT1                ( 1 )   // MSMC SRAM
+#define PAF_HEAP_ID_EXT                 ( 2 )   // DDR3
+#define PAF_HEAP_ID_INT1_SHM            ( 3 )   // MSMC SRAM, Shared
+#define PAF_HEAP_ID_EXT_SHM             ( 4 )   // DDR3, Shared
+#define PAF_HEAP_ID_EXT_NON_CACHED_SHM  ( 5 )   // DDR3 non-cached, Shared
 
 extern Int gPafHeapIdInt;
 extern Int gPafHeapIdInt1;
 extern Int gPafHeapIdExt;
 extern Int gPafHeapIdInt1Shm;
 extern Int gPafHeapIdExtShm;
+extern Int gPafHeapIdExtNonCachedShm;
 
 /* Initialize PAF heap manager */
 Void pafHeapMgr_init(
@@ -60,7 +62,8 @@ Void pafHeapMgr_init(
     IHeap_Handle hIntHeap1,
     IHeap_Handle hExtHeap,
     IHeap_Handle hIntHeap1Shm,
-    IHeap_Handle hExtHeapShm
+    IHeap_Handle hExtHeapShm,
+    IHeap_Handle hExtHeapNonCachedShm
 );
 
 /* Write heap handle to PAF heap manager for provided index */
index 505f3268fe71395c07200839daa126652b7dcf0d..cd0a1c8994fb238ed9ccc2504980b1e765f3ef07 100644 (file)
@@ -109,7 +109,7 @@ SharedRegion.setEntryMeta(3,
         len:            SrDDr3_2Mem.len,
         ownerProcId:    1,
         isValid:        true,
-        cacheEnable:    false,
+        cacheEnable:    xdc.global.SrDDr3_2Mem_cacheEnable,
         createHeap:     true
     })
 );
index eb71a43066ed48962d43f837443147fb537ee455..104aa744b84e5acf2f775d3801af447b5c67b154 100644 (file)
@@ -76,6 +76,7 @@ xdc.useModule('ti.sdo.utils.MultiProc');
 xdc.global.SR0_cacheEnable = true;
 xdc.global.SrMsmcMem_cacheEnable = true;
 xdc.global.SrDDr3Mem_cacheEnable = true;
+xdc.global.SrDDr3_2Mem_cacheEnable = false;
 xdc.global.procName = "HOST";
 var ipc_cfg = xdc.loadCapsule("C:/ti/processor_audio_sdk_1_00_00_00/pasdk/shared/ipc.cfg.xs");
 
@@ -144,8 +145,9 @@ BIOS.heapSize = 0x2000; // from pa.cfg
 BIOS.heapSection = ".systemHeap";
 Program.sectMap[".systemHeap"] = "HOST_DDR3";
 
-if (1)        // Disable cache on ARM for the shared memory region
+if (xdc.global.SrDDr3_2Mem_cacheEnable == false)        
 {
+       // Disable cache on ARM for the shared memory region
        var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
        
        // descriptor attribute structure
@@ -158,16 +160,16 @@ if (1)        // Disable cache on ARM for the shared memory region
        
        Mmu.initDescAttrsMeta(attrs);
        attrs.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
-       attrs.shareable = 2; //3;                      // 3 - inner-sharerable
-       attrs.attrIndx = 0;//2;                       // MAIR0 Byte2 describes
+       attrs.shareable = 2; //3;                 // 2 - outer-sharerable
+       attrs.attrIndx = 0;//2;                   // MAIR0 Byte2 describes
                                                  // memory attributes for
                                                  // this level2 entry
        
        // write memory region attribute in mairRegAttr[2] i.e. MAIR0 Reg Byte2
-       Mmu.setMAIRMeta(0/*2*/, 0x44/*0xff*/);              // Mark mem regions as non-cacheable
+       Mmu.setMAIRMeta(0, 0x44);              // Mark mem regions as non-cacheable
        
        /* Get a handle to the C64P Target */
-       //var COMMON2_DDR3 = "" + java.lang.System.getenv("COMMON2_DDR3");
+       // TODO: remove hardcoded address and get correct values from .bld
        var COMMON2_DDR3_base = 0x81000000;
        var COMMON2_DDR3_end = 0x81000000 + 0x01000000;
        // Set the descriptor for each entry in the address range
index 8bca5546e3169a62aaefd14b56fbc5b736518ce5..b5cf0c8ecc73bc90365ff1684e8a3cc909f2c173 100644 (file)
@@ -1009,11 +1009,12 @@ PAF_ASDT_initPhaseCommon(
 
     TRACE_TERSE0("PAF_ASDT_initPhaseCommon: calling PAF_ALG_setup.");
     PAF_ALG_setup(&pafAlgConfig, 
-        HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-        HEAP_ID_INTERNAL1,      HEAP_INTERNAL1, 
-        HEAP_ID_EXTERNAL,       HEAP_EXTERNAL, 
-        HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM, 
-        HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM, 
+        HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+        HEAP_ID_INTERNAL1,              HEAP_INTERNAL1, 
+        HEAP_ID_EXTERNAL,               HEAP_EXTERNAL, 
+        HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM, 
+        HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM, 
+        HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
         HEAP_CLEAR);
 
     if (pP->fxns->headerPrint)
index c71d9fca9ab716a8d6f8f9d6f207fed9815e7a0b..54dfced28c90cdcc6bf8ced1b9d22115810e3f54 100644 (file)
@@ -42,6 +42,7 @@ All rights reserved.
 #include <xdc/runtime/IHeap.h>
 #include <xdc/runtime/Log.h>
 #include <xdc/runtime/System.h>
+#include <ti/ipc/SharedRegion.h>
 #include <ti/ipc/Ipc.h>
 
 #include "pafhjt.h"
@@ -74,6 +75,8 @@ Void taskSysInitFxn(Void)
 {
     UInt16 remoteProcId;    
     Int status;
+    UInt16  regionId;
+    IHeap_Handle srHeapNonCacheDdr3;
 
     
     Log_info0("Enter taskSysInitFxn()");
@@ -109,13 +112,16 @@ Void taskSysInitFxn(Void)
         return;
     }
 
+    regionId = SharedRegion_getIdByName("COMMON2_DDR3");
+    srHeapNonCacheDdr3 = (IHeap_Handle)SharedRegion_getHeap(regionId);
     /* Initialize PAF heap manager */
     Log_info0("taskSysInitFxn:pafHeapMgr_init()");
     pafHeapMgr_init((IHeap_Handle)heapMemL2Sram,
         (IHeap_Handle)heapMemMsmcSram,
         (IHeap_Handle)heapMemDdr3,
         NULL,
-        NULL);
+        NULL,
+        srHeapNonCacheDdr3);
     
     /* Initialize HJT */
     pafhjt = &PAFHJT_RAM;
index 79bdaa143f91069cf7337b636c196edfca33018c..ab3bf34466c3998dd6e2c5aa71bc3731ce044e2c 100644 (file)
@@ -1167,11 +1167,12 @@ PAF_ASIT_initPhaseCommon(
     //
     TRACE_TERSE0("PAF_ASIT_initPhaseCommon: calling PAF_ALG_setup.");
     PAF_ALG_setup(&pafAlgConfig, 
-        HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-        HEAP_ID_INTERNAL1,      HEAP_INTERNAL1, 
-        HEAP_ID_EXTERNAL,       HEAP_EXTERNAL, 
-        HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM, 
-        HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM, 
+        HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+        HEAP_ID_INTERNAL1,              HEAP_INTERNAL1, 
+        HEAP_ID_EXTERNAL,               HEAP_EXTERNAL, 
+        HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM, 
+        HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM, 
+        HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
         HEAP_CLEAR);
 
     if (pP->fxns->headerPrint)
@@ -1370,11 +1371,12 @@ PAF_ASIT_initPhaseDevice(
     if (pP->fxns->bufMemPrint)
     {
         PAF_ALG_setup (&pafAlgConfig, 
-            HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-            HEAP_ID_INTERNAL1,      HEAP_INTERNAL1,
-            HEAP_ID_EXTERNAL,       HEAP_EXTERNAL,
-            HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM,
-            HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM,
+            HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+            HEAP_ID_INTERNAL1,              HEAP_INTERNAL1,
+            HEAP_ID_EXTERNAL,               HEAP_EXTERNAL,
+            HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM,
+            HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM,
+            HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
             HEAP_CLEAR);
         TRACE_TERSE2("PAF_ASIT_initPhaseDevice: AS%d: calling PAF_ALG_setup with clear at %d.", as, HEAP_CLEAR);
     }
index 770c8b822b0d8959efc7cc70cd93a47484573bc0..b8154d2ee1deff0f6b5cee131a4ed07b0a357e98 100644 (file)
@@ -597,11 +597,12 @@ PAF_ASOT_initPhaseCommon(
     //
     TRACE_TERSE0("PAF_ASOT_initPhaseCommon: calling PAF_ALG_setup.");
     PAF_ALG_setup(&pafAlgConfig, 
-        HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-        HEAP_ID_INTERNAL1,      HEAP_INTERNAL1, 
-        HEAP_ID_EXTERNAL,       HEAP_EXTERNAL, 
-        HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM, 
-        HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM, 
+        HEAP_ID_INTERNAL,                 HEAP_INTERNAL, 
+        HEAP_ID_INTERNAL1,                HEAP_INTERNAL1, 
+        HEAP_ID_EXTERNAL,                 HEAP_EXTERNAL, 
+        HEAP_ID_INTERNAL1_SHM,            HEAP_INTERNAL1_SHM, 
+        HEAP_ID_EXTERNAL_SHM,             HEAP_EXTERNAL_SHM, 
+        HEAP_ID_EXTERNAL_NONCACHED_SHM,   HEAP_EXTERNAL_NONCACHED_SHM,
         HEAP_CLEAR);
 
     if (pP->fxns->headerPrint)
@@ -886,11 +887,12 @@ PAF_ASOT_initPhaseDevice(
     if(pP->fxns->bufMemPrint)
     {
         PAF_ALG_setup (&pafAlgConfig, 
-            HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-            HEAP_ID_INTERNAL1,      HEAP_INTERNAL1,
-            HEAP_ID_EXTERNAL,       HEAP_EXTERNAL,
-            HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM,
-            HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM,
+            HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+            HEAP_ID_INTERNAL1,              HEAP_INTERNAL1,
+            HEAP_ID_EXTERNAL,               HEAP_EXTERNAL,
+            HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM,
+            HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM,
+            HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
             HEAP_CLEAR);
         TRACE_TERSE2("PAF_ASOT_initPhaseDevice: AS%d: calling PAF_ALG_setup with clear at %d.", as, HEAP_CLEAR);
     }
index a188d941080ec4608faf94e76241231e0dbcbfab..943c306b1e460d1de187a5f3620a3c6ed22fcfc6 100644 (file)
@@ -44,6 +44,7 @@ All rights reserved.
 #include <xdc/runtime/System.h>
 #include <ti/ipc/SharedRegion.h>
 #include <ti/ipc/Ipc.h>
+#include <ti/sysbios/family/c66/Cache.h>
 
 #include "pafhjt.h"
 #include "paf_heapMgr.h"
@@ -85,7 +86,7 @@ Int gSysInit=0;
 Void taskSysInitFxn(Void)
 {
     UInt16  regionId;
-    IHeap_Handle srHeapMsmc, srHeapDdr3;
+    IHeap_Handle srHeapMsmc, srHeapDdr3, srHeapNonCacheDdr3;
     UInt16 remoteProcId;    
     Int status;
 
@@ -107,6 +108,16 @@ Void taskSysInitFxn(Void)
     //} while ((status < 0) && (status == Ipc_E_NOTREADY));
     } while (status != Ipc_S_SUCCESS);
 
+    // Create Shared DDR region as non-Cacheable
+    // TODO: remove hardcoded address and get correct values from .bld
+    {   // base: 0x81000000, len: 0x01000000,
+        UInt Common2_DDR3_MAR_base = 0x01848204;
+        UInt Common2_DDR3_base = 0x81000000;
+        UInt Common2_DDR3_len = 0x01000000;
+        // disable cache for common2 DDR3
+        Cache_setMar(Common2_DDR3_base, Common2_DDR3_len, Cache_Mar_DISABLE);
+    }
+
     /* Initialize (IPC) ASP master messaging */
     /* Note: MessageQ_open() called in this function.
              MessageQ_open() blocks. */
@@ -136,11 +147,14 @@ Void taskSysInitFxn(Void)
     srHeapMsmc = (IHeap_Handle)SharedRegion_getHeap(regionId);
     regionId = SharedRegion_getIdByName("SR_DDR3");
     srHeapDdr3 = (IHeap_Handle)SharedRegion_getHeap(regionId);
+    regionId = SharedRegion_getIdByName("COMMON2_DDR3");
+    srHeapNonCacheDdr3 = (IHeap_Handle)SharedRegion_getHeap(regionId);
     pafHeapMgr_init((IHeap_Handle)heapMemL2Sram, 
         (IHeap_Handle)heapMemMsmcSram, 
         (IHeap_Handle)heapMemDdr3, 
         srHeapMsmc, 
-        srHeapDdr3);
+        srHeapDdr3,
+        srHeapNonCacheDdr3);
     
     /* Initialize HJT */
     pafhjt = &PAFHJT_RAM;