From 25581463a4fc769cf806f0bb860a57d415e73c1f Mon Sep 17 00:00:00 2001 From: Angela Stegmaier Date: Mon, 11 Jan 2016 11:32:22 -0600 Subject: [PATCH] Create an ipumm library with a single entry point Created a library "ipu.aem4" with a single entry point "IPUMM_Main". Main source files are moved to a folder named "baselib". The baseimage is still built by linking with the baselib library and then calling the main function that is included in this library. Change-Id: Ieee7b011e06119397dd108ae9ea3e9c03fc8762d Signed-off-by: Angela Stegmaier --- .gitignore | 4 + Makefile | 4 +- platform/ti/dce/baseimage/dce_ipu.cfg | 3 +- platform/ti/dce/baseimage/main.c | 36 +----- platform/ti/dce/baseimage/package.bld | 6 +- platform/ti/dce/baseimage/package.xdc | 2 - platform/ti/dce/baselib/BASELIB.xdc | 40 +++++++ platform/ti/dce/baselib/BASELIB.xs | 79 +++++++++++++ platform/ti/dce/baselib/ipumm_main.c | 90 ++++++++++++++ platform/ti/dce/baselib/ipumm_main.h | 6 + .../iresman_tiledmemory.c | 0 .../ti/dce/{baseimage => baselib}/load_task.c | 0 platform/ti/dce/baselib/package.bld | 110 ++++++++++++++++++ platform/ti/dce/baselib/package.xdc | 44 +++++++ platform/ti/dce/baselib/package.xs | 106 +++++++++++++++++ .../dce/{baseimage => baselib}/ping_tasks.c | 1 - 16 files changed, 492 insertions(+), 39 deletions(-) create mode 100644 platform/ti/dce/baselib/BASELIB.xdc create mode 100644 platform/ti/dce/baselib/BASELIB.xs create mode 100644 platform/ti/dce/baselib/ipumm_main.c create mode 100644 platform/ti/dce/baselib/ipumm_main.h rename platform/ti/dce/{baseimage => baselib}/iresman_tiledmemory.c (100%) rename platform/ti/dce/{baseimage => baselib}/load_task.c (100%) create mode 100644 platform/ti/dce/baselib/package.bld create mode 100644 platform/ti/dce/baselib/package.xdc create mode 100644 platform/ti/dce/baselib/package.xs rename platform/ti/dce/{baseimage => baselib}/ping_tasks.c (99%) diff --git a/.gitignore b/.gitignore index 9a0081e..0792bcf 100644 --- a/.gitignore +++ b/.gitignore @@ -26,9 +26,13 @@ dcetestdec .libraries* *.mak */baseimage/package/ +*/baselib/package/ platform/ti/dce/baseimage/out/ +platform/ti/dce/baselib/lib/ bldcfg.mk platform/ti/dce/baseimage/package/ +platform/ti/dce/baselib/package/ +platform/ti/dce/baselib/BASELIB.h src/ti/framework/dce/lib/ src/ti/framework/dce/package/ src/ti/utils/lib/ diff --git a/Makefile b/Makefile index 793d0ea..ac1b1cf 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ export XDCBUILDCFG = $(DUCATIDCEMMSRC)/build/config.bld XDCDIST_TREE = $(REPO)/$(XDCVERSION) export XDCROOT = $(XDCDIST_TREE) -export XDCPATH = $(BIOSPROD)/packages;$(IPCSRC)/packages;$(CEPROD)/packages;$(FCPROD)/packages;$(XDAISPROD)/packages;$(DUCATIDCEMMSRC)/extrel/ti/ivahd_codecs/packages;$(DUCATIDCEMMSRC)/src; +export XDCPATH = $(BIOSPROD)/packages;$(IPCSRC)/packages;$(CEPROD)/packages;$(FCPROD)/packages;$(XDAISPROD)/packages;$(DUCATIDCEMMSRC)/extrel/ti/ivahd_codecs/packages;$(DUCATIDCEMMSRC)/src;$(DUCATIDCEMMSRC); # Custom settings for build JOBS ?= 1 @@ -135,6 +135,7 @@ omap5_smp_config: unconfig clean: config export XDCARGS=$(MYXDCARGS); \ + $(XDCROOT)/xdc --jobs=$(JOBS) clean -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baselib/.; \ $(XDCROOT)/xdc --jobs=$(JOBS) clean -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/. build: config @@ -148,6 +149,7 @@ else ifeq ($(TMS470CGTOOLPATH),) @exit 1 endif export XDCARGS=$(MYXDCARGS); \ + $(XDCROOT)/xdc --jobs=$(JOBS) -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baselib/.; \ $(XDCROOT)/xdc --jobs=$(JOBS) -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/. ducatibin: build diff --git a/platform/ti/dce/baseimage/dce_ipu.cfg b/platform/ti/dce/baseimage/dce_ipu.cfg index a17a2d2..efe9e12 100644 --- a/platform/ti/dce/baseimage/dce_ipu.cfg +++ b/platform/ti/dce/baseimage/dce_ipu.cfg @@ -70,6 +70,8 @@ xdc.useModule('ti.ipc.ipcmgr.IpcMgr'); xdc.loadPackage('ti.srvmgr'); xdc.loadPackage('ti.srvmgr.omaprpc'); +xdc.useModule('platform.ti.dce.baselib.BASELIB'); + var Memory = xdc.useModule('xdc.runtime.Memory'); var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var GateHwi = xdc.useModule('ti.sysbios.gates.GateHwi'); @@ -126,7 +128,6 @@ xdc.loadPackage('ti.sdo.ce.alg').profile = "debug"; xdc.useModule('ti.sdo.fc.global.Settings').profile = "debug"; xdc.loadPackage('ti.sdo.fc.rman').profile = "debug"; xdc.loadPackage('ti.sdo.fc.ires.hdvicp').profile = "debug"; -xdc.loadPackage('ti.sdo.fc.ires.tiledmemory').profile = "debug"; xdc.loadPackage('ti.sdo.fc.utils').profile = "debug"; var ipcSettings = xdc.useModule('ti.sdo.ce.ipc.Settings'); diff --git a/platform/ti/dce/baseimage/main.c b/platform/ti/dce/baseimage/main.c index 662c9ec..dc02e50 100644 --- a/platform/ti/dce/baseimage/main.c +++ b/platform/ti/dce/baseimage/main.c @@ -36,20 +36,18 @@ #include #include -#include #include -#include #include #include -#include -#include -#include +#include #include #include #include +#include + // Include the custom resource table for memory configuration. #if (defined VAYU_ES10) #if (defined BUILD_FOR_QNX) @@ -64,9 +62,6 @@ extern uint32_t dce_debug; extern Uint32 kpi_control; -/* Legacy function to allow Linux side rpmsg sample tests to work: */ -extern void start_ping_tasks(); - static unsigned int SyslinkMemUtils_VirtToPhys(Ptr Addr) { unsigned int pa; @@ -77,14 +72,6 @@ static unsigned int SyslinkMemUtils_VirtToPhys(Ptr Addr) return (pa); } -void *MEMUTILS_getPhysicalAddr(Ptr vaddr) -{ - unsigned int paddr = SyslinkMemUtils_VirtToPhys(vaddr); - - DEBUG("virtual addr:%x\tphysical addr:%x", vaddr, paddr); - return ((void *)paddr); -} - #pragma DATA_SECTION(ipummversion, ".ipummversion") char ipummversion[128] = ducati_ver_tag; @@ -110,23 +97,13 @@ void tools_ShowVersion() System_printf("Trace level PA 0x%x Trace Level %d\ \nTrace Usage: level:[0-4: 0-no trace, 1-err, 2-debug, 3-info, 4-CE,FC,IPC traces] \n\n", - MEMUTILS_getPhysicalAddr(&dce_debug), dce_debug); - System_printf("Trace Buffer PA 0x%x kpi_control (PA 0x%x value 0x%x)\n", MEMUTILS_getPhysicalAddr((Ptr)(TRACEBUFADDR)), MEMUTILS_getPhysicalAddr((Ptr)(&kpi_control)), kpi_control); + SyslinkMemUtils_VirtToPhys(&dce_debug), dce_debug); + System_printf("Trace Buffer PA 0x%x kpi_control (PA 0x%x value 0x%x)\n", SyslinkMemUtils_VirtToPhys((Ptr)(TRACEBUFADDR)), SyslinkMemUtils_VirtToPhys((Ptr)(&kpi_control)), kpi_control); } int main(int argc, char * *argv) { - extern void start_load_task(void); - UInt16 hostId; - - /* Set up interprocessor notifications */ - System_printf("%s starting..\n", MultiProc_getName(MultiProc_self())); - - hostId = MultiProc_getId("HOST"); - RPMessage_init(hostId); - - /* CPU load reporting in the trace. */ - start_load_task(); + IPUMM_Main(argc, argv); /* Dump Tools version */ tools_ShowVersion(); @@ -135,4 +112,3 @@ int main(int argc, char * *argv) return (0); } - diff --git a/platform/ti/dce/baseimage/package.bld b/platform/ti/dce/baseimage/package.bld index 459c258..25b5455 100644 --- a/platform/ti/dce/baseimage/package.bld +++ b/platform/ti/dce/baseimage/package.bld @@ -42,10 +42,7 @@ var commonBld = xdc.loadCapsule("../build/common.bld"); var SRC_FILES_APP = [ "main.c", - "ping_tasks.c", - "load_task.c", - "iresman_tiledmemory.c" - ]; +]; var SRC_FILES_SYS = [ ]; @@ -94,6 +91,7 @@ for (var i = 0; i < Build.targets.length; i++) { print(profileOpts+"\r\n"); print("HwType = " + HwType); print("HwVer = " + HwVer); + var exe = Pkg.addExecutable(out_name, targ, targ.platform, {cfgScript:cfgFileName, profile:profile, copts: profileOpts, cfgArgs:"{HwType:" + HwType + ",enableSMP:" + SMPmode + diff --git a/platform/ti/dce/baseimage/package.xdc b/platform/ti/dce/baseimage/package.xdc index 1d62662..8ff7ee4 100644 --- a/platform/ti/dce/baseimage/package.xdc +++ b/platform/ti/dce/baseimage/package.xdc @@ -33,8 +33,6 @@ * ======== package.xdc ======== * */ -requires ti.framework.dce; -requires src.ti.utils; /*! diff --git a/platform/ti/dce/baselib/BASELIB.xdc b/platform/ti/dce/baselib/BASELIB.xdc new file mode 100644 index 0000000..4e33346 --- /dev/null +++ b/platform/ti/dce/baselib/BASELIB.xdc @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * ======== BASELIB.xdc ======== + * + */ + +module BASELIB { + +} diff --git a/platform/ti/dce/baselib/BASELIB.xs b/platform/ti/dce/baselib/BASELIB.xs new file mode 100644 index 0000000..07cd603 --- /dev/null +++ b/platform/ti/dce/baselib/BASELIB.xs @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * ======== package.xs ======== + * + */ + + +/* + * ======== init ======== + */ +function init() +{ + /* + * install a SYS/BIOS startup function + * it will be called during BIOS_start() + */ + var BIOS = xdc.useModule('ti.sysbios.BIOS'); +} + + + +/* + * ======== Package.getLibs ======== + * This function is called when a program's configuration files are + * being generated and it returns the name of a library appropriate + * for the program's configuration. + */ + +function getLibs(prog) +{ + var pkg = "ipu"; + var commonBld = xdc.loadCapsule("build/common.bld"); + var dir = xdc.getPackageBase("platform.ti.dce.baselib"); + var lib = commonBld.commonGetLibs(prog, true, pkg, dir); + return lib; + +} + +/* + * ======== package.close ======== + */ +function close() +{ + + if (xdc.om.$name != 'cfg') { + return; + } +} diff --git a/platform/ti/dce/baselib/ipumm_main.c b/platform/ti/dce/baselib/ipumm_main.c new file mode 100644 index 0000000..aa92080 --- /dev/null +++ b/platform/ti/dce/baselib/ipumm_main.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2011-2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + + +/* Legacy function to allow Linux side rpmsg sample tests to work: */ +extern void start_ping_tasks(); + +static unsigned int SyslinkMemUtils_VirtToPhys(Ptr Addr) +{ + unsigned int pa; + + if( !Addr || Resource_virtToPhys((unsigned int) Addr, &pa)) { + return (0); + } + return (pa); +} + +void *MEMUTILS_getPhysicalAddr(Ptr vaddr) +{ + unsigned int paddr = SyslinkMemUtils_VirtToPhys(vaddr); + + DEBUG("virtual addr:%x\tphysical addr:%x", vaddr, paddr); + return ((void *)paddr); +} + +int IPUMM_Main(int argc, char * *argv) +{ + extern void start_load_task(void); + UInt16 hostId; + + /* Set up interprocessor notifications */ + System_printf("%s starting..\n", MultiProc_getName(MultiProc_self())); + + hostId = MultiProc_getId("HOST"); + RPMessage_init(hostId); + + /* CPU load reporting in the trace. */ + start_load_task(); + + return (0); +} diff --git a/platform/ti/dce/baselib/ipumm_main.h b/platform/ti/dce/baselib/ipumm_main.h new file mode 100644 index 0000000..79c9266 --- /dev/null +++ b/platform/ti/dce/baselib/ipumm_main.h @@ -0,0 +1,6 @@ +#ifndef __IPUMM_MAIN_H__ +#define __IPUMM_MAIN_H__ + +int IPUMM_Main(int argc, char * *argv); + +#endif diff --git a/platform/ti/dce/baseimage/iresman_tiledmemory.c b/platform/ti/dce/baselib/iresman_tiledmemory.c similarity index 100% rename from platform/ti/dce/baseimage/iresman_tiledmemory.c rename to platform/ti/dce/baselib/iresman_tiledmemory.c diff --git a/platform/ti/dce/baseimage/load_task.c b/platform/ti/dce/baselib/load_task.c similarity index 100% rename from platform/ti/dce/baseimage/load_task.c rename to platform/ti/dce/baselib/load_task.c diff --git a/platform/ti/dce/baselib/package.bld b/platform/ti/dce/baselib/package.bld new file mode 100644 index 0000000..0128998 --- /dev/null +++ b/platform/ti/dce/baselib/package.bld @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * ======== ipumm/platform/ti/dce/baselib/package.bld ======== + */ + +var Build = xdc.useModule('xdc.bld.BuildEnvironment'); +var Pkg = xdc.useModule('xdc.bld.PackageContents'); +var compileOpts = " " +var waval = 0; + +var commonBld = xdc.loadCapsule("../build/common.bld"); + +var SRC_FILES_APP = [ + "ipumm_main.c", + "ping_tasks.c", + "load_task.c", + "iresman_tiledmemory.c" +]; + +var SRC_FILES_SYS = [ +]; + +coreNames = commonBld.getCores(arguments); +/* select default as ipu */ +if (coreNames.length==0) { + coreNames[0] = "ipu"; +} + +var profiles = commonBld.getProfiles(arguments); +/* If no profiles were assigned, build for release */ +if (profiles.length == 0) { + profiles[0] = "release"; +} + + +for (var i = 0; i < Build.targets.length; i++) { + + var targ = Build.targets[i]; + + for (var j = 0; j < coreNames.length; j++) { + var coreName = coreNames[j]; + + var cfgFileName = 'dce_' + coreName + '.cfg'; + + if(coreName.match(/sys_m3/)){ + var SRC_FILES = SRC_FILES_SYS; + } + + if(coreName.match(/ipu/)){ + var SRC_FILES = SRC_FILES_APP; + } + + for( var k = 0; k< profiles.length; k++) + { + var profile = profiles[k]; + var profileOpts = commonBld.buildOptions(arguments, compileOpts, coreName); + + + var lib_name = 'lib/' + coreName + '/' + profile + '/' + coreName; + var lib_name_qnx = 'lib/' + coreName + '/' + profile + '/' + "qnx_ipu"; + + print ("config file: " + cfgFileName + "\n"); + print ("profile: " + profile + "\n"); + print(profileOpts+"\r\n"); + print("HwType = " + HwType); + print("HwVer = " + HwVer); + + var mylib = Pkg.addLibrary(lib_name, targ, + {profile:profile, copts: profileOpts }); + + mylib.addObjects(SRC_FILES); + + var qnxLib = Pkg.addLibrary(lib_name_qnx, targ, + {profile:profile, copts: profileOpts, + defs: "-D BUILD_FOR_QNX" }); + + qnxLib.addObjects(SRC_FILES); + } + } +} diff --git a/platform/ti/dce/baselib/package.xdc b/platform/ti/dce/baselib/package.xdc new file mode 100644 index 0000000..da84a03 --- /dev/null +++ b/platform/ti/dce/baselib/package.xdc @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * ======== package.xdc ======== + * + */ +requires ti.framework.dce; +requires src.ti.utils; + +/*! + * ======== platform.ti.dce.baselib ======== + */ +package platform.ti.dce.baselib [1,0,0,0] { + module BASELIB; +} diff --git a/platform/ti/dce/baselib/package.xs b/platform/ti/dce/baselib/package.xs new file mode 100644 index 0000000..0364f0d --- /dev/null +++ b/platform/ti/dce/baselib/package.xs @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * ======== package.xs ======== + * + */ + + +/* + * ======== init ======== + */ +function init() +{ + /* + * install a SYS/BIOS startup function + * it will be called during BIOS_start() + */ + var BIOS = xdc.useModule('ti.sysbios.BIOS'); +} + + + +/* + * ======== Package.getLibs ======== + * This function is called when a program's configuration files are + * being generated and it returns the name of a library appropriate + * for the program's configuration. + */ + +function getLibs(prog) +{ + var pkg = this; + var commonBld = xdc.loadCapsule("build/common.bld"); + var dir = xdc.getPackageBase("platform.ti.dce.baselib"); + var suffix; + + /* find a compatible suffix */ + if ("findSuffix" in prog.build.target) { + suffix = prog.build.target.findSuffix(pkg); + } + else { + suffix = prog.build.target.suffix; + } + + var name = "ipu.a" + suffix; + var lib = ""; + + lib = "lib/" + prog.global.coreName + "/" + pkg.profile + "/" + name; + + if (java.io.File(dir + lib).exists()) { + return lib; + } + else { + print("Default lib not found: " + lib +"\nlooking for release lib"); + lib = "lib/" + prog.global.coreName + "/" + "release/" + name; + if (java.io.File(dir + lib).exists()) { + return lib; + } + } + + /* could not find any library, throw exception */ + throw Error("Library not found: " + lib); + + return lib; +} + +/* + * ======== package.close ======== + */ +function close() +{ + + if (xdc.om.$name != 'cfg') { + return; + } +} diff --git a/platform/ti/dce/baseimage/ping_tasks.c b/platform/ti/dce/baselib/ping_tasks.c similarity index 99% rename from platform/ti/dce/baseimage/ping_tasks.c rename to platform/ti/dce/baselib/ping_tasks.c index 9402c77..ad4302e 100644 --- a/platform/ti/dce/baseimage/ping_tasks.c +++ b/platform/ti/dce/baselib/ping_tasks.c @@ -115,4 +115,3 @@ void start_ping_tasks() params.arg0 = 51; Task_create(copyTaskFxn, ¶ms, NULL); } - -- 2.39.2