/* * 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. */ var Build = xdc.useModule('xdc.bld.BuildEnvironment'); var commonBld = xdc.loadCapsule("../build/common.bld"); var commonOpts = "-g"; // Logic to support load_type=LOAD_ON build options for (x = 0; x < arguments.length; x++) { if (arguments[x].match(/^hw_type=/) ) { // [1] operation is used on the return value of split(), which is an // array. var hdw_type = arguments[x].split("=")[1]; } if (arguments[x].match(/^hw_version=/) ) { // [1] operation is used on the return value of split(), which is an // array. var hw_ver = arguments[x].split("=")[1]; } if (arguments[x].match(/^prof_type=/) ) { // [1] operation is used on the return value of split(), which is an // array. var prof_type = arguments[x].split("=")[1]; } if (arguments[x].match(/^BIOS_type=/) ) { // [1] operation is used on the return value of split(), which is an // array. var bios_type = arguments[x].split("=")[1]; } if (arguments[x].match(/^trace_level=/) ) { // [1] operation is used on the return value of split(), which is an // array. var trace_level = arguments[x].split("=")[1]; } } /************************************ * Memory Map Information ************************************/ if (hdw_type == "OMAP5") { /* Memory Map for ti.platforms.sdp5430:IPU * * --- External Memory --- * Virtual Physical Size Comment * ------------------------------------------------------------------------ * 0000_4000 ????_???? 5F_C000 ( ~6 MB) EXT_CODE * 8000_0000 ????_???? 20_0000 ( 2 MB) EXT_DATA * 8060_0000 ????_???? 290_0000 ( 41 MB) EXT_HEAP * 9F00_0000 9F00_0000 6_0000 ( 384 kB) TRACE_BUF * 9F06_0000 9F06_0000 1_0000 ( 64 kB) EXC_DATA * 9F07_0000 9F07_0000 2_0000 ( 128 kB) PM_DATA (Power mgmt) */ var sdp5430_ExtMemMapIpu = { EXT_CODE: { name: "EXT_CODE", base: 0x00004000, len: 0x005FC000, space: "code", access: "RWX" }, EXT_DATA: { name: "EXT_DATA", base: 0x80000000, len: 0x00200000, space: "data", access: "RW" }, EXT_HEAP: { name: "EXT_HEAP", base: 0x80200000, len: 0x02900000, space: "data", access: "RW" }, TRACE_BUF: { name: "TRACE_BUF", base: 0x9F000000, len: 0x00060000, space: "data", access: "RW" }, EXC_DATA: { name: "EXC_DATA", base: 0x9F060000, len: 0x00010000, space: "data", access: "RW" }, PM_DATA: { name: "PM_DATA", base: 0x9F070000, len: 0x00020000, space: "data", access: "RWX" } }; Build.platformTable["ti.platforms.sdp5430:IPU"] = { externalMemoryMap: [ [ "EXT_CODE", sdp5430_ExtMemMapIpu.EXT_CODE ], [ "EXT_DATA", sdp5430_ExtMemMapIpu.EXT_DATA ], [ "EXT_HEAP", sdp5430_ExtMemMapIpu.EXT_HEAP ], [ "TRACE_BUF", sdp5430_ExtMemMapIpu.TRACE_BUF ], [ "EXC_DATA", sdp5430_ExtMemMapIpu.EXC_DATA ], [ "PM_DATA", sdp5430_ExtMemMapIpu.PM_DATA ] ], codeMemory: "EXT_CODE", dataMemory: "EXT_DATA", stackMemory: "EXT_DATA", }; } else if (hdw_type == "VAYU") { /* Memory Map for ti.platforms.evmDRA7XX:ipu2 * * --- External Memory --- * Virtual Physical Size Comment * ------------------------------------------------------------------------ * 0000_4000 ????_???? 5F_C000 ( ~6 MB) EXT_CODE * 8000_0000 ????_???? 20_0000 ( 2 MB) EXT_DATA * 8060_0000 ????_???? 290_0000 ( 41 MB) EXT_HEAP * 9F00_0000 9F00_0000 6_0000 ( 384 kB) TRACE_BUF * 9F06_0000 9F06_0000 1_0000 ( 64 kB) EXC_DATA * 9F07_0000 9F07_0000 2_0000 ( 128 kB) PM_DATA (Power mgmt) */ var evmDRA7XX_ExtMemMapIpu2 = { EXT_CODE: { name: "EXT_CODE", base: 0x00004000, len: 0x005FC000, space: "code", access: "RWX" }, EXT_DATA: { name: "EXT_DATA", base: 0x80000000, len: 0x00200000, space: "data", access: "RW" }, EXT_HEAP: { name: "EXT_HEAP", base: 0x80200000, len: 0x02900000, space: "data", access: "RW" }, TRACE_BUF: { name: "TRACE_BUF", base: 0x9F000000, len: 0x00060000, space: "data", access: "RW" }, EXC_DATA: { name: "EXC_DATA", base: 0x9F060000, len: 0x00010000, space: "data", access: "RW" }, PM_DATA: { name: "PM_DATA", base: 0x9F070000, len: 0x00020000, space: "data", access: "RWX" } }; Build.platformTable["ti.platforms.evmDRA7XX:ipu2"] = { externalMemoryMap: [ [ "EXT_CODE", evmDRA7XX_ExtMemMapIpu2.EXT_CODE ], [ "EXT_DATA", evmDRA7XX_ExtMemMapIpu2.EXT_DATA ], [ "EXT_HEAP", evmDRA7XX_ExtMemMapIpu2.EXT_HEAP ], [ "TRACE_BUF", evmDRA7XX_ExtMemMapIpu2.TRACE_BUF ], [ "EXC_DATA", evmDRA7XX_ExtMemMapIpu2.EXC_DATA ], [ "PM_DATA", evmDRA7XX_ExtMemMapIpu2.PM_DATA ] ], codeMemory: "EXT_CODE", dataMemory: "EXT_DATA", stackMemory: "EXT_DATA", }; } var TargetBuild = commonBld.getTargetBuild(arguments); commonOpts += " -DHOST_TYPE=HOST_UNKNOWN " /************************************ * Setup for ipu target ************************************/ var ipu_tgt = xdc.useModule('ti.targets.arm.elf.M4'); ipu_tgt.rootDir = java.lang.System.getenv("TMS470CGTOOLPATH"); ipu_tgt.ccOpts.suffix += " --gcc -D___DSPBIOS___ -DCORE0"; ipu_tgt.ccOpts.suffix += " -ms "; ipu_tgt.ccOpts.suffix += " -pden -pds=48 "; ipu_tgt.ccOpts.suffix += " -pdew "; //Convert warn to err; Supported in 4.9 version //Codecs are built with this. keeping it for now //as all dependent packages need to be rebuilt with this flag which is not possible. //ipu_tgt.ccOpts.suffix += " --wchar_t=32 "; ipu_tgt.ccOpts.suffix += commonOpts; ipu_tgt.lnkOpts.suffix += " -x "; ipu_tgt.lnkOpts.prefix += " --retain=.resource_table"; //ipu_tgt.lnkOpts.prefix += " --zero_init=off "; ipu_tgt.lnkOpts.prefix += " --cinit_compression=off"; ipu_tgt.lnkOpts.prefix += " --diag_suppress=16032 "; //Supress wchar_t warnings ipu_tgt.platforms = [ "ti.platform.omap4430.core0", //0 "ti.platform.omap4430.core1", //1 "ti.platform.omap4430.core0_512", //2 "ti.platform.omap4430.core1_512", //3 "ti.platform.omap54xx.core0", //4 "ti.platform.omap54xx.core1", //5 "ti.platform.omap4430.ipu", //6 "ti.platforms.sdp5430:IPU", //7 "ti.platforms.evmDRA7XX:ipu2", //8 ]; /********** PSI_KPI instrumentation ***********/ if (prof_type == "ENABLE") { var psi_kpi_flag = true print("Profiler enabled"); ipu_tgt.ccOpts.suffix += " -DBUILD_PSI_KPI"; } else { var psi_kpi_flag = false } /********** PSI_KPI instrument. End ***********/ /***************** Tracing ********************/ if(trace_level == 0) { ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=0"; } else if(trace_level == 1) { ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE"; ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=1"; } else if(trace_level == 2) { ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE"; ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=2"; } else if(trace_level == 3) { ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE"; ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=3"; } else if(trace_level >= 4) { ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_ENABLE"; ipu_tgt.ccOpts.suffix += " -DDCE_DEBUG_LEVEL=4"; } /***************** Tracing ********************/ var omap5_zebu = false; var omap5_virtio = false; var build_omap5 = false; var omap5_es20 = false; var build_vayu = false; var hw_OMAP4 = 0; var hw_OMAP5 = 1; var hw_VAYU = 2; var VIRTIO = 0; var ZEBU = 0; var ES10 = 1; var ES20 = 2; var HwType = hw_VAYU; //default vayu var HwVer = ES10; //Default ES1.0 if (bios_type == "SMP") { SMPmode = true; } if (hdw_type == "OMAP5") { build_omap5 = true; HwType = hw_OMAP5; ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5"; if (hw_ver == "VIRTIO") { HwVer = VIRTIO; omap5_virtio = true; ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5_VIRTIO"; } else if (hw_ver == "ZEBU") { HwVer = ZEBU; omap5_zebu = true; ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_OMAP5_ZEBU"; } else if(hw_ver == "ES20") { HwVer = ES20; omap5_es20 = true; ipu_tgt.ccOpts.suffix += " -DOMAP5432_ES20"; } else { HwVer = ES10; ipu_tgt.ccOpts.suffix += " -DOMAP5_ES10"; } if(bios_type == "SMP") { ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP"; ipu_tgt.platform = ipu_tgt.platforms[7]; } else { ipu_tgt.platform = ipu_tgt.platforms[4]; } } else if (hdw_type == "VAYU") { HwType = hw_VAYU; HwVer = ES10; var build_vayu = true; print("Selected Vayu for ES10"); if(bios_type == "SMP") { ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_VAYU"; ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP"; ipu_tgt.ccOpts.suffix += " -DVAYU_ES10"; ipu_tgt.platform = ipu_tgt.platforms[8]; } else { print("VAYU Non-SMP IPU is not supported"); } } else { HWType = hw_OMAP4; var build_omap4 = true; HwVer = ES20; if(bios_type == "SMP") { ipu_tgt.ccOpts.suffix += " -DBUILD_FOR_SMP"; ipu_tgt.platform = ipu_tgt.platforms[6]; } else { ipu_tgt.platform = ipu_tgt.platforms[0]; } } Build.targets = [ ipu_tgt, ]; var Pkg = xdc.module("xdc.bld.PackageContents");