]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
ping_rpmsg: Add OPBU OMAP5 configs and update ping_rpmsg config/build.
authorG Anthony <a0783926@ti.com>
Thu, 28 Feb 2013 02:35:23 +0000 (18:35 -0800)
committerG Anthony <a0783926@ti.com>
Thu, 28 Feb 2013 02:35:23 +0000 (18:35 -0800)
TBD: The OMAP5 configs are structured differently.
This ipcdev configs needs proper merging and refactoring.

Signed-off-by: G Anthony <a0783926@ti.com>
packages/ti/configs/omap54xx/Dsp.cfg
packages/ti/configs/omap54xx/IpcCommon.cfg.xs
packages/ti/configs/omap54xx/IpuSmp.cfg
packages/ti/ipc/tests/messageq_common.cfg.xs
packages/ti/ipc/tests/package.bld
packages/ti/ipc/tests/ping_rpmsg.cfg
packages/ti/ipc/tests/ping_rpmsg_common.cfg.xs [new file with mode: 0644]

index 66f25d0235eee33f214ec8ba7c2964d14a13e3de..5ceef3e1e9fbef12364e2479961a5e8e15aeb44e 100644 (file)
@@ -54,9 +54,12 @@ var BIOS        = xdc.useModule('ti.sysbios.BIOS');
 BIOS.libType    = BIOS.LibType_Debug;
 
 xdc.loadPackage('ti.ipc.rpmsg');
+
+/* TBD: Not yet taken in from omapzoom:
 xdc.loadPackage('ti.srvmgr');
 xdc.useModule('ti.srvmgr.omx.OmxSrvMgr');
 xdc.loadPackage('ti.resmgr');
+*/
 
 /* Enable Memory Translation module that operates on the BIOS Resource Table */
 var IpcMemory = xdc.useModule('ti.resources.IpcMemory');
@@ -73,16 +76,18 @@ Power.loadSegment = "PM_DATA";
 /* Idle function that periodically flushes the unicache */
 var Idle = xdc.useModule('ti.sysbios.knl.Idle');
 
-Idle.addFunc('&ti_deh_Deh_idleBegin'); /* Must be placed before pwr mgmt */
+//TBD: Idle.addFunc('&ti_deh_Deh_idleBegin'); /* Must be placed before pwr mgmt */
 Idle.addFunc('&IpcPower_idle');        /* IpcPower_idle must be at the end */
 
 var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
 var List      = xdc.useModule('ti.sdo.utils.List');
 
 /* ti.grcm Configuration */
+/* TBD:
 var rcmSettings = xdc.useModule('ti.grcm.Settings');
 rcmSettings.ipc = rcmSettings.IpcSupport_ti_sdo_ipc;
 xdc.useModule('ti.grcm.RcmServer');
+*/
 xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
 var GateSwi   = xdc.useModule('ti.sysbios.gates.GateSwi');
 
@@ -114,7 +119,7 @@ Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
 
 var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
-var Deh = xdc.useModule('ti.deh.Deh');
+//TBD: var Deh = xdc.useModule('ti.deh.Deh');
 Hwi.enableException = true;
 
 /* -------------------------------- DSP ----------------------------------*/
index 65ef0ef4ad40a95acf1e766dfd06365a35c22f04..ee860bbc9676cd12391ccf959f7e9d8c4a01436e 100644 (file)
@@ -50,10 +50,18 @@ var BIOS        = xdc.useModule('ti.sysbios.BIOS');
 /* Reduces code size, by only pulling in modules explicitly referenced: */
 BIOS.libType    = BIOS.LibType_Custom;
 
+/* This calls MessageQCopy_init() once before BIOS_start(): */
+xdc.loadPackage('ti.ipc.ipcmgr');
+BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
+
 xdc.loadPackage('ti.ipc.rpmsg');
