BIOS: Fix ti.ipc.transport build script for rpmsg2-based libs
[ipc/ipcdev.git] / packages / ti / ipc / tests / package.bld
1 /*
2  * Copyright (c) 2012-2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*
33  *  ======== package.bld ========
34  *
35  */
37 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
38 var Pkg = xdc.useModule('xdc.bld.PackageContents');
40 Pkg.otherFiles = [ "mmrpc_test.c" ];
42 /* when constructing a release, release everything */
43 Pkg.attrs.exportAll = true;
45 /* Uncomment this to build the app with debug support */
46 Pkg.attrs.profile = "debug";
48 /* bin/ is a generated directory that 'xdc clean' should remove */
49 Pkg.generatedFiles.$add("bin/");
51 /* define the platform instances we support - currently only OMAPL138 */
52 var evmOMAPL138_ExtMemMap = {
53     DDR: {
54         name: "DDR",
55         base: 0xc3100000,
56         len:  0x00800000,
57         space: "code/data"
58     }
59 };
61 Build.platformTable["ti.platforms.evmOMAPL138:DSP"] = {
62     externalMemoryMap: [
63         [ "DDR", evmOMAPL138_ExtMemMap.DDR ]
64     ],
65     codeMemory: "DDR",
66     dataMemory: "DDR",
67     stackMemory: "DDR",
68     l2Mode: "32k"
69 };
71 for (var i = 0; i < Build.targets.length; i++) {
72     var targ = Build.targets[i];
74 //    print("building for target " + targ.name + " ...");
76     /* currently only build for OMAPL138, Keystone II, OMAP5, and Vayu*/
77     if (!((targ.isa == "674") || (targ.isa == "66") ||
78           (targ.isa.match(/v7M(|4)/)) || (targ.isa == "64T"))) {
79         continue;
80     }
82     /* Platforms were added to targ.platforms[] in config.bld */
83     for (var j = 0; j < targ.platforms.length; j++) {
84         var platform = targ.platforms[j];
86         /* currently only build for OMAPL138, Keystone II, OMAP5, and Vayu*/
87         if (!((platform.match(/^ti\.platforms\.evm6614\:DSP/)) ||
88               (platform.match(/^ti\.platforms\.simKepler/)) ||
89               (platform.match(/^ti.platforms.evmTCI6638K2K/)) ||
90               (platform.match(/^ti\.platform\.omap54xx/)) ||
91               (platform.match(/^ti\.platform\.vayu/)) ||
92               (platform.match(/\.platforms\.evmOMAPL138/)))) {
93              continue;
94         }
96         print("  platform:  " + platform);
97         // name = bin/platform/name.x+suffix
98         var name = "bin/" +
99                 // replace all ':' and '.' with '_' in platform name
100                 platform.replace(/\:/g, "_").replace(/\./g, "_");
102         if (targ.isa.match(/^v7M(|4)$/)) {
103             Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
104                 cfgScript: "ping_rpmsg",
105                 defs: " -DRPMSG_NS_2_0"
106             }).addObjects(["ping_rpmsg.c"]);
107         } else if (targ.isa == "64T") {
108             Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
109                 cfgScript: "ping_rpmsg",
110                 defs: " -DRPMSG_NS_2_0"
111             }).addObjects(["ping_rpmsg.c"]);
112         } else if (targ.isa == "66" &&
113                    platform.match(/^ti\.platform\.vayu/)) {
114             Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
115                 cfgScript: "ping_rpmsg",
116                 defs: " -DRPMSG_NS_2_0"
117             }).addObjects(["ping_rpmsg.c"]);
118         } else {
119             Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
120                 cfgScript: "ping_rpmsg"
121             }).addObjects(["ping_rpmsg.c"]);
122         }
124         /* Only build this for our multicore platforms: */
125         if (platform.match(/^ti\.platforms\.simKepler/) ||
126                 (platform.match(/^ti.platforms.evmTCI6638K2K/)) ||
127                 (platform.match(/^ti\.platforms\.evm6614\:DSP/))) {
128             Pkg.addExecutable(name + "/messageq_multicore", targ, platform, {
129                 cfgScript: "messageq_multicore",
130                 //defs: "-D TCI6614_v33"
131                 //defs: "-D TCI6614"
132                 defs: "-D TCI6638"
133             }).addObjects(["messageq_multicore.c"]);
135             Pkg.addExecutable(name + "/dual_transports", targ, platform, {
136                 cfgScript: "dual_transports",
137             }).addObjects(["dual_transports.c"]);
138         }
140         if (targ.isa.match(/^v7M(|4)$/)) {
141             Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
142                 cfgScript: "rpmsg_transport",
143                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
144             }).addObjects(["messageq_multi.c"]);
145         } else if (targ.isa == "64T") {
146             Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
147                 cfgScript: "rpmsg_transport",
148                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
149             }).addObjects(["messageq_multi.c"]);
150         } else if (targ.isa == "66" &&
151                    platform.match(/^ti\.platform\.vayu/)) {
152             Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
153                 cfgScript: "rpmsg_transport",
154                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
155             }).addObjects(["messageq_multi.c"]);
156         } else {
157             Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
158                 cfgScript: "rpmsg_transport",
159                 defs: "-D BENCHMARK"
160             }).addObjects(["messageq_multi.c"]);
161         }
163         if (targ.isa.match(/^v7M(|4)$/)) {
164             Pkg.addExecutable(name + "/messageq_single", targ, platform, {
165                 cfgScript: "rpmsg_transport",
166                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
167             }).addObjects(["messageq_single.c"]);
168         } else if (targ.isa == "64T") {
169             Pkg.addExecutable(name + "/messageq_single", targ, platform, {
170                 cfgScript: "rpmsg_transport",
171                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
172             }).addObjects(["messageq_single.c"]);
173         } else if (targ.isa == "66" &&
174                    platform.match(/^ti\.platform\.vayu/)) {
175             Pkg.addExecutable(name + "/messageq_single", targ, platform, {
176                 cfgScript: "rpmsg_transport",
177                 defs: "-D BENCHMARK -DRPMSG_NS_2_0"
178             }).addObjects(["messageq_single.c"]);
179         } else {
180             Pkg.addExecutable(name + "/messageq_single", targ, platform, {
181                 cfgScript: "rpmsg_transport",
182                 defs: "-D BENCHMARK "
183             }).addObjects(["messageq_single.c"]);
184         }
186         if (platform.match(/^ti\.platforms\.evmOMAPL138\:DSP/)) {
187                 Pkg.addExecutable(name + "/nano_test", targ, platform, {
188                     cfgScript: "rpmsg_transport"
189                 }).addObjects(["nano_test.c"]);
190         }
192         if (platform.match(/^ti\.platform\.omap54xx\.ipu/)) {
193             Pkg.addExecutable(name + "/test_omx_ipu_omap5", targ, platform, {
194                 cfgScript: "test_omx_ipu_omap5",
195                 defs: "-D IPU -D OMAP5xxx -DRPMSG_NS_2_0"
196             }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
197                     "MxServer.c"]);
198         }
200         if (platform.match(/^ti\.platform\.omap54xx\.dsp/)) {
201             Pkg.addExecutable(name + "/test_omx_dsp_omap5", targ, platform, {
202                 cfgScript: "test_omx_dsp_omap5",
203                 defs: "-D DSP -D OMAP5xxx -DRPMSG_NS_2_0"
204             }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
205                     "MxServer.c"]);
206         }
208         if (platform.match(/^ti\.platform\.vayu\.ipu2/)) {
209             Pkg.addExecutable(name + "/test_omx_ipu2_vayu", targ, platform, {
210                 cfgScript: "test_omx_ipu_vayu",
211                 defs: "-D IPU -D VAYU -DRPMSG_NS_2_0"
212             }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
213                     "MxServer.c"]);
214         }
216         if (platform.match(/^ti\.platform\.vayu\.dsp1/)) {
217             Pkg.addExecutable(name + "/test_omx_dsp1_vayu", targ, platform, {
218                 cfgScript: "test_omx_dsp_vayu",
219                 defs: "-D DSP -D VAYU -DRPMSG_NS_2_0"
220             }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
221                     "MxServer.c"]);
222         }
223     }