Update for examples
authorRaghu Nambiath <rnambiath@ti.com>
Wed, 22 Jan 2014 22:26:54 +0000 (17:26 -0500)
committerRaghu Nambiath <rnambiath@ti.com>
Wed, 22 Jan 2014 22:26:54 +0000 (17:26 -0500)
example/k2l/c66/bios/link.cmd [new file with mode: 0644]
example/k2l/c66/bios/sample_config.cfg [new file with mode: 0644]
example/k2l/c66/bios/tcp3dK2LC66BiosExampleProject.txt [new file with mode: 0644]
example/k2l/c66/bios/tcp3d_osal.c [new file with mode: 0644]

diff --git a/example/k2l/c66/bios/link.cmd b/example/k2l/c66/bios/link.cmd
new file mode 100644 (file)
index 0000000..b577539
--- /dev/null
@@ -0,0 +1,7 @@
+SECTIONS
+{
+       .init_array: load >> L2SRAM
+       .csl_vect               > L2SRAM
+       .main_mem               > L2SRAM
+       .profile_mem    > L2SRAM
+}
diff --git a/example/k2l/c66/bios/sample_config.cfg b/example/k2l/c66/bios/sample_config.cfg
new file mode 100644 (file)
index 0000000..1e13599
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * ======== sample_config.cfg ========
+ */
+
+/* IPC packages */
+var ListMP = xdc.useModule('ti.sdo.ipc.ListMP');
+var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');
+var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
+var HeapMemMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP');
+var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+var Ipc         = xdc.useModule('ti.sdo.ipc.Ipc');
+
+/* Configure System to use SysMin */
+System = xdc.useModule('xdc.runtime.System');
+SysStd  = xdc.useModule('xdc.runtime.SysStd');
+System.SupportProxy = xdc.useModule('xdc.runtime.SysMin')
+System.SupportProxy = SysStd;
+System.extendedFormats = "%$S%f";
+
+/* Set the system stack - 0x2000 */
+Program.stack = 0x4000;
+
+var Memory = xdc.useModule('xdc.runtime.Memory');
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+
+/* Use HeapMem for default heap manager and give it 49152 (0xC000)
+ * bytes to work with.
+ */
+Program.sectMap["systemHeap"] = Program.platform.dataMemory;
+var heapMemParams = new HeapMem.Params;
+heapMemParams.size = 0x18000;
+heapMemParams.sectionName = "systemHeap";
+Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
+
+/*
+ * Creating Heap Memories for using with test application
+ */
+/* Create a heap for TCP3D input/output data using ti.bios.HeapMem. */
+/* Program.sectMap["tcp3DataSection"] = {loadSegment: "MSMCSRAM"};
+var heapMemParams1 = new HeapMem.Params;
+heapMemParams1.size = 0x100000;
+heapMemParams1.align = 64;
+heapMemParams1.sectionName = "tcp3DataSection";
+Program.global.tcp3dDataHeap = HeapMem.create(heapMemParams1); */
+
+/* Create a heap for TCP3D driver using ti.bios.HeapMem. */
+Program.sectMap["tcp3DriverSection"] = Program.platform.dataMemory;
+var heapMemParams2 = new HeapMem.Params;
+heapMemParams2.size = 0x4000;
+heapMemParams2.sectionName = "tcp3DriverSection";
+Program.global.tcp3dDrvHeap = HeapMem.create(heapMemParams2);
+
+/* Create a heap for TCP3D QUEUE DESCRIPTORS using ti.bios.HeapMem. */
+Program.sectMap["tcp3QueueDescrSection"] = Program.platform.dataMemory;
+var heapMemParams3 = new HeapMem.Params;
+heapMemParams3.size = 4096;
+heapMemParams3.sectionName = "tcp3QueueDescrSection";
+Program.global.tcp3dQueHeap = HeapMem.create(heapMemParams3);
+
+/* To avoid wasting shared memory for Notify and MessageQ transports */
+for (var i = 0; i < MultiProc.numProcessors; i++) {
+    Ipc.setEntryMeta({
+        remoteProcId: i,
+        setupNotify: false,
+        setupMessageQ: false,
+    });
+}
+
+
+SharedRegion.setEntryMeta(0,
+    { base: 0x0C000000,
+      len: 0x100000,
+      ownerProcId: 0,
+      cacheLineSize: 64,
+      isValid: true,
+      name: "sharemem",
+    });
+
+/* 
+ * Pull in Timer, Semaphore, Swi, Task, and Queue modules
+ * used in this example.
+ */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+xdc.useModule('ti.sysbios.hal.Timer');
+xdc.useModule('ti.sysbios.knl.Semaphore');
+xdc.useModule('ti.sysbios.knl.Swi');
+xdc.useModule('ti.sysbios.knl.Task');
+xdc.useModule('ti.sysbios.hal.Cache');
+xdc.useModule('ti.sysbios.family.c64p.Hwi');
+xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
+xdc.useModule('xdc.runtime.Log');
+xdc.useModule('xdc.runtime.Error');
+var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
+var ECM = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+
+/*
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
+ */
+ECM.eventGroupHwiNum[0] = 7;
+ECM.eventGroupHwiNum[1] = 8;
+ECM.eventGroupHwiNum[2] = 9;
+ECM.eventGroupHwiNum[3] = 10;
+
+/*
+ * Setup the Logger for Driver
+ */
+var LoggerSys0Params0 = new LoggerSys.Params;
+LoggerSys0Params0.instance.name = 'tcp3dDrvLog';
+Program.global.tcp3dDrvLog = LoggerSys.create(LoggerSys0Params0);
+
+/*
+ * allow printf() to be called from Swi threads. Note that use of this gate
+ * incurs additional latency for Swi processing since Swi scheduler will be
+ * disabled to manage critical sections within the RTS library code.
+BIOS.rtsGateType = BIOS.GateSwi;
+ */
+
+
+/*
+ * Adding the other Dependent packages
+ */
+/*xdc.loadPackage('ti.wbi.common.api');*/
+xdc.loadPackage('ti.sdo.edma3.drv');
+
+/* Load the TCP3D package */
+var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');
+
+/* Load the CSL package */
+var Csl = xdc.useModule('ti.csl.Settings');
+
+/* Device specific configuration */
+var devName = "k2l";
+Csl.deviceType      = devName;
diff --git a/example/k2l/c66/bios/tcp3dK2LC66BiosExampleProject.txt b/example/k2l/c66/bios/tcp3dK2LC66BiosExampleProject.txt
new file mode 100644 (file)
index 0000000..29693a1
--- /dev/null
@@ -0,0 +1,16 @@
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_drv_sample_init.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_example_main.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/sample_cfg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/sample_cs.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/sample_init.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/sample_int_reg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/CpIntc_local.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_codeBlkSeg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_inputConfigPrep.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_itg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/src/tcp3d_testset_functions.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/k2k/c66/bios/tcp3d_osal.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/k2k/c66/bios/link.cmd"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/k2k/c66/bios/sample_config.cfg"
+-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2L -DUSE_TCP3D_DRIVER_TYPES --diag_warning=225 -I${TCP3D_INSTALL_PATH} -I${TCP3D_INSTALL_PATH}/ti/drv/tcp3d/example/src"
+-rtsc.enableRtsc
diff --git a/example/k2l/c66/bios/tcp3d_osal.c b/example/k2l/c66/bios/tcp3d_osal.c
new file mode 100644 (file)
index 0000000..6ec5345
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+ *   @file  sample_osal.c
+ *
+ *   @brief   
+ *      This is the OS abstraction layer and is used by the CPPI and QMSS
+ *      low level drivers for the CPPI sample example.
+ *
+ *  \par
+ *  ============================================================================
+ *  @n   (C) Copyright 2009, Texas Instruments, Inc.
+ * 
+ *  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.
+ *
+*/
+/* XDC includes */ 
+#include <xdc/std.h>
+#include <xdc/cfg/global.h>
+
+/**
+ *  @b Description
+ *  @n  
+ *      The function is the TCP3D OSAL Logging API which logs 
+ *      the messages on the console.
+ *
+ *  @param[in]  fmt
+ *      Formatted String.
+ *
+ *  @retval
+ *      Not Applicable
+ */
+void Osal_tcp3dLog ( char *fmt, ... )
+{
+}
+
+/**
+ *  @b Description
+ *  @n  
+ *      The function is the TCP3D OSAL memory copy API which is directly 
+ *      mapped to memcpy funciton.
+ *
+ *  @param[in]  _s1
+ *      destination address
+ *
+ *  @param[in]  _s2
+ *      source address
+ *
+ *  @param[in]  _n
+ *      number of bytes
+ *
+ *  @retval
+ *      destination address
+ */
+void* Osal_memcpy(void *_s1, const void *_s2, size_t _n)
+{
+    return memcpy(_s1, _s2, _n);
+}