+xdc.loadPackage('ti.ipc.family.omap54xx');
+
+/* TBD:
 xdc.loadPackage('ti.srvmgr');
 xdc.useModule('ti.srvmgr.omx.OmxSrvMgr');
 xdc.loadPackage('ti.resmgr');
+*/
 
 /* Enable Memory Translation module that operates on the BIOS Resource Table */
 var IpcMemory = xdc.useModule('ti.resources.IpcMemory');
@@ -65,9 +73,11 @@ var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
 var List      = xdc.useModule('ti.sdo.utils.List');
 
 /* ti.grcm Configuration */
+/* TBD:
 var rcmSettings = xdc.useModule('ti.grcm.Settings');
 rcmSettings.ipc = rcmSettings.IpcSupport_ti_sdo_ipc;
 xdc.useModule('ti.grcm.RcmServer');
+*/
 xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
 var GateSwi   = xdc.useModule('ti.sysbios.gates.GateSwi');
 
@@ -89,9 +99,10 @@ Text.isLoaded = true;
 var Registry = xdc.useModule('xdc.runtime.Registry');
 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
 Registry.common$.diags_EXIT  = Diags.RUNTIME_OFF;
-Registry.common$.diags_INFO  = Diags.RUNTIME_OFF;
-Registry.common$.diags_LIFECYCLE = Diags.RUNTIME_OFF;
-Registry.common$.diags_STATUS = Diags.RUNTIME_OFF;
+Registry.common$.diags_USER1 = Diags.ALWAYS_ON;
+Registry.common$.diags_INFO  = Diags.ALWAYS_ON;
+Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
+Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
 Diags.setMaskEnabled = true;
 
 var Main = xdc.useModule('xdc.runtime.Main');
@@ -99,12 +110,14 @@ Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
 
 var Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
-var Deh = xdc.useModule('ti.deh.Deh');
+//TBD: var Deh = xdc.useModule('ti.deh.Deh');
 Hwi.enableException = true;
 Hwi.nvicCCR.DIV_0_TRP = 1;
 
 /* Include stack debug helper */
+/* TBD:
 var StackDbg = xdc.useModule('ti.trace.StackDbg');
+*/
 
 var dmTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
 /* dmTimer 0 mapped to GPT3 */
@@ -129,4 +142,6 @@ var halTimer = xdc.useModule('ti.sysbios.hal.Timer');
 halTimer.TimerProxy = dmTimer;
 
 /* Version module */
+/* ???
 xdc.useModule('ti.utils.Version');
+*/
index 758bc5c23261254bc60d502ea57d4a9d9b7adb2a..0f6a4de3453f8e595b4248d65da5a3215b075e38 100644 (file)
@@ -64,9 +64,13 @@ var Idle = xdc.useModule('ti.sysbios.knl.Idle');
 /* Function to flush unicache in each core */
 Idle.addCoreFunc('&VirtQueue_cacheWb', 0);
 Idle.addCoreFunc('&VirtQueue_cacheWb', 1);
+
 /* Watchdog detection functions in each core */
+/* TBD: DEH not taken from omapzoom yet:
 Idle.addCoreFunc('&ti_deh_Deh_idleBegin', 0);
 Idle.addCoreFunc('&ti_deh_Deh_idleBegin', 1);
+*/
+
 /* Idle Power Management functions for each core */
 Idle.addCoreFunc('&IpcPower_idle', 0);
 Idle.addCoreFunc('&IpcPower_idle', 1);
index 1632311402fa3c58521ab73db2a0dc239594d747..697008cc92584ac8209739122551852cc44c7226 100644 (file)
@@ -235,5 +235,8 @@ Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
 var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportVirtioSetup');
 VirtioSetup.common$.diags_INFO = Diags.RUNTIME_OFF;
 
+var Main = xdc.useModule('xdc.runtime.Main');
+Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
+Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
 
 xdc.loadPackage('ti.ipc.transports').profile = 'release';
