TCP3D LLD support for Lamarr (K2L)
authorMurtaza Gaadiwala <murtaza@ti.com>
Fri, 26 Apr 2013 22:45:29 +0000 (18:45 -0400)
committerMurtaza Gaadiwala <murtaza@ti.com>
Fri, 26 Apr 2013 22:45:29 +0000 (18:45 -0400)
test/k2l/c66/bios/link_test.cmd [new file with mode: 0644]
test/k2l/c66/bios/tcp3dK2LC66BiosTestProject.txt [new file with mode: 0644]
test/k2l/c66/bios/tcp3d_drv_test.cfg [new file with mode: 0644]
test/k2l/c66/bios/tcp3d_osal.h [new file with mode: 0644]

diff --git a/test/k2l/c66/bios/link_test.cmd b/test/k2l/c66/bios/link_test.cmd
new file mode 100644 (file)
index 0000000..3744eff
--- /dev/null
@@ -0,0 +1,7 @@
+SECTIONS
+{
+        .init_array: load >> L2SRAM
+       .csl_vect               > L2SRAM
+       .main_mem               > L2SRAM
+       .profile_mem    > L2SRAM
+}
diff --git a/test/k2l/c66/bios/tcp3dK2LC66BiosTestProject.txt b/test/k2l/c66/bios/tcp3dK2LC66BiosTestProject.txt
new file mode 100644 (file)
index 0000000..8947e0c
--- /dev/null
@@ -0,0 +1,18 @@
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/src/tcp3d_betaState.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/src/tcp3d_drv.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/src/tcp3d_reg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_drv_sample_init.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/sample_cfg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_main.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/sample_cs.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/sample_init.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/sample_int_reg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/CpIntc_local.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_codeBlkSeg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_inputConfigPrep.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_itg.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/src/tcp3d_testset_functions.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/k2l/c66/bios/link_test.cmd"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/test/k2l/c66/bios/tcp3d_drv_test.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/test/src -I${TCP3D_INSTALL_PATH}/ti/drv/tcp3d/test/k2l/c66/bios"
+-rtsc.enableRtsc
diff --git a/test/k2l/c66/bios/tcp3d_drv_test.cfg b/test/k2l/c66/bios/tcp3d_drv_test.cfg
new file mode 100644 (file)
index 0000000..718dd7a
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * ======== tcp3d_drv_test.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;
+
+/*
+ * Pull in BIOS modules
+ */
+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('xdc.runtime.Log');
+xdc.useModule('xdc.runtime.Error');
+
+/*
+ * Memory related modules and then allocate as needed
+ */
+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 = 0x180000;
+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);
+
+/* 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: 0x200000,
+      ownerProcId: 0,
+      cacheLineSize: 64,
+      isValid: true,
+      name: "sharemem",
+    });
+
+/*
+ * Setup the Logger for Driver
+ */
+var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
+var LoggerSys0Params0 = new LoggerSys.Params;
+LoggerSys0Params0.instance.name = 'tcp3dDrvLog';
+Program.global.tcp3dDrvLog = LoggerSys.create(LoggerSys0Params0);
+
+/*
+ * Pull in modules for EDMA3 LLD use
+ */
+xdc.useModule('ti.sysbios.family.c64p.Hwi');
+xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
+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;
+
+/*******************************************************************
+ * Other Dependent packages
+ *******************************************************************/
+/*xdc.loadPackage('ti.wbi.common.api');*/
+xdc.loadPackage('ti.sdo.edma3.drv');
+
+/* Load the CSL package */
+var Csl = xdc.useModule('ti.csl.Settings');
+
+/* Device specific configuration */
+var devName = "k2l";
+Csl.deviceType = devName;
+
+/* end of file */
diff --git a/test/k2l/c66/bios/tcp3d_osal.h b/test/k2l/c66/bios/tcp3d_osal.h
new file mode 100644 (file)
index 0000000..2b308dc
--- /dev/null
@@ -0,0 +1,60 @@
+/**
+ *   @file  tcp3d_osal.h
+ *
+ *   @brief   
+ *      This is the OS adaptation layer for the TCP3D Driver which has 
+ *      been ported for XDC Runtime and BIOS.
+ *
+ *      This is an example of <b> Approach 2 </b> in which the 
+ *      application rebuilds the TCP3D driver with the new definitions.
+ *
+ *      Please refer to the 'tcp3d_osal.h' in the API documentation.
+ *
+ *  \par
+ *  NOTE:
+ *      (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.
+ *
+*/
+#ifndef __TCP3D_OSAL_H__
+#define __TCP3D_OSAL_H__
+
+#include <xdc/runtime/System.h>
+#include <ti/sysbios/BIOS.h>
+
+/* TCP3D OSAL Logging API is mapped directly to an XDC Runtime API */
+#define Tcp3d_osalLog           System_printf
+
+/* TCP3D OSAL memory operation APIs are mapped directly with standard runtime APIs */
+#define Tcp3d_memcpy            memcpy
+#define Tcp3d_memset            memset
+
+#endif /* __TCP3D_OSAL_H__ */
+