]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ivimm/ipumm.git/blob - build/config.bld
Integration with IPC 3.43.03.05 and FC 3.40.02.07
[ivimm/ipumm.git] / build / config.bld
1 /*
2  * Copyright (c) 2011-2015, 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  */
33 var Build        = xdc.useModule('xdc.bld.BuildEnvironment');
34 var commonBld    = xdc.loadCapsule("../build/common.bld");
35 var commonOpts   = "-g";
37 // Logic to support load_type=LOAD_ON build options
38 for (x = 0; x < arguments.length; x++)
39 {
40     if (arguments[x].match(/^hw_type=/) )
41     {
42         // [1] operation is used on the return value of split(), which is an
43         // array.
44         var hdw_type = arguments[x].split("=")[1];
45     }
46     if (arguments[x].match(/^hw_version=/) )
47     {
48         // [1] operation is used on the return value of split(), which is an
49         // array.
50         var hw_ver = arguments[x].split("=")[1];
51     }
52     if (arguments[x].match(/^prof_type=/) )
53     {
54         // [1] operation is used on the return value of split(), which is an
55         // array.
56         var prof_type = arguments[x].split("=")[1];
57     }
58     if (arguments[x].match(/^BIOS_type=/) )
59     {
60         // [1] operation is used on the return value of split(), which is an
61         // array.
62         var bios_type = arguments[x].split("=")[1];
63     }
64     if (arguments[x].match(/^trace_level=/) )
65     {
66         // [1] operation is used on the return value of split(), which is an
67         // array.
68         var trace_level = arguments[x].split("=")[1];
69     }
70 }
72 /************************************
73 * Memory Map Information
74 ************************************/
75 if (hdw_type == "OMAP5")
76 {
77 /*  Memory Map for ti.platforms.sdp5430:IPU
78  *
79  *  --- External Memory ---
80  *  Virtual     Physical        Size            Comment
81  *  ------------------------------------------------------------------------
82  *  0000_4000   ????_????    5F_C000  (  ~6 MB) EXT_CODE
83  *  8000_0000   ????_????    20_0000  (   2 MB) EXT_DATA
84  *  8060_0000   ????_????   290_0000  (  41 MB) EXT_HEAP
85  *  9F00_0000   9F00_0000     6_0000  ( 384 kB) TRACE_BUF
86  *  9F06_0000   9F06_0000     1_0000  (  64 kB) EXC_DATA
87  *  9F07_0000   9F07_0000     2_0000  ( 128 kB) PM_DATA (Power mgmt)
88  */
89     var sdp5430_ExtMemMapIpu = {
90         EXT_CODE: { name: "EXT_CODE", base: 0x00004000, len:  0x005FC000, space: "code", access: "RWX" },
91         EXT_DATA: { name: "EXT_DATA", base: 0x80000000, len:  0x00200000, space: "data", access: "RW" },
92         EXT_HEAP: { name: "EXT_HEAP", base: 0x80200000, len:  0x02900000, space: "data", access: "RW" },
93         TRACE_BUF: { name: "TRACE_BUF", base: 0x9F000000, len:  0x00060000, space: "data", access: "RW" },
94         EXC_DATA: { name: "EXC_DATA", base: 0x9F060000, len:  0x00010000, space: "data", access: "RW" },
95         PM_DATA: { name: "PM_DATA", base: 0x9F070000, len:  0x00020000, space: "data", access: "RWX" }
96     };
98     Build.platformTable["ti.platforms.sdp5430:IPU"] = {
99         externalMemoryMap: [
100             [ "EXT_CODE", sdp5430_ExtMemMapIpu.EXT_CODE ],
101             [ "EXT_DATA", sdp5430_ExtMemMapIpu.EXT_DATA ],
102             [ "EXT_HEAP", sdp5430_ExtMemMapIpu.EXT_HEAP ],
103             [ "TRACE_BUF", sdp5430_ExtMemMapIpu.TRACE_BUF ],
104             [ "EXC_DATA", sdp5430_ExtMemMapIpu.EXC_DATA ],
105             [ "PM_DATA", sdp5430_ExtMemMapIpu.PM_DATA ]
106         ],
107         codeMemory: "EXT_CODE",
108         dataMemory: "EXT_DATA",
109         stackMemory: "EXT_DATA",
110     };
112 else if (hdw_type == "VAYU")
114 /*  Memory Map for ti.platforms.evmDRA7XX:ipu2
115  *
116  *  --- External Memory ---
117  *  Virtual     Physical        Size            Comment
118  *  ------------------------------------------------------------------------
119  *  0000_4000   ????_????    5F_C000  (  ~6 MB) EXT_CODE
120  *  8000_0000   ????_????    20_0000  (   2 MB) EXT_DATA
121  *  8060_0000   ????_????   290_0000  (  41 MB) EXT_HEAP
122  *  9F00_0000   9F00_0000     6_0000  ( 384 kB) TRACE_BUF
123  *  9F06_0000   9F06_0000     1_0000  (  64 kB) EXC_DATA
124  *  9F07_0000   9F07_0000     2_0000  ( 128 kB) PM_DATA (Power mgmt)
125  */
126     var evmDRA7XX_ExtMemMapIpu2 = {
127         EXT_CODE: { name: "EXT_CODE", base: 0x00004000, len:  0x005FC000, space: "code", access: "RWX" },
128         EXT_DATA: { name: "EXT_DATA", base: 0x80000000, len:  0x00200000, space: "data", access: "RW" },
129         EXT_HEAP: { name: "EXT_HEAP", base: 0x80200000, len:  0x02900000, space: "data", access: "RW" },
130         TRACE_BUF: { name: "TRACE_BUF", base: 0x9F000000, len:  0x00060000, space: "data", access: "RW" },
131         EXC_DATA: { name: "EXC_DATA", base: 0x9F060000, len:  0x00010000, space: "data", access: "RW" },
132         PM_DATA: { name: "PM_DATA", base: 0x9F070000, len:  0x00020000, space: "data", access: "RWX" }
133     };
135     Build.platformTable["ti.platforms.evmDRA7XX:ipu2"] = {
136         externalMemoryMap: [
137             [ "EXT_CODE", evmDRA7XX_ExtMemMapIpu2.EXT_CODE ],
138             [ "EXT_DATA", evmDRA7XX_ExtMemMapIpu2.EXT_DATA ],
139             [ "EXT_HEAP", evmDRA7XX_ExtMemMapIpu2.EXT_HEAP ],
140             [ "TRACE_BUF", evmDRA7XX_ExtMemMapIpu2.TRACE_BUF ],
141             [ "EXC_DATA", evmDRA7XX_ExtMemMapIpu2.EXC_DATA ],
142             [ "PM_DATA", evmDRA7XX_ExtMemMapIpu2.PM_DATA ]
143         ],
144         codeMemory: "EXT_CODE",
145         dataMemory: "EXT_DATA",
146         stackMemory: "EXT_DATA",
147     };
151 var TargetBuild = commonBld.getTargetBuild(arguments);
152     commonOpts += " -DHOST_TYPE=HOST_UNKNOWN "
154 /************************************
155 * Setup for ipu target
156 ************************************/
157 var ipu_tgt            = xdc.useModule('ti.targets.arm.elf.M4');
158 ipu_tgt.rootDir        = java.lang.System.getenv("TMS470CGTOOLPATH");
159 ipu_tgt.ccOpts.suffix  += " --gcc -D___DSPBIOS___ -DCORE0";
160 ipu_tgt.ccOpts.suffix += " -ms ";
161 ipu_tgt.ccOpts.suffix += " -pden -pds=48 ";
162 ipu_tgt.ccOpts.suffix += " -pdew "; //Convert warn to err; Supported in 4.9 version
163 //Codecs are built with this. keeping it for now
164 //as all dependent packages need to be rebuilt with this flag which is not possible.
165 //ipu_tgt.ccOpts.suffix += " --wchar_t=32 ";
166 ipu_tgt.ccOpts.suffix  += commonOpts;
167 ipu_tgt.lnkOpts.suffix += " -x ";
168 ipu_tgt.lnkOpts.suffix += " --retain=.resource_table";
169 //ipu_tgt.lnkOpts.prefix +=  " --zero_init=off ";
170 ipu_tgt.lnkOpts.suffix += " --cinit_compression=off";
171 ipu_tgt.lnkOpts.prefix += " --diag_suppress=16032 "; //Supress wchar_t warnings
173 ipu_tgt.platforms = [
174                       "ti.platform.omap4430.core0", //0
175                       "ti.platform.omap4430.core1", //1
176                       "ti.platform.omap4430.core0_512", //2
177                       "ti.platform.omap4430.core1_512", //3
178                       "ti.platform.omap54xx.core0", //4
179                       "ti.platform.omap54xx.core1", //5
180                       "ti.platform.omap4430.ipu", //6
181                       "ti.platforms.sdp5430:IPU", //7
182                       "ti.platforms.evmDRA7XX:ipu2", //8
183                     ];
186 /**********  PSI_KPI instrumentation ***********/
187 if (prof_type == "ENABLE")
189     var psi_kpi_flag = true
190     print("Profiler enabled");
191     ipu_tgt.ccOpts.suffix += " -DBUILD_PSI_KPI";
193 else
195     var psi_kpi_flag = false
197 /**********  PSI_KPI instrument. End ***********/
199 /*****************  Tracing ********************/
201 if(trace_level == 0) {
202     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=0";
203 } else if(trace_level == 1) {
204     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE";
205     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=1";
206 } else if(trace_level == 2) {
207     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE";
208     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=2";
209 } else if(trace_level == 3) {
210     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE";
211     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=3";
212 } else if(trace_level >= 4) {
213     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE";
214     ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=4";
217 /*****************  Tracing ********************/
220 var omap5_zebu = false;
221 var omap5_virtio = false;
222 var build_omap5 = false;
223 var omap5_es20 = false;
224 var build_vayu = false;
225 var hw_OMAP4 = 0;
226 var hw_OMAP5 = 1;
227 var hw_VAYU = 2;
229 var VIRTIO = 0;
230 var ZEBU = 0;
231 var ES10 = 1;
232 var ES20 = 2;
234 var HwType = hw_VAYU; //default vayu
236 var HwVer = ES10; //Default ES1.0
238 if (bios_type == "SMP")
240     SMPmode = true;
243 if (hdw_type == "OMAP5")
245     build_omap5 = true;
246     HwType = hw_OMAP5;
247     ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5";
248     if (hw_ver == "VIRTIO")
249     {
250         HwVer = VIRTIO;
251         omap5_virtio = true;
252         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5_VIRTIO";
253     }
254     else if (hw_ver == "ZEBU")
255     {
256         HwVer = ZEBU;
257         omap5_zebu = true;
258         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5_ZEBU";
259     }
260     else if(hw_ver == "ES20")
261     {
262         HwVer = ES20;
263         omap5_es20 = true;
264         ipu_tgt.ccOpts.suffix += " -DOMAP5432_ES20";
265     }
266     else
267     {
268         HwVer = ES10;
269         ipu_tgt.ccOpts.suffix += " -DOMAP5_ES10";
270     }
271     if(bios_type == "SMP")
272     {
273         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP";
274         ipu_tgt.platform = ipu_tgt.platforms[7];
275     }
276     else
277     {
278         ipu_tgt.platform = ipu_tgt.platforms[4];
279     }
281 else if (hdw_type == "VAYU")
283     HwType = hw_VAYU;
284     HwVer = ES10;
285     var build_vayu = true;
286     print("Selected Vayu for ES10");
287     if(bios_type == "SMP")
288     {
289         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_VAYU";
290         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP";
291         ipu_tgt.ccOpts.suffix += " -DVAYU_ES10";
292         ipu_tgt.platform = ipu_tgt.platforms[8];
293     }
294     else
295     {
296         print("VAYU Non-SMP IPU is not supported");
297     }
299 else
301     HWType = hw_OMAP4;
302     var build_omap4 = true;
303     HwVer = ES20;
304     if(bios_type == "SMP")
305     {
306         ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP";
307         ipu_tgt.platform = ipu_tgt.platforms[6];
308     }
309     else
310     {
311         ipu_tgt.platform = ipu_tgt.platforms[0];
312     }
315 Build.targets     = [
316                         ipu_tgt,
317                     ];
319 var Pkg = xdc.module("xdc.bld.PackageContents");