index bb2e5a362fc70e9f4f99b5470c60b03503657c6e..10347ac18697f6e85ce4a0c6d15bfb74e6519877 100644 (file)
@@ -71,8 +71,8 @@ for (var i = 0; i < Build.targets.length; i++) {
 
 //    print("building for target " + targ.name + " ...");
 
-    /* currently only build for OMAPL138, Appleton and Kepler */
-    if (!((targ.isa == "674") || (targ.isa == "66"))) {
+    /* currently only build for OMAPL138, Keystone II, and OMAP5*/
+    if (!((targ.isa == "674") || (targ.isa == "66") || (targ.isa == "v7M"))) {
         continue;
     }
 
@@ -80,9 +80,10 @@ for (var i = 0; i < Build.targets.length; i++) {
     for (var j = 0; j < targ.platforms.length; j++) {
         var platform = targ.platforms[j];
 
-        /* currently only build for OMAPL138, Appleton and Kepler */
+        /* currently only build for OMAPL138, Keystone II, and OMAP5*/
         if (!((platform.match(/^ti\.platforms\.evm6614\:DSP/)) ||
               (platform.match(/^ti\.platforms\.simKepler/)) ||
+              (platform.match(/^ti\.platform\.omap54xx/)) ||
               (platform.match(/\.platforms\.evmOMAPL138/)))) {
              continue;
         }
@@ -112,7 +113,7 @@ for (var i = 0; i < Build.targets.length; i++) {
                 }).addObjects(["dual_transports.c"]);
         }
 
-
+/* RE-ENABLE after ping_rpmsg works on OMAP5 SMP:
         Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
             cfgScript: "rpmsg_transport",
             defs: "-D BENCHMARK "
@@ -122,7 +123,7 @@ for (var i = 0; i < Build.targets.length; i++) {
             cfgScript: "rpmsg_transport",
             defs: "-D BENCHMARK "
         }).addObjects(["messageq_single.c"]);
-
+*/
         if (platform.match(/^ti\.platforms\.evmOMAPL138\:DSP/)) {
                 Pkg.addExecutable(name + "/nano_test", targ, platform, {
                     cfgScript: "rpmsg_transport"
index 66f37f64890102b0a7957f0e575b2940fd7649eb..fdf1bb7754dc87cc08f104913396b455324ab976 100644 (file)
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-var Memory = xdc.useModule('xdc.runtime.Memory');
-var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
-var BIOS = xdc.useModule('ti.sysbios.BIOS');
-BIOS.heapSize = 0x20000;
-//BIOS.libType = BIOS.LibType_Custom;
-
-var Idle = xdc.useModule('ti.sysbios.knl.Idle');
-Idle.addFunc('&VirtQueue_cacheWb');
-
-var System = xdc.useModule('xdc.runtime.System');
-var SysMin = xdc.useModule('xdc.runtime.SysMin');
-System.SupportProxy = SysMin;
-
-var Diags = xdc.useModule('xdc.runtime.Diags');
-
 print ("Program.cpu.deviceName = " + Program.cpu.deviceName);
 print ("Program.platformName = " + Program.platformName);
-if (Program.cpu.deviceName == "OMAPL138") {
-    xdc.useModule('ti.ipc.family.omapl138.VirtQueue');
-    xdc.useModule('ti.sdo.ipc.family.da830.InterruptDsp');
-
-    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-    MultiProc.setConfig("DSP", ["HOST", "DSP"]);
-
-    /* Enable Memory Translation module that operates on the Resource Table */
-    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
-    Resource.loadSegment = Program.platform.dataMemory;
-
-    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
-    Program.sectMap[".text:_c_int00"].loadSegment = "DDR";
-    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
-
-    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
-
-    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
-    /* Set 0xc4000000 -> 0xc4ffffff to be non-cached for shared memory IPC */
-    Cache.MAR192_223 = 0x00000010;
-
-    Program.global.sysMinBufSize = 0x8000;
-    SysMin.bufSize  =  Program.global.sysMinBufSize;
-
-    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
-    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
-    Timer.timerSettings[1].master = true;
-    Timer.defaultHalf = Timer.Half_LOWER;
-    Clock.timerId = 1;
-
-    Diags.setMaskMeta("ti.ipc.family.omapl138.Interrupt", Diags.USER1,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.family.omapl138.VirtQueue", Diags.USER1,
-        Diags.ALWAYS_ON);
-}
-else if (Program.platformName.match(/6614/)) {
-    var VirtQueue = xdc.useModule('ti.ipc.family.tci6614.VirtQueue');
-    var Interrupt = xdc.useModule('ti.ipc.family.tci6614.Interrupt');
-
-    /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */
-    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-    MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3"]);
-
-    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
-    Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM";
-    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
-
-    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
-
-    /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable.
-       We assume the rest is to be left cacheable.
-       Per sprugw0b.pdf
-        0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh
-        0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh
-    */
-    var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
-    /*  This doesn't work:
-         Cache.MAR160_191 = 0xFFFFFFFC;
-         So, need to do this:
-    */
-    Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0);
-
-    Program.global.sysMinBufSize = 0x8000;
-    SysMin.bufSize  =  Program.global.sysMinBufSize;
-
-    /* Enable Memory Translation module that operates on the Resource Table */
-    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
-    Resource.loadSegment = Program.platform.dataMemory;
 
-    /*  COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */
-    /*
-    Diags.setMaskMeta("ti.ipc.family.tci6614.Interrupt", Diags.USER1,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.family.tci6614.VirtQueue", Diags.USER1,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.transports.TransportVirtio",
-        Diags.INFO|Diags.USER1|Diags.STATUS,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO,
-        Diags.ALWAYS_ON);
-    */
-}
-else if (Program.platformName.match(/simKepler/)) {
-    var VirtQueue = xdc.useModule('ti.ipc.family.tci6638.VirtQueue');
-    var Interrupt = xdc.useModule('ti.ipc.family.tci6638.Interrupt');
-
-    /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */
-    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-    MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
-                               "CORE4", "CORE5", "CORE6", "CORE7"]);
-    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
-    Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM";
-    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
-
-    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
-
-    /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable.
-       We assume the rest is to be left cacheable.
-       Per sprugw0b.pdf
-        0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh
-        0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh
-    */
-    var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
-    /*  This doesn't work:
-         Cache.MAR160_191 = 0xFFFFFFFC;
-         So, need to do this:
-    */
-    /* TBD: Update for Kepler: */
-    Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0);
-
-    Program.global.sysMinBufSize = 0x8000;
-    SysMin.bufSize  =  Program.global.sysMinBufSize;
-
-    /* Enable Memory Translation module that operates on the Resource Table */
-    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
-    Resource.loadSegment = Program.platform.dataMemory;
-
-    /*  COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */
-    /*
-    Diags.setMaskMeta("ti.ipc.family.tci6638.Interrupt", Diags.USER1,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.family.tci6638.VirtQueue", Diags.USER1,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.transports.TransportVirtio",
-        Diags.INFO|Diags.USER1|Diags.STATUS,
-        Diags.ALWAYS_ON);
-    Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO,
-        Diags.ALWAYS_ON);
-    */
-}
-else if (Program.platformName.match(/OMAP5/)) {
-    var Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
-
-    /* Modules used in Power Management */
-    xdc.loadPackage('ti.pm');
-    var Power = xdc.useModule('ti.sysbios.family.arm.ducati.omap4430.Power');
-    Power.loadSegment = "PM_DATA";
-    /* IpcPower idle function must be at the end */
-    Idle.addFunc('&IpcPower_idle');
-
-    xdc.includeFile("ti/configs/omap4430/DucatiCore0.cfg");
-    xdc.includeFile("ti/configs/omap4430/DucatiAmmu.cfg");
+/* This will match for omap5 SMP only: */
+if (Program.platformName.match(/ipu/)) {
+    var Task          = xdc.useModule('ti.sysbios.knl.Task');
+    var params = new Task.Params;
+    params.instance.name = "ping";
+    params.arg0= 51;
+    Program.global.tsk1 = Task.create('&pingTaskFxn', params);
+    Task.deleteTerminatedTasks = true;
+
+    xdc.loadCapsule("ti/configs/omap54xx/IpcCommon.cfg.xs");
+    xdc.includeFile("ti/configs/omap54xx/IpuSmp.cfg");
+    xdc.includeFile("ti/configs/omap54xx/IpuAmmu.cfg");
 }
 else {
-    throw("messageq_common.cfg: Did not match any platform!");
+    xdc.loadCapsule("ping_rpmsg_common.cfg.xs");
 }
-
-Hwi.enableException = true;
-
-xdc.loadPackage('ti.ipc.ipcmgr');
-BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
-
-xdc.loadPackage('ti.ipc.rpmsg');
-
-var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
-var List      = xdc.useModule('ti.sdo.utils.List');
-
-xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
-var GateSwi   = xdc.useModule('ti.sysbios.gates.GateSwi');
-
-var Task          = xdc.useModule('ti.sysbios.knl.Task');
-var params = new Task.Params;
-params.instance.name = "ping";
-params.arg0= 51;
-//params.arg0= 61;
-Program.global.tsk1 = Task.create('&pingTaskFxn', params);
-Task.deleteTerminatedTasks = true;
-
-var Assert = xdc.useModule('xdc.runtime.Assert');
-var Defaults = xdc.useModule('xdc.runtime.Defaults');
-var Diags = xdc.useModule('xdc.runtime.Diags');
-var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
-var LoggerSysParams = new LoggerSys.Params();
-
-/* Enable Logger: */
-//Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
-Defaults.common$.logger = null;
-
-/* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
-var Text = xdc.useModule('xdc.runtime.Text');
-Text.isLoaded = true;
-var Registry = xdc.useModule('xdc.runtime.Registry');
-Registry.common$.diags_INFO  = Diags.ALWAYS_ON;
-Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
-Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
-Diags.setMaskEnabled = true;
diff --git a/packages/ti/ipc/tests/ping_rpmsg_common.cfg.xs b/packages/ti/ipc/tests/ping_rpmsg_common.cfg.xs
new file mode 100644 (file)
index 0000000..bb3ee65
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var Memory = xdc.useModule('xdc.runtime.Memory');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+BIOS.heapSize = 0x20000;
+//BIOS.libType = BIOS.LibType_Custom;
+
+var Idle = xdc.useModule('ti.sysbios.knl.Idle');
+Idle.addFunc('&VirtQueue_cacheWb');
+
+var System = xdc.useModule('xdc.runtime.System');
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+System.SupportProxy = SysMin;
+
+var Diags = xdc.useModule('xdc.runtime.Diags');
+
+if (Program.cpu.deviceName == "OMAPL138") {
+    xdc.useModule('ti.ipc.family.omapl138.VirtQueue');
+    xdc.useModule('ti.sdo.ipc.family.da830.InterruptDsp');
+
+    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+    MultiProc.setConfig("DSP", ["HOST", "DSP"]);
+
+    /* Enable Memory Translation module that operates on the Resource Table */
+    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
+    Resource.loadSegment = Program.platform.dataMemory;
+
+    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
+    Program.sectMap[".text:_c_int00"].loadSegment = "DDR";
+    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
+
+    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
+
+    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
+    /* Set 0xc4000000 -> 0xc4ffffff to be non-cached for shared memory IPC */
+    Cache.MAR192_223 = 0x00000010;
+
+    Program.global.sysMinBufSize = 0x8000;
+    SysMin.bufSize  =  Program.global.sysMinBufSize;
+
+    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
+    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+    Timer.timerSettings[1].master = true;
+    Timer.defaultHalf = Timer.Half_LOWER;
+    Clock.timerId = 1;
+
+    Diags.setMaskMeta("ti.ipc.family.omapl138.Interrupt", Diags.USER1,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.family.omapl138.VirtQueue", Diags.USER1,
+        Diags.ALWAYS_ON);
+}
+else if (Program.platformName.match(/6614/)) {
+    var VirtQueue = xdc.useModule('ti.ipc.family.tci6614.VirtQueue');
+    var Interrupt = xdc.useModule('ti.ipc.family.tci6614.Interrupt');
+
+    /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */
+    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+    MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3"]);
+
+    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
+    Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM";
+    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
+
+    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
+
+    /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable.
+       We assume the rest is to be left cacheable.
+       Per sprugw0b.pdf
+        0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh
+        0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh
+    */
+    var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
+    /*  This doesn't work:
+         Cache.MAR160_191 = 0xFFFFFFFC;
+         So, need to do this:
+    */
+    Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0);
+
+    Program.global.sysMinBufSize = 0x8000;
+    SysMin.bufSize  =  Program.global.sysMinBufSize;
+
+    /* Enable Memory Translation module that operates on the Resource Table */
+    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
+    Resource.loadSegment = Program.platform.dataMemory;
+
+    /*  COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */
+    /*
+    Diags.setMaskMeta("ti.ipc.family.tci6614.Interrupt", Diags.USER1,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.family.tci6614.VirtQueue", Diags.USER1,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.transports.TransportVirtio",
+        Diags.INFO|Diags.USER1|Diags.STATUS,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO,
+        Diags.ALWAYS_ON);
+    */
+}
+else if (Program.platformName.match(/simKepler/)) {
+    var VirtQueue = xdc.useModule('ti.ipc.family.tci6638.VirtQueue');
+    var Interrupt = xdc.useModule('ti.ipc.family.tci6638.Interrupt');
+
+    /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */
+    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+    MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
+                               "CORE4", "CORE5", "CORE6", "CORE7"]);
+    Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();
+    Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM";
+    Program.sectMap[".text:_c_int00"].loadAlign = 0x400;
+
+    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
+
+    /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable.
+       We assume the rest is to be left cacheable.
+       Per sprugw0b.pdf
+        0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh
+        0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh
+    */
+    var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
+    /*  This doesn't work:
+         Cache.MAR160_191 = 0xFFFFFFFC;
+         So, need to do this:
+    */
+    /* TBD: Update for Kepler: */
+    Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0);
+
+    Program.global.sysMinBufSize = 0x8000;
+    SysMin.bufSize  =  Program.global.sysMinBufSize;
+
+    /* Enable Memory Translation module that operates on the Resource Table */
+    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
+    Resource.loadSegment = Program.platform.dataMemory;
+
+    /*  COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */
+    /*
+    Diags.setMaskMeta("ti.ipc.family.tci6638.Interrupt", Diags.USER1,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.family.tci6638.VirtQueue", Diags.USER1,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.transports.TransportVirtio",
+        Diags.INFO|Diags.USER1|Diags.STATUS,
+        Diags.ALWAYS_ON);
+    Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO,
+        Diags.ALWAYS_ON);
+    */
+}
+else {
+    throw("messageq_common.cfg: Did not match any platform!");
+}
+
+Hwi.enableException = true;
+
+xdc.loadPackage('ti.ipc.ipcmgr');
+BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
+
+xdc.loadPackage('ti.ipc.rpmsg');
+
+var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
+var List      = xdc.useModule('ti.sdo.utils.List');
+
+xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
+var GateSwi   = xdc.useModule('ti.sysbios.gates.GateSwi');
+
+var Task          = xdc.useModule('ti.sysbios.knl.Task');
+var params = new Task.Params;
+params.instance.name = "ping";
+params.arg0= 51;
+//params.arg0= 61;
+Program.global.tsk1 = Task.create('&pingTaskFxn', params);
+Task.deleteTerminatedTasks = true;
+
+var Assert = xdc.useModule('xdc.runtime.Assert');
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
+var LoggerSysParams = new LoggerSys.Params();
+
+/* Enable Logger: */
+Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
+// FOR BENCHMARKING: Defaults.common$.logger = null;
+
+/* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
+var Text = xdc.useModule('xdc.runtime.Text');
+Text.isLoaded = true;
+var Registry = xdc.useModule('xdc.runtime.Registry');
+Registry.common$.diags_INFO  = Diags.ALWAYS_ON;
+Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
+Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
+Diags.setMaskEnabled = true;
+
+var Main = xdc.useModule('xdc.runtime.Main');
+Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
+Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;