author | Ravi Sankar Korada <korada@ti.com> | |
Wed, 1 Aug 2012 21:06:44 +0000 (17:06 -0400) | ||
committer | Ravi Sankar Korada <korada@ti.com> | |
Wed, 1 Aug 2012 21:06:44 +0000 (17:06 -0400) |
1044 files changed:
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt
--- /dev/null
+++ b/Settings.xdc.xdt
@@ -0,0 +1,23 @@
+%%{\r
+/*!\r
+ * This template implements the Settings.xdc\r
+ */ \r
+ /* Versioning */\r
+ var ver = this;\r
+ for each(i=0;i<ver.length;i++)\r
+ {\r
+ if(String(ver[i]).length < 2)\r
+ {\r
+ ver[i]="0"+ver[i];\r
+ }\r
+ }\r
+ \r
+ var packageVersion = "\""+ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3]+"\"";\r
+\r
+%%}\r
+\r
+module Settings\r
+{\r
+ config string tcp3dVersionString = `packageVersion`;\r
+}\r
+\r
diff --git a/build/buildlib.xs b/build/buildlib.xs
--- /dev/null
+++ b/build/buildlib.xs
@@ -0,0 +1,535 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Build Library Utilities\r
+ ******************************************************************************\r
+ * FILE NAME: buildlib.xs\r
+ *\r
+ * DESCRIPTION: \r
+ * This file contains common routines that are used by the various TCP3D driver \r
+ * components.\r
+ *\r
+ * Copyright (C) 2011, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/**************************************************************************\r
+ * FUNCTION NAME : listAllFiles\r
+ **************************************************************************\r
+ * DESCRIPTION :\r
+ * Utility function which lists all files with a specific extension \r
+ * present in a directory and any directory inside it.\r
+ **************************************************************************/\r
+function listAllFiles(ext, dir, recurse)\r
+{ \r
+ var srcFile = [];\r
+ var d;\r
+ \r
+ /* If recurse parameter is not specified we default to recursive search. */\r
+ if (recurse == null)\r
+ recurse = true;\r
+ \r
+ if (dir == undefined) \r
+ d = ".";\r
+ else \r
+ d = dir;\r
+ \r
+ /* Get access to the current directory. */\r
+ var file = new java.io.File(d);\r
+ \r
+ /* Check if the file exists and it is a directory. */\r
+ if (file.exists() && file.isDirectory()) \r
+ {\r
+ /* Get a list of all files in the specific directory. */\r
+ var fileList = file.listFiles();\r
+ for (var i = 0; i < fileList.length; i++) \r
+ {\r
+ /* Dont add the generated directory 'package' and any of its files \r
+ * to the list here. */\r
+ if (fileList[i].getName().matches("package") == false)\r
+ {\r
+ /* Check if the detected file is a directory */\r
+ if (fileList[i].isDirectory())\r
+ {\r
+ /* We will recurse into the subdirectory only if required to do so. */\r
+ if (recurse == true)\r
+ {\r
+ /* Generate the directory Name in which we will recurse. */ \r
+ var directoryName = d + "/" + fileList[i].getName();\r
+ \r
+ /* Get a list of all files in this directory */\r
+ var fileListing = listAllFiles (ext, directoryName, recurse);\r
+ if (fileListing != null)\r
+ {\r
+ /* Return a list of all file names in the directory. */\r
+ for (var j = 0 ; j < fileListing.length; j++) \r
+ srcFile[srcFile.length++] = fileListing[j];\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ /* This was a file. Check if the file name matches the extension */\r
+ if (fileList[i].getName().endsWith(ext) == true)\r
+ srcFile[srcFile.length++] = d + "/" + fileList[i].getName();\r
+ }\r
+ }\r
+ }\r
+ return srcFile;\r
+ }\r
+ return null;\r
+}\r
+\r
+function createMake(makefile)\r
+{\r
+ /* Create the main make file */\r
+ var fileModule = xdc.module('xdc.services.io.File');\r
+ if(makefile==undefined)\r
+ {\r
+ try{\r
+ makefile = fileModule.open("makefile", "w");\r
+ } catch (ex)\r
+ {\r
+ print("makefile cannot be written to. Please check Writing Permissions.");\r
+ java.lang.System.exit(1);\r
+ } \r
+ \r
+ Pkg.makePrologue += "\ninclude makefile\n"; \r
+ \r
+ Pkg.makeEpilogue += "\nclean::\n\t-$(RM) makefile\n";\r
+ makefile.writeLine("#*******************************************************************************");\r
+ makefile.writeLine("#* FILE PURPOSE: Top level makefile for Creating Component Libraries");\r
+ makefile.writeLine("#*******************************************************************************");\r
+ makefile.writeLine("#* FILE NAME: makefile");\r
+ makefile.writeLine("#*");\r
+ makefile.writeLine("#* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options ");\r
+ makefile.writeLine("#*");\r
+ makefile.writeLine("#*");\r
+ makefile.writeLine("#*******************************************************************************");\r
+ makefile.writeLine("#*");\r
+ makefile.writeLine("# (Mandatory) Specify where various tools are installed.");\r
+\r
+ var file = xdc.module('xdc.services.io.File');\r
+ \r
+ var xdcTargetType = java.lang.System.getenv("XDCTARGET");\r
+ var toolsBaseDir = java.lang.System.getenv("XDCCGROOT"); \r
+ \r
+ makefile.writeLine("\n# Output for prebuilt generated libraries");\r
+ makefile.writeLine("export LIBDIR ?= ./lib");\r
+\r
+ /* Create INCDIR from XDCPATH */\r
+ \r
+ /* copy the environment array from the current environment */\r
+ var env = java.lang.System.getenv();\r
+ var getxdcpath=String(java.lang.System.getenv("XDCPATH"));\r
+ getxdcpath= getxdcpath.replace(/\\/g,"/");\r
+ var keys = env.keySet().toArray();\r
+ var key;\r
+ var stat={};\r
+ var env_j=[];\r
+ var listxdcpath = new Array();\r
+ for (var i = 0; i < keys.length; i++) {\r
+ key = String(keys[i]);\r
+ if((key.match("INSTALL_PATH")) || (key.match("INSTALLDIR")))\r
+ {\r
+ var keyPath=String(env.get(key));\r
+ keyPath=keyPath.replace(/\\/g,"/");\r
+ var file = xdc.module('xdc.services.io.File');\r
+ keyPath=file.getDOSPath(keyPath);\r
+ if(getxdcpath.toString().match(keyPath))\r
+ {\r
+ listxdcpath.push({keyname: key,keypath: keyPath});\r
+ while(getxdcpath.toString().match(keyPath))\r
+ {\r
+ getxdcpath=getxdcpath.toString().replace(keyPath,"$("+key+")");\r
+ }\r
+ }\r
+ }\r
+ }\r
+ var pkgroot="..";\r
+ for (var i = Pkg.name.split('.').length; i > 1; i--) {\r
+ pkgroot+="/..";\r
+ }\r
+ \r
+ makefile.writeLine("\n# ROOT Directory"); \r
+ makefile.writeLine("export ROOTDIR := "+pkgroot);\r
+ \r
+ makefile.writeLine("\n# INCLUDE Directory");\r
+ makefile.writeLine("export INCDIR := "+getxdcpath+";$(ROOTDIR)"); \r
+ \r
+ makefile.writeLine("\n# Common Macros used in make"); \r
+ makefile.writeLine("\nifndef RM"); \r
+ makefile.writeLine("export RM = rm -f");\r
+ makefile.writeLine("endif"); \r
+ \r
+ makefile.writeLine("\nifndef CP"); \r
+ makefile.writeLine("export CP = cp -p"); \r
+ makefile.writeLine("endif"); \r
+ \r
+ makefile.writeLine("\nexport MKDIR = mkdir -p");\r
+ \r
+ makefile.writeLine("\nifndef RMDIR"); \r
+ makefile.writeLine("export RMDIR = rm -rf");\r
+ makefile.writeLine("endif"); \r
+ \r
+ makefile.writeLine("\nifndef SED"); \r
+ makefile.writeLine("export SED = sed"); \r
+ makefile.writeLine("endif"); \r
+ \r
+ makefile.writeLine("\nifndef MAKE"); \r
+ makefile.writeLine("export MAKE = make"); \r
+ makefile.writeLine("endif"); \r
+\r
+ makefile.writeLine("\n# PHONY Targets"); \r
+ makefile.writeLine(".PHONY: all clean cleanall "); \r
+ \r
+ makefile.writeLine("\n# FORCE Targets"); \r
+ makefile.writeLine("FORCE: "); \r
+ \r
+ makefile.writeLine("\n# all rule"); \r
+ makefile.writeLine("all: .executables"); \r
+ makefile.writeLine(".executables: .libraries");\r
+ makefile.writeLine(".libraries:");\r
+ \r
+ makefile.writeLine("\n# Clean Rule"); \r
+ makefile.writeLine("clean:: clean_package"); \r
+ makefile.writeLine("# Clean Top Level Object Directory "); \r
+ makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/"); \r
+ makefile.writeLine("\t$(RMDIR) package/cfg"); \r
+ }\r
+ else\r
+ {\r
+ try{\r
+ makefile = fileModule.open("makefile", "a");\r
+ } catch (ex)\r
+ {\r
+ print("makefile cannot be written to. Please check Writing Permissions.");\r
+ java.lang.System.exit(1);\r
+ } \r
+ \r
+ }\r
+\r
+ return makefile;\r
+}\r
+\r
+function createLibMake(makelibname,targetname, objectPath)\r
+{\r
+ var tooldir;\r
+ var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");\r
+ if(stringname.match("ARM11"))\r
+ {\r
+ tooldir="TI_ARM11_GEN_INSTALL_PATH"; \r
+ }\r
+ else\r
+ {\r
+ tooldir="C6X_GEN_INSTALL_PATH";\r
+ }\r
+ switch(stringname)\r
+ {\r
+ case String(C66LE):\r
+ targetname=C66LE;\r
+ break;\r
+ case String(C66BE):\r
+ targetname=C66BE;\r
+ break;\r
+\r
+ }\r
+ var fileModule = xdc.module('xdc.services.io.File');\r
+ try{\r
+ var dstFile = new java.io.File(makelibname);\r
+ dstFile.getParentFile().mkdirs(); \r
+ libmakefile = fileModule.open(makelibname, "w");\r
+ /* Add to Archive list */\r
+ } catch (ex)\r
+ {\r
+ print(makelibname+" cannot be written to. Please check Writing Permissions.");\r
+ java.lang.System.exit(1);\r
+ } \r
+ libmakefile.writeLine("#*******************************************************************************");\r
+ libmakefile.writeLine("#* FILE PURPOSE: Lower level makefile for Creating Component Libraries");\r
+ libmakefile.writeLine("#*******************************************************************************");\r
+ libmakefile.writeLine("#* FILE NAME: "+makelibname);\r
+ libmakefile.writeLine("#*");\r
+ libmakefile.writeLine("#* DESCRIPTION: Defines Source Files, Compilers flags and build rules");\r
+ libmakefile.writeLine("#*");\r
+ libmakefile.writeLine("#*");\r
+ libmakefile.writeLine("#*******************************************************************************");\r
+ libmakefile.writeLine("#");\r
+ libmakefile.writeLine("");\r
+ libmakefile.writeLine("#");\r
+ libmakefile.writeLine("# Macro definitions referenced below");\r
+ libmakefile.writeLine("#");\r
+ libmakefile.writeLine("empty =");\r
+ libmakefile.writeLine("space =$(empty) $(empty)");\r
+ \r
+ if(stringname.match("ti.targets"))\r
+ {\r
+\r
+ var rtslibtemp = targetname.lnkOpts.suffix.toString().split("/");\r
+ var rtslib;\r
+ for(n=0;n<rtslibtemp.length;n++)\r
+ {\r
+ if(rtslibtemp[n].match(".lib"))\r
+ { \r
+ rtslib=rtslibtemp[n];\r
+ }\r
+ }\r
+\r
+ libmakefile.writeLine("CC = $("+tooldir+")/bin/"+targetname.cc.cmd +" "+targetname.ccOpts.prefix+" "+targetname.cc.opts);\r
+ libmakefile.writeLine("AC = $("+tooldir+")/bin/"+targetname.asm.cmd +" "+targetname.asmOpts.prefix+" "+targetname.asm.opts); \r
+ libmakefile.writeLine("ARIN = $("+tooldir+")/bin/"+targetname.ar.cmd +" "+targetname.ar.opts); \r
+ libmakefile.writeLine("LD = $("+tooldir+")/bin/"+targetname.lnk.cmd +" "+targetname.lnk.opts); \r
+ libmakefile.writeLine("RTSLIB = -l $("+tooldir+")/lib/"+rtslib); \r
+ }\r
+ else\r
+ {\r
+ print("Error: Non-TI targets are not currently supported ");\r
+ java.lang.System.exit(1);\r
+\r
+ }\r
+ \r
+ libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR))))");\r
+ libmakefile.writeLine("OBJEXT = o"+targetname.suffix); \r
+ libmakefile.writeLine("AOBJEXT = s"+targetname.suffix); \r
+ /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/\r
+ libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");\r
+ libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");\r
+ libmakefile.writeLine("OBJDIR = $(LIBDIR)/obj"); \r
+ \r
+ return libmakefile;\r
+\r
+}\r
+\r
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName)\r
+{\r
+ var sourcestring = (srcString + fileExt).toString().toUpperCase();\r
+ var compileflagstring = sourcestring + "FLAGS";\r
+ var objectliststring = sourcestring + "OBJS";\r
+ /* List all the source files */\r
+ makefilename.writeLine("\n#List the "+srcString+" Files"); \r
+ makefilename.writeLine(sourcestring + "= \\");\r
+ for(var i=0;i<srcfiles.length-1;i++)\r
+ {\r
+ makefilename.writeLine(" "+srcfiles[i]+"\\");\r
+ }\r
+ makefilename.writeLine(" "+srcfiles[i]+"\n");\r
+ \r
+ /* Flags for the source files */\r
+ makefilename.writeLine("# FLAGS for the "+srcString+" Files"); \r
+ var compileflags="";\r
+ if(fileExt == "asm" && flags.aopts != undefined)\r
+ {\r
+ compileflags+=" "+flags.aopts;\r
+ }\r
+ else if((fileExt == "c" || fileExt == "sa")&& flags.copts != undefined)\r
+ {\r
+ compileflags+=" "+flags.copts;\r
+ } \r
+\r
+ if(flags.incs != undefined)\r
+ {\r
+ compileflags+=" "+flags.incs;\r
+ }\r
+\r
+\r
+ makefilename.writeLine(compileflagstring+" = "+compileflags +" \n"); \r
+ makefilename.writeLine("# Make Rule for the "+srcString+" Files"); \r
+ \r
+ makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", $(OBJDIR)/%.$(OBJEXT), $(" + sourcestring + "))"); \r
+ makefilename.writeLine("\n$("+objectliststring+"): $(OBJDIR)/%.$(OBJEXT): %."+fileExt); \r
+ if(fileExt == "c")\r
+ { \r
+ makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ..."); \r
+ }\r
+ else\r
+ {\r
+ makefilename.writeLine("\t-@echo asm"+targetName.suffix +" $< ..."); \r
+ }\r
+ makefilename.writeLine("\tif [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; fi;"); \r
+ \r
+ if(fileExt == "c")\r
+ {\r
+ makefilename.writeLine("\t$(RM) $@.dep");\r
+ makefilename.writeLine("\t$(CC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fc $< ");\r
+ makefilename.writeLine("\t-@$(CP) $@.dep $@.pp; \\");\r
+ makefilename.writeLine(" $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\$$//' \\");\r
+ makefilename.writeLine(" -e '/^$$/ d' -e 's/$$/ :/' < $@.pp >> $@.dep; \\");\r
+ makefilename.writeLine(" $(RM) $@.pp ");\r
+ }\r
+ else if(fileExt == "asm")\r
+ {\r
+ makefilename.writeLine("\t$(AC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fa $< ");\r
+ }\r
+ else if(fileExt == "sa")\r
+ {\r
+ makefilename.writeLine("\t$(AC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< ");\r
+ }\r
+ makefilename.writeLine("\n#Create Empty rule for dependency");\r
+ makefilename.writeLine("$("+objectliststring+"):"+makefilename.$private.fd);\r
+ makefilename.writeLine(makefilename.$private.fd+":");\r
+ makefilename.writeLine("\n#Include Depedency for "+srcString+" Files");\r
+ makefilename.writeLine("ifneq (clean,$(MAKECMDGOALS))");\r
+ makefilename.writeLine(" -include $("+objectliststring+":%.$(OBJEXT)=%.$(OBJEXT).dep)");\r
+ makefilename.writeLine("endif");\r
+ \r
+}\r
+\r
+/**************************************************************************\r
+ * FUNCTION NAME : buildLibrary\r
+ **************************************************************************\r
+ * DESCRIPTION :\r
+ * Utility function which will build a specific library\r
+ **************************************************************************/\r
+var makefilelocal;\r
+function buildLibrary (libOptions, libName, target, libFiles) \r
+{\r
+ var lldFullLibraryPath = "./lib/c66/" + libName;\r
+ var lldFullBuildPath = "./build/c66/" + libName;\r
+ var lldFullLibraryPathMake = "$(LIBDIR)/" + "c66/" + libName;\r
+\r
+ /* Create Main make file in the root of package folder */\r
+ makefilelocal = createMake(makefilelocal);\r
+\r
+ /* Write the rule to make library in main makefile */\r
+ lib = lldFullBuildPath+".a"+target.suffix;\r
+ libMake = lldFullLibraryPathMake+".a"+target.suffix;\r
+ var objectPath= "./package/"+lldFullBuildPath;\r
+ makefilelocal.writeLine("\n\n# Make rule to create "+libMake+" library");\r
+ makefilelocal.writeLine(".libraries: "+ libMake);\r
+ makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@"); \r
+\r
+ /* Create Library make file in the lib folder */\r
+ var makefilelib= createLibMake(lib+".mk",target,objectPath); \r
+\r
+ /* Rule to clean library in main makefile */\r
+ makefilelocal.writeLine("# Rule to clean "+libMake+" library"); \r
+ makefilelocal.writeLine("clean ::\n\t$(RM) "+ libMake); \r
+ librule="\n\n"+libMake+" :";\r
+\r
+ /* Add files to be compiled */\r
+ /* Separate out the C and assembly files */\r
+ var cfiles= new Array();\r
+ var afiles= new Array();\r
+ var safiles= new Array();\r
+ for each(var srcFile in libFiles)\r
+ {\r
+ var srcFile=String(srcFile);\r
+ var dot = srcFile.lastIndexOf(".");\r
+ var extension = srcFile.substr(dot,srcFile.length); \r
+ if(extension == ".c")\r
+ {\r
+ cfiles.push(srcFile);\r
+ }\r
+ else if(extension == ".sa")\r
+ {\r
+ safiles.push(srcFile);\r
+ }\r
+ else if(extension == ".asm")\r
+ {\r
+ afiles.push(srcFile);\r
+ }\r
+ else\r
+ {\r
+ print("ERROR: Unsupported file extension");\r
+ java.lang.System.exit(1);\r
+ }\r
+ }\r
+ if(cfiles.length > 0)\r
+ { \r
+ makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target);\r
+ librule += " $(COMMONSRCCOBJS)"; \r
+ }\r
+ if(afiles.length > 0)\r
+ { \r
+ makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target);\r
+ librule += " $(COMMONSRCASMOBJS)"; \r
+ }\r
+ if(safiles.length > 0)\r
+ { \r
+ makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target);\r
+ librule += " $(COMMONSRCSAOBJS)"; \r
+ }\r
+\r
+ makefilelib.writeLine(librule);\r
+ makefilelib.writeLine("\t@echo archiving $? into $@ ..."); \r
+ makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/c66 ]; then $(MKDIR) $(LIBDIR)/c66 ; fi;"); \r
+ makefilelib.writeLine("\t$(ARIN) $@ $?");\r
+ makefilelib.close(); \r
+ \r
+ /* Create the Epilogue; which executes after all the builds are completed. \r
+ * This is used to generate the benchmark information for the built library. \r
+ * Also add the benchmarking information file to the package. */\r
+ Pkg.makeEpilogue += ".libraries: benchmarking_" + target.suffix + "\n";\r
+ Pkg.makeEpilogue += "benchmarking_" + target.suffix + ":";\r
+ Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml";\r
+ Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt";\r
+ Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;\r
+\r
+ /* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
+ Pkg.makeEpilogue += "clean::\n";\r
+ Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; \r
+ // Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + ".mk\n";\r
+ Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + "c66/ \n\n";\r
+\r
+ return lib;\r
+}\r
+\r
+/**************************************************************************\r
+ * FUNCTION NAME : createMiniPkg\r
+ **************************************************************************\r
+ * DESCRIPTION :\r
+ * The function is responsible for creating the mini tar package\r
+ * The MINI package has the following files:- \r
+ * - Driver Source Files. \r
+ * - Header files (exported and internal driver files) \r
+ * - Simple Makefiles. \r
+ **************************************************************************/\r
+function createMiniPkg(pkgName)\r
+{\r
+ /* Get the package Name. */\r
+ var packageRepository = xdc.getPackageRepository(Pkg.name);\r
+ var packageBase = xdc.getPackageBase(Pkg.name);\r
+ var packageName = packageBase.substring(packageRepository.length + 1);\r
+\r
+ /* Convert the Package name by replacing back slashes with forward slashes. This is required because\r
+ * otherwise with long names the tar is unable to change directory. */\r
+ var newPkgName = new java.lang.String(packageRepository);\r
+ var newPkgRep = newPkgName.replace('\\', '/');\r
+\r
+ /* Step1: Create the MINI Package and add the simple Big and Little Endian Makefiles to the package */\r
+ Pkg.makeEpilogue += "release: mini_pkg\n";\r
+ Pkg.makeEpilogue += "mini_pkg:\n";\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -cf packages/" + pkgName + "_mini.tar " + \r
+ packageName + "simpleC66LE.mak " + packageName + "simpleC66BE.mak\n";\r
+\r
+ /* Step2: Add the exported header files to the package */\r
+ var includeFiles = libUtility.listAllFiles (".h", ".", false);\r
+ for (var k = 0 ; k < includeFiles.length; k++)\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -rf packages/" + pkgName + "_mini.tar " + \r
+ packageName + includeFiles[k] + "\n";\r
+\r
+ /* Step3: Add the internal header files to the package */\r
+ includeFiles = libUtility.listAllFiles (".h", "include", true);\r
+ for (var k = 0 ; k < includeFiles.length; k++)\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -rf packages/" + pkgName + "_mini.tar " + \r
+ packageName + includeFiles[k] + "\n";\r
+\r
+ /* Step4: Add the PDSP firmware files to the package */\r
+ includeFiles = libUtility.listAllFiles (".h", "firmware", true);\r
+ for (var k = 0 ; k < includeFiles.length; k++)\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -rf packages/" + pkgName + "_mini.tar " + \r
+ packageName + includeFiles[k] + "\n";\r
+\r
+ /* Step5: Add the device specific files to the package */\r
+ includeFiles = libUtility.listAllFiles (".c", "device", true);\r
+ for (var k = 0 ; k < includeFiles.length; k++)\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -rf packages/" + pkgName + "_mini.tar " + \r
+ packageName + includeFiles[k] + "\n";\r
+\r
+ /* Step4: Add the driver source files to the package; the filter should have generated a source listing */\r
+ Pkg.makeEpilogue += "\t tar -C " + "\"" + newPkgRep + "\"" + " -T src.lst -rf packages/" + pkgName + "_mini.tar " + "\n";\r
+\r
+ /* Ensure that we clean up the mini package */\r
+ Pkg.makeEpilogue += "clean::\n";\r
+ Pkg.makeEpilogue += "\t $(RM) packages/" + pkgName + "_mini.tar\n";\r
+}\r
diff --git a/config.bld b/config.bld
--- /dev/null
+++ b/config.bld
@@ -0,0 +1,105 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Build configuration Script for the TCP3D Driver\r
+ ******************************************************************************\r
+ * FILE NAME: config.bld\r
+ *\r
+ * DESCRIPTION: \r
+ * This file contains the build configuration script for the TCP3D driver\r
+ * and is responsible for configuration of the paths for the various \r
+ * tools required to build the driver.\r
+ *\r
+ * Copyright (C) 2011, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/* Set package attribute as ZIP or TAR */\r
+Pkg.attrs.archiver = "tar";\r
+\r
+/* Get the Tools Base directory from the Environment Variable. */\r
+var toolsBaseDir = java.lang.System.getenv("XDCCGROOT");\r
+\r
+/* Get the base directory for the TCP3D Driver Package */\r
+var tcp3dDriverPath = new java.io.File(".//").getPath();\r
+\r
+var tcp3dDriverInstallType;\r
+\r
+/* Read the part number from the environment variable. */\r
+var tcp3dPartNumber = java.lang.System.getenv("PARTNO");\r
+\r
+if(tcp3dPartNumber == null)\r
+{\r
+ tcp3dPartNumber = "keystone2";\r
+}\r
+\r
+/* Include Path */\r
+var tcp3dIncludePath = " -i" + tcp3dDriverPath + "/src" + " -i" + tcp3dDriverPath + " -i" + tcp3dDriverPath + "/test";\r
+\r
+/* Configure the TCP3D Release Version Information */\r
+/* We use the information from compatibility key. It require 3 steps: */ \r
+/* remove SPACE and TAB, convert to string and split to make array */\r
+var tcp3dDriverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');\r
+\r
+/* TCP3D Driver Coverity Analysis: Check the environment variable to determine if Static\r
+ * Analysis has to be done on the TCP3D Driver Code base or not? */\r
+var tcp3dDriverCoverityAnalysis = java.lang.System.getenv("LLDCOV");\r
+\r
+/* C66 ELF compiler configuration for Little Endian Mode. */\r
+var C66LE = xdc.useModule('ti.targets.elf.C66');\r
+C66LE.rootDir = toolsBaseDir;\r
+C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";\r
+\r
+/* C66 ELF compiler configuration for Big Endian Mode. */\r
+var C66BE = xdc.useModule('ti.targets.elf.C66_big_endian');\r
+C66BE.rootDir = toolsBaseDir;\r
+C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";\r
+\r
+/* Check if we need to run the STATIC Analysis or not? */\r
+var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");\r
+\r
+/* Setup the Coverity Filters to perform Static Analysis. */\r
+if (coverityAnalysis == "ON") {\r
+ var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH");\r
+ var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg";\r
+\r
+ var coverityFilter = [\r
+ {\r
+ moduleName: "tisb.coverity.filters.Coverity",\r
+ params: {\r
+ cfgDir: cfgBase, // The Coverity configuration file directory\r
+ rootDir: coverityInstallPath,\r
+ outDir: xdc.csd() + "cov_out",\r
+ analyzeLibs: true\r
+ }\r
+ },\r
+ ];\r
+\r
+ /* Run the coverity filters on the LE Build only. */\r
+ C66LE.profiles["release"].filters = coverityFilter;\r
+}\r
+\r
+/* Check if we need to create the Makefiles? */\r
+var miniBuild = java.lang.System.getenv("MINI_PACKAGE");\r
+\r
+if (miniBuild == "ON")\r
+{\r
+ /* Add the filter for simple Makefile generation. */\r
+ var makeC66LEFilter = {\r
+ moduleName: "build.filter.Make",\r
+ params: {\r
+ makefileName: "simpleC66LE.mak",\r
+ }\r
+ };\r
+ C66LE.profiles["release"].filters[C66LE.profiles["release"].filters.length++] = makeC66LEFilter;\r
+\r
+ var makeC66BEFilter = {\r
+ moduleName: "build.filter.Make",\r
+ params: {\r
+ makefileName: "simpleC66BE.mak",\r
+ }\r
+ };\r
+ C66BE.profiles["release"].filters[C66BE.profiles["release"].filters.length++] = makeC66BEFilter;\r
+}\r
+\r
+/* List all the build targets here. */\r
+Build.targets = [ C66LE, C66BE ];\r
+\r
+var devices = ["tci6634/c66"/*,"tci6636/c66","tci6638/c66"*/];\r
diff --git a/docs/Module.xs b/docs/Module.xs
--- /dev/null
+++ b/docs/Module.xs
@@ -0,0 +1,55 @@
+/******************************************************************************\r
+ * FILE PURPOSE: TCP3D Driver DOCS Module specification file.\r
+ ******************************************************************************\r
+ * FILE NAME: module.xs\r
+ *\r
+ * DESCRIPTION: \r
+ * This file contains the module specification for the TCP3D Driver Documentation .\r
+ *\r
+ * Copyright (C) 2008, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/* Load the library utility. */\r
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");\r
+\r
+/**************************************************************************\r
+ * FUNCTION NAME : modBuild\r
+ **************************************************************************\r
+ * DESCRIPTION :\r
+ * The function is used to build the TCP3D driver documentation and add it\r
+ * to the package.\r
+ **************************************************************************/\r
+function modBuild() \r
+{\r
+ /* Create the actual PROLOGUE Section for the Documentation.*/\r
+ Pkg.makePrologue += "release: tcp3d_document_generation\n";\r
+ Pkg.makePrologue += "tcp3d_document_generation:\n";\r
+ Pkg.makePrologue += "\t @echo ----------------------------\n";\r
+ Pkg.makePrologue += "\t @echo Generating TCP3D Driver Documentation\n";\r
+ Pkg.makePrologue += "\t doxygen docs/TCP3D_DRV_doxconfig\n";\r
+ Pkg.makePrologue += "\t @echo TCP3D Driver Documentation Generated \n";\r
+ Pkg.makePrologue += "\t @echo ----------------------------\n";\r
+\r
+ /* Add the documentation file to the package. */\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DRV_APIIF.chm";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DriverSDS.pdf";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tifooter.htm";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tiheader.htm";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tilogo.gif";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/titagline.gif";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxy/html";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_LLD_SoftwareManifest.pdf";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/ReleaseNotes_TCP3DDriver.pdf";\r
+\r
+ if ( tcp3dDriverInstallType == "SETUP" )\r
+ {\r
+ Pkg.makePrologue += "all: eclipse_plugin_generation\n";\r
+ Pkg.makePrologue += "eclipse_plugin_generation:\n";\r
+ Pkg.makePrologue += "\t @echo ----------------------------\n";\r
+ Pkg.makePrologue += "\t @echo TCP3D Eclipse Plugin Generation\n";\r
+ Pkg.makePrologue += "\t xs xdc.tools.eclipsePluginGen -o . -x ./docs/eclipse/sample.xml -c ./docs/eclipse/toc_cdoc_sample.xml\n";\r
+ Pkg.makePrologue += "\t @echo TCP3D Eclipse Plugin Generated \n";\r
+ Pkg.makePrologue += "\t @echo ----------------------------\n";\r
+ }\r
+}\r
+\r
diff --git a/docs/ReleaseNotes_TCP3DDriver.doc b/docs/ReleaseNotes_TCP3DDriver.doc
new file mode 100644 (file)
index 0000000..2e573ab
Binary files /dev/null and b/docs/ReleaseNotes_TCP3DDriver.doc differ
index 0000000..2e573ab
Binary files /dev/null and b/docs/ReleaseNotes_TCP3DDriver.doc differ
diff --git a/docs/ReleaseNotes_TCP3DDriver.pdf b/docs/ReleaseNotes_TCP3DDriver.pdf
new file mode 100644 (file)
index 0000000..5742f7b
Binary files /dev/null and b/docs/ReleaseNotes_TCP3DDriver.pdf differ
index 0000000..5742f7b
Binary files /dev/null and b/docs/ReleaseNotes_TCP3DDriver.pdf differ
diff --git a/docs/TCP3D_DRV_doxconfig.xdt b/docs/TCP3D_DRV_doxconfig.xdt
--- /dev/null
@@ -0,0 +1,255 @@
+%%{\r
+/*!\r
+ * This template implements the Doxyfile\r
+ */ \r
+ /* Versioning */\r
+ var ver = this;\r
+ var packageVersion = ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3];\r
+\r
+%%}\r
+\r
+# Doxyfile 1.5.1-p1\r
+\r
+#---------------------------------------------------------------------------\r
+# Project related configuration options\r
+#---------------------------------------------------------------------------\r
+PROJECT_NAME = "TCP3D Driver"\r
+PROJECT_NUMBER = `packageVersion`\r
+OUTPUT_DIRECTORY = ./docs/doxy\r
+CREATE_SUBDIRS = NO\r
+OUTPUT_LANGUAGE = English\r
+USE_WINDOWS_ENCODING = YES\r
+BRIEF_MEMBER_DESC = YES\r
+REPEAT_BRIEF = YES\r
+ABBREVIATE_BRIEF = "The $name class" \\r
+ "The $name widget" \\r
+ "The $name file" \\r
+ is \\r
+ provides \\r
+ specifies \\r
+ contains \\r
+ represents \\r
+ a \\r
+ an \\r
+ the\r
+ALWAYS_DETAILED_SEC = NO\r
+INLINE_INHERITED_MEMB = NO\r
+FULL_PATH_NAMES = NO\r
+STRIP_FROM_PATH =\r
+STRIP_FROM_INC_PATH =\r
+SHORT_NAMES = NO\r
+JAVADOC_AUTOBRIEF = NO\r
+MULTILINE_CPP_IS_BRIEF = NO\r
+DETAILS_AT_TOP = NO\r
+INHERIT_DOCS = YES\r
+SEPARATE_MEMBER_PAGES = NO\r
+TAB_SIZE = 8\r
+ALIASES =\r
+OPTIMIZE_OUTPUT_FOR_C = YES\r
+OPTIMIZE_OUTPUT_JAVA = NO\r
+BUILTIN_STL_SUPPORT = NO\r
+DISTRIBUTE_GROUP_DOC = NO\r
+SUBGROUPING = YES\r
+#---------------------------------------------------------------------------\r
+# Build related configuration options\r
+#---------------------------------------------------------------------------\r
+EXTRACT_ALL = NO\r
+EXTRACT_PRIVATE = NO\r
+EXTRACT_STATIC = NO\r
+EXTRACT_LOCAL_CLASSES = YES\r
+EXTRACT_LOCAL_METHODS = NO\r
+HIDE_UNDOC_MEMBERS = YES\r
+HIDE_UNDOC_CLASSES = YES\r
+HIDE_FRIEND_COMPOUNDS = NO\r
+HIDE_IN_BODY_DOCS = NO\r
+INTERNAL_DOCS = NO\r
+CASE_SENSE_NAMES = NO\r
+HIDE_SCOPE_NAMES = NO\r
+SHOW_INCLUDE_FILES = YES\r
+INLINE_INFO = YES\r
+SORT_MEMBER_DOCS = YES\r
+SORT_BRIEF_DOCS = NO\r
+SORT_BY_SCOPE_NAME = NO\r
+GENERATE_TODOLIST = YES\r
+GENERATE_TESTLIST = YES\r
+GENERATE_BUGLIST = YES\r
+GENERATE_DEPRECATEDLIST= YES\r
+ENABLED_SECTIONS =\r
+MAX_INITIALIZER_LINES = 30\r
+SHOW_USED_FILES = YES\r
+SHOW_DIRECTORIES = NO\r
+FILE_VERSION_FILTER = \r
+#---------------------------------------------------------------------------\r
+# configuration options related to warning and progress messages\r
+#---------------------------------------------------------------------------\r
+QUIET = NO\r
+WARNINGS = YES\r
+WARN_IF_UNDOCUMENTED = YES\r
+WARN_IF_DOC_ERROR = YES\r
+WARN_NO_PARAMDOC = NO\r
+WARN_FORMAT = "$file:$line: $text"\r
+WARN_LOGFILE =\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the input files\r
+#---------------------------------------------------------------------------\r
+INPUT = ./src \\r
+ . \r
+# ./docs/doxy/template\r
+\r
+FILE_PATTERNS = *.h\r
+RECURSIVE = NO\r
+EXCLUDE = YES \\r
+ ./example \\r
+ ./test \\r
+ ./package \\r
+ ./packages\r
+EXCLUDE_SYMLINKS = NO\r
+EXCLUDE_PATTERNS = cslr_*.h \\r
+ *profile*.* \\r
+ *_priv.h \\r
+ *_types.h\r
+EXAMPLE_PATH =\r
+EXAMPLE_PATTERNS = *\r
+EXAMPLE_RECURSIVE = NO\r
+IMAGE_PATH =\r
+INPUT_FILTER =\r
+FILTER_PATTERNS =\r
+FILTER_SOURCE_FILES = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to source browsing\r
+#---------------------------------------------------------------------------\r
+SOURCE_BROWSER = NO\r
+INLINE_SOURCES = NO\r
+STRIP_CODE_COMMENTS = YES\r
+REFERENCED_BY_RELATION = NO\r
+REFERENCES_RELATION = NO\r
+REFERENCES_LINK_SOURCE = YES\r
+USE_HTAGS = NO\r
+VERBATIM_HEADERS = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the alphabetical class index\r
+#---------------------------------------------------------------------------\r
+ALPHABETICAL_INDEX = NO\r
+COLS_IN_ALPHA_INDEX = 5\r
+IGNORE_PREFIX =\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the HTML output\r
+#---------------------------------------------------------------------------\r
+GENERATE_HTML = YES\r
+HTML_OUTPUT = html\r
+HTML_FILE_EXTENSION = .html\r
+HTML_HEADER = ./docs/tiheader.htm\r
+HTML_FOOTER = ./docs/tifooter.htm\r
+HTML_STYLESHEET =\r
+HTML_ALIGN_MEMBERS = YES\r
+GENERATE_HTMLHELP = YES\r
+CHM_FILE = ..\..\TCP3D_DRV_APIIF.chm\r
+HHC_LOCATION = hhc.exe\r
+GENERATE_CHI = NO\r
+BINARY_TOC = NO\r
+TOC_EXPAND = NO\r
+DISABLE_INDEX = NO\r
+ENUM_VALUES_PER_LINE = 4\r
+GENERATE_TREEVIEW = NO\r
+TREEVIEW_WIDTH = 250\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the LaTeX output\r
+#---------------------------------------------------------------------------\r
+GENERATE_LATEX = NO\r
+LATEX_OUTPUT = latex\r
+LATEX_CMD_NAME = latex\r
+MAKEINDEX_CMD_NAME = makeindex\r
+COMPACT_LATEX = NO\r
+PAPER_TYPE = a4wide\r
+EXTRA_PACKAGES =\r
+LATEX_HEADER =\r
+PDF_HYPERLINKS = YES\r
+USE_PDFLATEX = YES\r
+LATEX_BATCHMODE = NO\r
+LATEX_HIDE_INDICES = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the RTF output\r
+#---------------------------------------------------------------------------\r
+GENERATE_RTF = NO\r
+RTF_OUTPUT = rtf\r
+COMPACT_RTF = NO\r
+RTF_HYPERLINKS = NO\r
+RTF_STYLESHEET_FILE =\r
+RTF_EXTENSIONS_FILE =\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the man page output\r
+#---------------------------------------------------------------------------\r
+GENERATE_MAN = NO\r
+MAN_OUTPUT = man\r
+MAN_EXTENSION = .3\r
+MAN_LINKS = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the XML output\r
+#---------------------------------------------------------------------------\r
+GENERATE_XML = NO\r
+XML_OUTPUT = xml\r
+XML_SCHEMA =\r
+XML_DTD =\r
+XML_PROGRAMLISTING = YES\r
+#---------------------------------------------------------------------------\r
+# configuration options for the AutoGen Definitions output\r
+#---------------------------------------------------------------------------\r
+GENERATE_AUTOGEN_DEF = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the Perl module output\r
+#---------------------------------------------------------------------------\r
+GENERATE_PERLMOD = NO\r
+PERLMOD_LATEX = NO\r
+PERLMOD_PRETTY = YES\r
+PERLMOD_MAKEVAR_PREFIX =\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the preprocessor\r
+#---------------------------------------------------------------------------\r
+ENABLE_PREPROCESSING = YES\r
+MACRO_EXPANSION = NO\r
+EXPAND_ONLY_PREDEF = NO\r
+SEARCH_INCLUDES = YES\r
+INCLUDE_PATH =\r
+INCLUDE_FILE_PATTERNS =\r
+PREDEFINED =\r
+EXPAND_AS_DEFINED =\r
+SKIP_FUNCTION_MACROS = YES\r
+#---------------------------------------------------------------------------\r
+# Configuration::additions related to external references\r
+#---------------------------------------------------------------------------\r
+TAGFILES =\r
+GENERATE_TAGFILE =\r
+ALLEXTERNALS = NO\r
+EXTERNAL_GROUPS = YES\r
+PERL_PATH = /usr/bin/perl\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the dot tool\r
+#---------------------------------------------------------------------------\r
+CLASS_DIAGRAMS = NO\r
+HIDE_UNDOC_RELATIONS = YES\r
+HAVE_DOT = NO\r
+CLASS_GRAPH = YES\r
+COLLABORATION_GRAPH = YES\r
+GROUP_GRAPHS = YES\r
+UML_LOOK = NO\r
+TEMPLATE_RELATIONS = NO\r
+INCLUDE_GRAPH = YES\r
+INCLUDED_BY_GRAPH = YES\r
+CALL_GRAPH = NO\r
+CALLER_GRAPH = NO\r
+GRAPHICAL_HIERARCHY = YES\r
+DIRECTORY_GRAPH = YES\r
+DOT_IMAGE_FORMAT = png\r
+DOT_PATH = \r
+DOTFILE_DIRS = \r
+MAX_DOT_GRAPH_WIDTH = 1024\r
+MAX_DOT_GRAPH_HEIGHT = 1024\r
+MAX_DOT_GRAPH_DEPTH = 1000\r
+DOT_TRANSPARENT = YES\r
+DOT_MULTI_TARGETS = NO\r
+GENERATE_LEGEND = YES\r
+DOT_CLEANUP = YES\r
+#---------------------------------------------------------------------------\r
+# Configuration::additions related to the search engine\r
+#---------------------------------------------------------------------------\r
+SEARCHENGINE = NO\r
diff --git a/docs/TCP3D_DriverSDS.pdf b/docs/TCP3D_DriverSDS.pdf
new file mode 100644 (file)
index 0000000..8acb005
Binary files /dev/null and b/docs/TCP3D_DriverSDS.pdf differ
index 0000000..8acb005
Binary files /dev/null and b/docs/TCP3D_DriverSDS.pdf differ
diff --git a/docs/TCP3D_LLD_SoftwareManifest.pdf b/docs/TCP3D_LLD_SoftwareManifest.pdf
new file mode 100644 (file)
index 0000000..14d8187
Binary files /dev/null and b/docs/TCP3D_LLD_SoftwareManifest.pdf differ
index 0000000..14d8187
Binary files /dev/null and b/docs/TCP3D_LLD_SoftwareManifest.pdf differ
diff --git a/docs/doxy/rundoxy.bat b/docs/doxy/rundoxy.bat
--- /dev/null
+++ b/docs/doxy/rundoxy.bat
@@ -0,0 +1 @@
+T:\Doxygen\doxygen\1.5.1-p1\bin\doxygen docs\TCP3D_DRV_doxconfig\r
diff --git a/docs/doxy/template/asapimain.h b/docs/doxy/template/asapimain.h
--- /dev/null
@@ -0,0 +1,63 @@
+/*\r
+ *\r
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ \r
+ * \r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
+\r
+\r
+\r
+/*\r
+ * This is a little header file which doxygen parses to generate the main\r
+ * documentation page\r
+ */\r
+\r
+/**\r
+ * @file asapimain.h\r
+ *\r
+ * @brief Header file to generate the TCP3D Driver Functions Document Main Page\r
+ */\r
+\r
+/**\r
+ * @mainpage TCP3D Driver Functions\r
+ *\r
+ * @section Data Structures\r
+ *\r
+ * List of all the TCP3D Driver Data Structures with brief descriptions.\r
+ *\r
+ * @section Files\r
+ *\r
+ * List of all the TCP3D Driver interface files with brief descriptions.\r
+ *\r
+ * @section Related Pages\r
+ *\r
+ * List of all related documentation pages (Disclaimer, etc.).\r
+ */\r
diff --git a/docs/doxy/template/doxygen.h b/docs/doxy/template/doxygen.h
--- /dev/null
@@ -0,0 +1,96 @@
+/*\r
+ * This is a little header file which Doxygen parses to generate the disclaimer page\r
+ */\r
+\r
+/**\r
+ * @file doxygen.h\r
+ *\r
+ * @brief Header file to generate the TI Disclaimer Page\r
+ */\r
+\r
+/**\r
+ * @page Disclaimer\r
+ *<center> <B>IMPORTANT NOTICE </B> </center>\r
+ * Texas Instruments Incorporated and its subsidiaries (TI) reserve the right\r
+ * to make corrections, modifications, enhancements, improvements, and other\r
+ * changes to its products and services at any time and to discontinue any\r
+ * product or service without notice. Customers should obtain the latest\r
+ * relevant information before placing orders and should verify that such\r
+ * information is current and complete. All products are sold subject to TI\92s\r
+ * terms and conditions of sale supplied at the time of order acknowledgment.\r
+ *\r
+ * TI warrants performance of its hardware products to the specifications\r
+ * applicable at the time of sale in accordance with TI\92s standard warranty.\r
+ * Testing and other quality control techniques are used to the extent TI\r
+ * deems necessary to support this warranty. Except where mandated by\r
+ * government requirements, testing of all parameters of each product is not\r
+ * necessarily performed.\r
+ *\r
+ * TI assumes no liability for applications assistance or customer product\r
+ * design. Customers are responsible for their products and applications\r
+ * using TI components. To minimize the risks associated with customer\r
+ * products and applications, customers should provide adequate design and\r
+ * operating safeguards.\r
+ *\r
+ * TI does not warrant or represent that any license, either express or\r
+ * implied, is granted under any TI patent right, copyright, mask work right,\r
+ * or other TI intellectual property right relating to any combination,\r
+ * machine, or process in which TI products or services are used. Information\r
+ * published by TI regarding third-party products or services does not\r
+ * constitute a license from TI to use such products or services or a warranty\r
+ * or endorsement thereof. Use of such information may require a license from a\r
+ * third party under the patents or other intellectual property of the third\r
+ * party, or a license from TI under the patents or other intellectual property\r
+ * of TI.\r
+ *\r
+ * Reproduction of information in TI data books or data sheets is permissible\r
+ * only if reproduction is without alteration and is accompanied by all\r
+ * associated warranties, conditions, limitations, and notices. Reproduction\r
+ * of this information with alteration is an unfair and deceptive business\r
+ * practice. TI is not responsible or liable for such altered documentation.\r
+ *\r
+ * Resale of TI products or services with statements different from or beyond\r
+ * the parameters stated by TI for that product or service voids all express\r
+ * and any implied warranties for the associated TI product or service and is\r
+ * an unfair and deceptive business practice. TI is not responsible or liable\r
+ * for any such statements.\r
+ *\r
+ *\r
+ *\r
+ *\r
+ * Mailing Address: Texas Instruments\r
+ * Post Office Box 655303 Dallas, Texas 75265\r
+ *\r
+ *\r
+ *\r
+ * Copyright © 2008 Texas Instruments Incorporated. All rights reserved.\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
diff --git a/docs/doxy/tifooter.htm b/docs/doxy/tifooter.htm
--- /dev/null
+++ b/docs/doxy/tifooter.htm
@@ -0,0 +1,4 @@
+<hr size="1"><small>\r
+Copyright $year, Texas Instruments Incorporated</small>\r
+</body>\r
+</html>\r
diff --git a/docs/doxy/tiheader.htm b/docs/doxy/tiheader.htm
--- /dev/null
+++ b/docs/doxy/tiheader.htm
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">\r
+<title>$title</title>\r
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">\r
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">\r
+</head><body>\r
+<table width=100%>\r
+<tr>\r
+ <td bgcolor="black" width="1"><a href="http://www.ti.com"><img border=0 src="tilogo.gif"></a></td>\r
+ <td bgcolor="red"><img src="titagline.gif"></td>\r
+</tr>\r
+</table>\r
diff --git a/docs/doxy/tilogo.gif b/docs/doxy/tilogo.gif
new file mode 100644 (file)
index 0000000..f2fab2d
Binary files /dev/null and b/docs/doxy/tilogo.gif differ
index 0000000..f2fab2d
Binary files /dev/null and b/docs/doxy/tilogo.gif differ
diff --git a/docs/doxy/titagline.gif b/docs/doxy/titagline.gif
new file mode 100644 (file)
index 0000000..743a024
Binary files /dev/null and b/docs/doxy/titagline.gif differ
index 0000000..743a024
Binary files /dev/null and b/docs/doxy/titagline.gif differ
diff --git a/docs/eclipse/sample.xml.xdt b/docs/eclipse/sample.xml.xdt
--- /dev/null
@@ -0,0 +1,26 @@
+%%{
+/*!
+ * This template implements the Doxyfile
+ */
+ /* Versioning */
+ var ver = this;
+ var packageVersion = ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3];
+
+%%}
+
+<?xml version="1.0" encoding="UTF-8" ?>
+<product>
+ <name>TCP3 Decoder Driver</name>
+ <id>ti.drv.tcp3d</id>
+ <version>`packageVersion`</version>
+ <companyName>Texas Instruments Inc.</companyName>
+ <companyUrl>http://ti.com</companyUrl>
+ <copyRightNotice>Copyright Texas Instruments 2012</copyRightNotice>
+ <licenseNotice>
+ Released under the Eclipse Public License 1.0 (http://www.eclipse.org/legal/epl-v10.html)
+ </licenseNotice>
+ <installLocation>../../..</installLocation>
+ <repository>../../../packages</repository>
+ <docsLoc>../../../packages/ti/drv/tcp3d/docs</docsLoc>
+ <folderPrefix>TCP3 Decoder Driver</folderPrefix>
+</product>
diff --git a/docs/eclipse/toc_cdoc_sample.xml b/docs/eclipse/toc_cdoc_sample.xml
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="toc.xsl"?>
+<toc label="TCP3 Decoder Driver" topic="packages.html">
+<topic class="toc-id" label="Functions" href="doxy/html/group___t_c_p3_d___d_r_v___f_u_n_c_t_i_o_n.html" title="TCP3 Decoder driver functions">
+</topic>
+<topic class="toc-id" label="Utility Functions" href="doxy/html/group___t_c_p3_d___d_r_v___u_t_i_l___f_u_n_c_t_i_o_n.html" title="TCP3 Decoder driver utility functions">
+</topic>
+<topic class="toc-id" label="Symbols" href="doxy/html/group___t_c_p3_d___d_r_v___s_y_m_b_o_l.html" title="TCP3 Decoder driver defines">
+</topic>
+<topic class="toc-id" label="Data Structures" href="doxy/html/group___t_c_p3_d___d_r_v___d_a_t_a_s_t_r_u_c_t.html" title="TCP3 Decoder driver data structures">
+</topic>
+</toc>
diff --git a/docs/tifooter.htm b/docs/tifooter.htm
--- /dev/null
+++ b/docs/tifooter.htm
@@ -0,0 +1,4 @@
+<hr size="1"><small>\r
+Copyright $year, Texas Instruments Incorporated</small>\r
+</body>\r
+</html>\r
diff --git a/docs/tiheader.htm b/docs/tiheader.htm
--- /dev/null
+++ b/docs/tiheader.htm
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">\r
+<title>$title</title>\r
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">\r
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">\r
+</head><body>\r
+<table width=100%>\r
+<tr>\r
+ <td bgcolor="black" width="1"><a href="http://www.ti.com"><img border=0 src="tilogo.gif"></a></td>\r
+ <td bgcolor="red"><img src="titagline.gif"></td>\r
+</tr>\r
+</table>\r
diff --git a/docs/tilogo.gif b/docs/tilogo.gif
new file mode 100644 (file)
index 0000000..f2fab2d
Binary files /dev/null and b/docs/tilogo.gif differ
index 0000000..f2fab2d
Binary files /dev/null and b/docs/tilogo.gif differ
diff --git a/docs/titagline.gif b/docs/titagline.gif
new file mode 100644 (file)
index 0000000..743a024
Binary files /dev/null and b/docs/titagline.gif differ
index 0000000..743a024
Binary files /dev/null and b/docs/titagline.gif differ
diff --git a/example/Module.xs b/example/Module.xs
--- /dev/null
+++ b/example/Module.xs
@@ -0,0 +1,71 @@
+/******************************************************************************\r
+ * FILE PURPOSE: TCP3D Example files.\r
+ ******************************************************************************\r
+ * FILE NAME: module.xs\r
+ *\r
+ * DESCRIPTION: \r
+ * This file contains the module specification for TCP3D Driver Unit Example\r
+ * Files\r
+ *\r
+ * Copyright (C) 2009, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/* Load the library utility. */\r
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");\r
+\r
+var otherFiles = [\r
+];\r
+\r
+/**************************************************************************\r
+ * FUNCTION NAME : modBuild\r
+ **************************************************************************\r
+ * DESCRIPTION :\r
+ * The function is used to add all the source files in the example \r
+ * directory into the package.\r
+ **************************************************************************/\r
+function modBuild() \r
+{\r
+ /* Add all the .c files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".c", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .h files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".h", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .cfg files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".cfg", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .cmd files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".cmd", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .txt files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".txt", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .txt files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".ini", "example");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .txt files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".dat", "example/testvectors");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all the .txt files to the release package. */\r
+ var exampleFiles = libUtility.listAllFiles (".bin", "example/testvectors");\r
+ for (var k = 0 ; k < exampleFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];\r
+\r
+ /* Add all other files to the release package. */\r
+ for (var k = 0 ; k < otherFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = otherFiles[k];\r
+}\r
diff --git a/example/macros.ini b/example/macros.ini
--- /dev/null
+++ b/example/macros.ini
@@ -0,0 +1 @@
+TCP3D_INSTALL_PATH = ..\..\..\..\..\r
diff --git a/example/simtci6634/c66/bios/link.cmd b/example/simtci6634/c66/bios/link.cmd
--- /dev/null
@@ -0,0 +1,7 @@
+SECTIONS\r
+{\r
+ .init_array: load >> L2SRAM\r
+ .csl_vect > L2SRAM\r
+ .main_mem > L2SRAM\r
+ .profile_mem > L2SRAM\r
+}\r
diff --git a/example/simtci6634/c66/bios/sample_config.cfg b/example/simtci6634/c66/bios/sample_config.cfg
--- /dev/null
@@ -0,0 +1,134 @@
+/*\r
+ * ======== sample_config.cfg ========\r
+ */\r
+\r
+/* IPC packages */\r
+var ListMP = xdc.useModule('ti.sdo.ipc.ListMP');\r
+var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');\r
+var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');\r
+var HeapMemMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP');\r
+var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');\r
+var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');\r
+\r
+/* Configure System to use SysMin */\r
+System = xdc.useModule('xdc.runtime.System');\r
+SysStd = xdc.useModule('xdc.runtime.SysStd');\r
+System.SupportProxy = xdc.useModule('xdc.runtime.SysMin')\r
+System.SupportProxy = SysStd;\r
+System.extendedFormats = "%$S%f";\r
+\r
+/* Set the system stack - 0x2000 */\r
+Program.stack = 0x4000;\r
+\r
+var Memory = xdc.useModule('xdc.runtime.Memory');\r
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');\r
+\r
+/* Use HeapMem for default heap manager and give it 49152 (0xC000)\r
+ * bytes to work with.\r
+ */\r
+Program.sectMap["systemHeap"] = Program.platform.dataMemory;\r
+var heapMemParams = new HeapMem.Params;\r
+heapMemParams.size = 0x18000;\r
+heapMemParams.sectionName = "systemHeap";\r
+Memory.defaultHeapInstance = HeapMem.create(heapMemParams);\r
+\r
+/*\r
+ * Creating Heap Memories for using with test application\r
+ */\r
+/* Create a heap for TCP3D input/output data using ti.bios.HeapMem. */\r
+/* Program.sectMap["tcp3DataSection"] = {loadSegment: "MSMCSRAM"};\r
+var heapMemParams1 = new HeapMem.Params;\r
+heapMemParams1.size = 0x100000;\r
+heapMemParams1.align = 64;\r
+heapMemParams1.sectionName = "tcp3DataSection";\r
+Program.global.tcp3dDataHeap = HeapMem.create(heapMemParams1); */\r
+\r
+/* Create a heap for TCP3D driver using ti.bios.HeapMem. */\r
+Program.sectMap["tcp3DriverSection"] = Program.platform.dataMemory;\r
+var heapMemParams2 = new HeapMem.Params;\r
+heapMemParams2.size = 0x4000;\r
+heapMemParams2.sectionName = "tcp3DriverSection";\r
+Program.global.tcp3dDrvHeap = HeapMem.create(heapMemParams2);\r
+\r
+/* Create a heap for TCP3D QUEUE DESCRIPTORS using ti.bios.HeapMem. */\r
+Program.sectMap["tcp3QueueDescrSection"] = Program.platform.dataMemory;\r
+var heapMemParams3 = new HeapMem.Params;\r
+heapMemParams3.size = 4096;\r
+heapMemParams3.sectionName = "tcp3QueueDescrSection";\r
+Program.global.tcp3dQueHeap = HeapMem.create(heapMemParams3);\r
+\r
+/* To avoid wasting shared memory for Notify and MessageQ transports */\r
+for (var i = 0; i < MultiProc.numProcessors; i++) {\r
+ Ipc.setEntryMeta({\r
+ remoteProcId: i,\r
+ setupNotify: false,\r
+ setupMessageQ: false,\r
+ });\r
+}\r
+\r
+\r
+SharedRegion.setEntryMeta(0,\r
+ { base: 0x0C000000,\r
+ len: 0x100000,\r
+ ownerProcId: 0,\r
+ cacheLineSize: 64,\r
+ isValid: true,\r
+ name: "sharemem",\r
+ });\r
+\r
+/* \r
+ * Pull in Timer, Semaphore, Swi, Task, and Queue modules\r
+ * used in this example.\r
+ */\r
+var BIOS = xdc.useModule('ti.sysbios.BIOS');\r
+xdc.useModule('ti.sysbios.hal.Timer');\r
+xdc.useModule('ti.sysbios.knl.Semaphore');\r
+xdc.useModule('ti.sysbios.knl.Swi');\r
+xdc.useModule('ti.sysbios.knl.Task');\r
+xdc.useModule('ti.sysbios.hal.Cache');\r
+xdc.useModule('ti.sysbios.family.c64p.Hwi');\r
+xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');\r
+xdc.useModule('xdc.runtime.Log');\r
+xdc.useModule('xdc.runtime.Error');\r
+var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');\r
+var ECM = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');\r
+\r
+/*\r
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done\r
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs\r
+ */\r
+ECM.eventGroupHwiNum[0] = 7;\r
+ECM.eventGroupHwiNum[1] = 8;\r
+ECM.eventGroupHwiNum[2] = 9;\r
+ECM.eventGroupHwiNum[3] = 10;\r
+\r
+/*\r
+ * Setup the Logger for Driver\r
+ */\r
+var LoggerSys0Params0 = new LoggerSys.Params;\r
+LoggerSys0Params0.instance.name = 'tcp3dDrvLog';\r
+Program.global.tcp3dDrvLog = LoggerSys.create(LoggerSys0Params0);\r
+\r
+/*\r
+ * allow printf() to be called from Swi threads. Note that use of this gate\r
+ * incurs additional latency for Swi processing since Swi scheduler will be\r
+ * disabled to manage critical sections within the RTS library code.\r
+BIOS.rtsGateType = BIOS.GateSwi;\r
+ */\r
+\r
+\r
+/*\r
+ * Adding the other Dependent packages\r
+ */\r
+/*xdc.loadPackage('ti.wbi.common.api');*/\r
+xdc.loadPackage('ti.sdo.edma3.drv');\r
+\r
+/* Load the TCP3D package */\r
+var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');\r
+\r
+/* Load the CSL package */\r
+var Csl = xdc.useModule('ti.csl.Settings');\r
+\r
+/* Device specific configuration */\r
+var devName = "tci6634";\r
+Csl.deviceType = devName;\r
diff --git a/example/simtci6634/c66/bios/tcp3dSimtci6634C66BiosExampleProject.txt b/example/simtci6634/c66/bios/tcp3dSimtci6634C66BiosExampleProject.txt
--- /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"\r
+-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/simtci6634/c66/bios/tcp3d_osal.c"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/simtci6634/c66/bios/link.cmd"
+-ccs.linkFile "TCP3D_INSTALL_PATH/ti/drv/tcp3d/example/simtci6634/c66/bios/sample_config.cfg"
+-ccs.setCompilerOptions "-mv6600 -g -DUSE_TCP3D_DRIVER_TYPES --diag_warning=225 -I${TCP3D_INSTALL_PATH} -I${TCP3D_INSTALL_PATH}/ti/drv/tcp3d/example/src"\r
+-rtsc.enableRtsc\r
diff --git a/example/simtci6634/c66/bios/tcp3d_osal.c b/example/simtci6634/c66/bios/tcp3d_osal.c
--- /dev/null
@@ -0,0 +1,61 @@
+/**\r
+ * @file sample_osal.c\r
+ *\r
+ * @brief \r
+ * This is the OS abstraction layer and is used by the CPPI and QMSS\r
+ * low level drivers for the CPPI sample example.\r
+ *\r
+ * \par\r
+ * ============================================================================\r
+ * @n (C) Copyright 2009, Texas Instruments, Inc.\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
+/* XDC includes */ \r
+#include <xdc/std.h>\r
+#include <xdc/cfg/global.h>\r
+\r
+/**\r
+ * @b Description\r
+ * @n \r
+ * The function is the TCP3D OSAL Logging API which logs \r
+ * the messages on the console.\r
+ *\r
+ * @param[in] fmt\r
+ * Formatted String.\r
+ *\r
+ * @retval\r
+ * Not Applicable\r
+ */\r
+void Osal_tcp3dLog ( char *fmt, ... )\r
+{\r
+}\r
+\r
+\r
diff --git a/example/src/CpIntc_local.c b/example/src/CpIntc_local.c
--- /dev/null
@@ -0,0 +1,144 @@
+/*\r
+ *\r
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ \r
+ * \r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
+\r
+\r
+\r
+/* \r
+ * Copyright (c) 2009\r
+ * Texas Instruments\r
+ *\r
+ * All rights reserved. Property of Texas Instruments\r
+ * Restricted rights to use, duplicate or disclose this code are\r
+ * granted through contract.\r
+ * \r
+ * */\r
+/*\r
+ * ======== CpIntc.c ========\r
+ */\r
+\r
+#include <xdc/std.h>\r
+#include <xdc/runtime/Error.h>\r
+#include <xdc/runtime/Startup.h>\r
+#include <xdc/runtime/System.h>\r
+\r
+#include "ti/sysbios/family/c66/tci66xx/package/internal/CpIntc.xdc.h"\r
+\r
+/*\r
+ * ======== CpIntc_dispatch ========\r
+ */\r
+//UInt32 cpintcCntr = 0;\r
+//UInt32 cpintcCntr1 = 0;\r
+//UInt32 cpintcCntr2 = 0;\r
+//UInt32 sysIntTrack[200];\r
+Void CpIntc_dispatchLoc(UInt hostInt)\r
+{\r
+ Int32 i;\r
+ UInt32 index;\r
+ UInt32 offset;\r
+ UInt32 srsrVal;\r
+ Int32 sysInt;\r
+ UInt32 id = 0;\r
+ extern volatile cregister UInt32 DNUM;\r
+\r
+// cpintcCntr++;\r
+\r
+ /* for core# 4-7 use INTC1 otherwise use INTC0 */\r
+ if (DNUM > 3) {\r
+ id = 1;\r
+ }\r
+ \r
+// if ( (*((UInt32*)0x0180000C)) == 0x1 )\r
+// System_printf("MISS detected\n");\r
+ \r
+ sysInt = CpIntc_module->hostIntToSysInt[hostInt];\r
+ \r
+// sysIntTrack[cpintcCntr]=((hostInt<<16)|sysInt);\r
+// sysIntTrack[0]=((hostInt<<16)|sysInt);\r
+\r
+ /* \r
+ * If only one system interrupt is mapped to a host interrupt\r
+ * we don't need to read the Sys Status Raw Registers. We\r
+ * know exactly which system interrupt triggered the interrupt.\r
+ */ \r
+ if (sysInt != 0xff && sysInt != 0xfe) {\r
+// cpintcCntr1++;\r
+ /* clear system interrupt associated with host interrupt */\r
+ CpIntc_clearSysInt(id, sysInt);\r
+\r
+ /* call function with arg */\r
+ CpIntc_module->dispatchTab[sysInt].fxn(\r
+ CpIntc_module->dispatchTab[sysInt].arg);\r
+ }\r
+ else {\r
+// cpintcCntr2++;\r
+ /*\r
+ * Loop through System Interrupt Status Enabled/Clear Registers for\r
+ * pending enabled interrupts. The highest numbered system interrupt\r
+ * will be processed first from left to right.\r
+ */\r
+ for (i = CpIntc_numStatusRegs - 1; i >= 0; i--) {\r
+ offset = i << 5;\r
+ \r
+ /*\r
+ * SDOCM00062100 - Nyquist CpIntc_dispatch needs to read the\r
+ * correct status pending and enabled register once the\r
+ * Simulator is fixed.\r
+ * Fix is:\r
+ * srsrVal = CpIntc_module->controller[id]->SECR[j - i];\r
+ */\r
+ srsrVal = CpIntc_module->controller[id]->SRSR[i] &\r
+ CpIntc_module->controller[id]->ESR[i];\r
+ \r
+ /* Find pending interrupts from left to right */\r
+ while (srsrVal) {\r
+ index = 31 - _lmbd(1, srsrVal);\r
+ srsrVal &= ~(1 << index);\r
+ \r
+ /* Make sure pending interrupt is mapped to host interrupt */\r
+ if (CpIntc_module->controller[id]->CMR[offset + index]\r
+ == hostInt) {\r
+ /* clear system interrupt first */\r
+ CpIntc_clearSysInt(id, offset + index);\r
+ \r
+ /* call function with arg */\r
+ CpIntc_module->dispatchTab[offset + index].fxn(\r
+ CpIntc_module->dispatchTab[offset + index].arg);\r
+ } \r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+\r
diff --git a/example/src/sample.h b/example/src/sample.h
--- /dev/null
+++ b/example/src/sample.h
@@ -0,0 +1,215 @@
+/*\r
+ * bios6_edma3_drv_sample.h\r
+ *\r
+ * Header file for the sample application for the EDMA3 Driver.\r
+ *\r
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
+\r
+#ifndef _BIOS6_EDMA3_DRV_SAMPLE_H_\r
+#define _BIOS6_EDMA3_DRV_SAMPLE_H_\r
+\r
+#include <stdio.h>\r
+#include <ti/sysbios/knl/Semaphore.h>\r
+\r
+/* Include EDMA3 Driver */\r
+#include <ti/sdo/edma3/drv/edma3_drv.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/**\r
+ * Set this flag to use the CpIntc_dispatchLoc() function as the Event Combiner\r
+ * dispatchPlug function when ever the system interrupts are registered with\r
+ * CPINTC with callbacks.\r
+ */\r
+#define USE_LOCAL_CPINTC_DISPATCH 0\r
+\r
+/**\r
+ * Set this flag to use the edma3ComplHandlerLoc() function as the completion\r
+ * interrupt ISR for the region used for driver testing.\r
+ */\r
+#define EDMA_LOCAL_COMP_ISR 1\r
+\r
+#if EDMA_LOCAL_COMP_ISR\r
+/**\r
+ * \brief TCC Callback - Caters to channel specific status reporting.\r
+ */\r
+typedef struct {\r
+ /** Callback function */\r
+ EDMA3_RM_TccCallback tccCb;\r
+\r
+ /** Callback data, passed to the Callback function */\r
+ void *cbData;\r
+} tccCallbackParams;\r
+#endif\r
+\r
+/* Macro to get CPINTC number */\r
+#define WHICH_CPINTC_NUM(core) ((core > 3)? 1: 0 )\r
+\r
+/**\r
+ * Cache line size on the underlying SoC. It needs to be modified\r
+ * for different cache line sizes, if the Cache is Enabled.\r
+ */\r
+#define EDMA3_CACHE_LINE_SIZE_IN_BYTES (128u)\r
+\r
+/* Error returned in case of buffers are not aligned on the cache boundary */\r
+#define EDMA3_NON_ALIGNED_BUFFERS_ERROR (-1)\r
+\r
+/* Error returned in case of data mismatch */\r
+#define EDMA3_DATA_MISMATCH_ERROR (-2)\r
+\r
+/**\r
+ * \brief EDMA3 Initialization\r
+ *\r
+ * This function initializes the EDMA3 Driver for the given EDMA3 controller\r
+ * and opens a EDMA3 driver instance. It internally calls EDMA3_DRV_create() and\r
+ * EDMA3_DRV_open(), in that order.\r
+ *\r
+ * It also registers interrupt handlers for various EDMA3 interrupts like \r
+ * transfer completion or error interrupts.\r
+ *\r
+ * \param edma3Id [IN] EDMA3 Controller Instance Id (Hardware\r
+ * instance id, starting from 0)\r
+ * \param errorCode [IN/OUT] Error code while opening DRV instance\r
+ * \return EDMA3_DRV_Handle: If successfully opened, the API will return the\r
+ * associated driver's instance handle.\r
+ */\r
+EDMA3_DRV_Handle edma3init (unsigned int edma3Id, EDMA3_DRV_Result *errorCode,\r
+ unsigned int dspCoreID, unsigned int tpccRegionUsed);\r
+\r
+/**\r
+ * \brief EDMA3 De-initialization\r
+ *\r
+ * This function de-initializes the EDMA3 Driver for the given EDMA3 controller\r
+ * and closes the previously opened EDMA3 driver instance. It internally calls \r
+ * EDMA3_DRV_close and EDMA3_DRV_delete(), in that order.\r
+ *\r
+ * It also un-registers the previously registered interrupt handlers for various \r
+ * EDMA3 interrupts.\r
+ *\r
+ * \param edma3Id [IN] EDMA3 Controller Instance Id (Hardware\r
+ * instance id, starting from 0)\r
+ * \param hEdma [IN] EDMA3 Driver handle, returned while using\r
+ * edma3init().\r
+ * \return EDMA3_DRV_SOK if success, else error code\r
+ */\r
+EDMA3_DRV_Result edma3deinit (unsigned int edma3Id, EDMA3_DRV_Handle hEdma);\r
+\r
+\r
+/**\r
+ * \brief EDMA3 Cache Invalidate\r
+ *\r
+ * This function invalidates the D cache.\r
+ *\r
+ * \param mem_start_ptr [IN] Starting address of memory.\r
+ * Please note that this should be\r
+ * aligned according to the cache line size.\r
+ * \param num_bytes [IN] length of buffer\r
+ * \return EDMA3_DRV_SOK if success, else error code in case of error\r
+ * or non-alignment of buffers.\r
+ *\r
+ * Note: This function is required if the buffer is in DDR.\r
+ * For other cases, where buffer is NOT in DDR, user\r
+ * may or may not require the below implementation and\r
+ * should modify it according to her need.\r
+ */\r
+EDMA3_DRV_Result Edma3_CacheInvalidate(unsigned int mem_start_ptr,\r
+ unsigned int num_bytes);\r
+\r
+\r
+\r
+/**\r
+ * \brief EDMA3 Cache Flush\r
+ *\r
+ * This function flushes (cleans) the Cache\r
+ *\r
+ * \param mem_start_ptr [IN] Starting address of memory.\r
+ * Please note that this should be\r
+ * aligned according to the cache line size.\r
+ * \param num_bytes [IN] length of buffer\r
+ * \return EDMA3_DRV_SOK if success, else error code in case of error\r
+ * or non-alignment of buffers.\r
+ *\r
+ * Note: This function is required if the buffer is in DDR.\r
+ * For other cases, where buffer is NOT in DDR, user\r
+ * may or may not require the below implementation and\r
+ * should modify it according to her need.\r
+ */\r
+EDMA3_DRV_Result Edma3_CacheFlush(unsigned int mem_start_ptr,\r
+ unsigned int num_bytes);\r
+\r
+\r
+\r
+/**\r
+ * Counting Semaphore related functions (OS dependent) should be\r
+ * called/implemented by the application. A handle to the semaphore\r
+ * is required while opening the driver/resource manager instance.\r
+ */\r
+\r
+/**\r
+ * \brief EDMA3 OS Semaphore Create\r
+ *\r
+ * This function creates a counting semaphore with specified\r
+ * attributes and initial value. It should be used to create a semaphore\r
+ * with initial value as '1'. The semaphore is then passed by the user\r
+ * to the EDMA3 driver/RM for proper sharing of resources.\r
+ * \param initVal [IN] is initial value for semaphore\r
+ * \param semParams [IN] is the semaphore attributes.\r
+ * \param hSem [OUT] is location to receive the handle to just created\r
+ * semaphore.\r
+ * \return EDMA3_DRV_SOK if successful, else a suitable error code.\r
+ */\r
+EDMA3_DRV_Result edma3OsSemCreate(int initVal,\r
+ const Semaphore_Params *semParams,\r
+ EDMA3_OS_Sem_Handle *hSem);\r
+\r
+\r
+\r
+/**\r
+ * \brief EDMA3 OS Semaphore Delete\r
+ *\r
+ * This function deletes or removes the specified semaphore\r
+ * from the system. Associated dynamically allocated memory\r
+ * if any is also freed up.\r
+ * \param hSem [IN] handle to the semaphore to be deleted\r
+ * \return EDMA3_DRV_SOK if successful else a suitable error code\r
+ */\r
+EDMA3_DRV_Result edma3OsSemDelete(EDMA3_OS_Sem_Handle hSem);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* extern "C" */\r
+\r
+#endif /* _BIOS6_EDMA3_DRV_SAMPLE_H_ */\r
+\r
diff --git a/example/src/sample_cfg.c b/example/src/sample_cfg.c
--- /dev/null
+++ b/example/src/sample_cfg.c
@@ -0,0 +1,1771 @@
+/*\r
+ * sample_cfg.c\r
+ *\r
+ * Platform specific EDMA3 hardware related information like number of transfer\r
+ * controllers, various interrupt ids etc. It is used while interrupts\r
+ * enabling / disabling. It needs to be ported for different SoCs.\r
+ *\r
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the \r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+*/\r
+\r
+#include <ti/sdo/edma3/drv/edma3_drv.h>\r
+\r
+/* Number of EDMA3 controllers present in the system */\r
+#define NUM_EDMA3_INSTANCES 3u\r
+const unsigned int numEdma3Instances = NUM_EDMA3_INSTANCES;\r
+\r
+/* Number of DSPs present in the system */\r
+#define NUM_DSPS 4u\r
+//const unsigned int numDsps = NUM_DSPS;\r
+\r
+#define CGEM_REG_START (0x01800000)\r
+\r
+/* Determine the processor id by reading DNUM register. */\r
+unsigned short determineProcId()\r
+ {\r
+ volatile unsigned int *addr;\r
+ unsigned int core_no;\r
+\r
+ /* Identify the core number */\r
+ addr = (unsigned int *)(CGEM_REG_START+0x40000);\r
+ core_no = ((*addr) & 0x000F0000)>>16;\r
+\r
+ return core_no;\r
+ }\r
+\r
+/** Whether global configuration required for EDMA3 or not.\r
+ * This configuration should be done only once for the EDMA3 hardware by\r
+ * any one of the masters (i.e. DSPs).\r
+ * It can be changed depending on the use-case.\r
+ */\r
+unsigned int gblCfgReqdArray [NUM_DSPS] = {\r
+ 0, /* DSP#0 is Master, will do the global init */\r
+ 1, /* DSP#1 is Slave, will not do the global init */\r
+ 1, /* DSP#2 is Slave, will not do the global init */\r
+ 1, /* DSP#3 is Slave, will not do the global init */\r
+ };\r
+\r
+unsigned short isGblConfigRequired(unsigned int dspNum)\r
+ {\r
+ return gblCfgReqdArray[dspNum];\r
+ }\r
+\r
+/* Semaphore handles */\r
+EDMA3_OS_Sem_Handle semHandle[NUM_EDMA3_INSTANCES] = {NULL,NULL,NULL};\r
+\r
+\r
+/* Variable which will be used internally for referring number of Event Queues. */\r
+unsigned int numEdma3EvtQue[NUM_EDMA3_INSTANCES] = {2u, 4u, 4u};\r
+\r
+/* Variable which will be used internally for referring number of TCs. */\r
+unsigned int numEdma3Tc[NUM_EDMA3_INSTANCES] = {2u, 4u, 4u};\r
+\r
+/**\r
+ * Variable which will be used internally for referring transfer completion\r
+ * interrupt. Completion interrupts for all the shadow regions and all the\r
+ * EDMA3 controllers are captured since it is a multi-DSP platform.\r
+ */\r
+unsigned int ccXferCompInt[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] = {\r
+ {\r
+ 38u, 39u, 40u, 41u,\r
+ 42u, 43u, 44u, 45u,\r
+ },\r
+ {\r
+ 8u, 9u, 10u, 11u,\r
+ 12u, 13u, 14u,