]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - ipc-bios.bld
Merge recent 3.00 changes into 3.10
[ipc/ipcdev.git] / ipc-bios.bld
index 6f526c7b866be2ac36b25857a9f37a406c18daf9..b2e455f19c6c1bc86f7f7e7abc7cac45f6eab30b 100644 (file)
  *
  *  These settings may be a function of the following global variables:
  *
- *     environment a hash table of environment strings
+ *      environment a hash table of environment strings
  *
- *     arguments   an array of string arguments to the _config.bld script
- *                 initialized as follows:
- *                     arguments[0] - the file name of the _config.bld script
- *                     arguments[1] - the first argument specified in XDCARGS
- *                         :
- *                     arguments[n] - the n'th argument in XDCARGS
+ *      arguments   an array of string arguments to the script
+ *                  initialized as follows:
+ *                      arguments[0] - the file name of the script
+ *                      arguments[1] - the first argument specified in XDCARGS
+ *                          :
+ *                      arguments[n] - the n'th argument in XDCARGS
  *
- *     Build       an alias for xdc.om.xdc.bld.BuildEnvironment
+ *      Build       an alias for xdc.om.xdc.bld.BuildEnvironment
  */
 
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
+
 /* Common ccopts suffix used for all C6x targets */
 var c6xOpts = " -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -g ";
 
@@ -85,7 +88,7 @@ var ccOpts = {
 
     "ti.targets.elf.C64P"             : c6xOpts,
     "ti.targets.elf.C64P_big_endian"  : c6xOpts,
-    "ti.targets.elf.C64T"             : " -mi10 -mo -pds=71",
+    "ti.targets.elf.C64T"             : c6xOpts,
     "ti.targets.elf.C66"              : c6xOpts,
     "ti.targets.elf.C66_big_endian"   : c6xOpts,
     "ti.targets.elf.C674"             : c6xOpts,
@@ -104,72 +107,135 @@ var ccOpts = {
     "gnu.targets.arm.A15F"            : " -g "
 };
 
-/* Enable building SMP-BIOS enabled libraries for targets that support it */
-xdc.module("ti.targets.arm.elf.M3").profiles["smp"] =
-        xdc.module("ti.targets.arm.elf.M3").profiles["debug"];
-xdc.module("ti.targets.arm.elf.M4").profiles["smp"] =
-        xdc.module("ti.targets.arm.elf.M4").profiles["debug"];
+var lnkOpts = {
+    "ti.targets.elf.C66"              : " --cinit_compression=off",
+    "ti.targets.arm.elf.M4"           : " --retain=.resource_table" +
+                                        " --cinit_compression=off"
+};
+
+var platform = "";
+var smpEnabled = true;
 
 /* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
 for (arg = 0; arg < arguments.length; arg++) {
+    /* split each arg into its '+' separated parts */
+    var configParts = arguments[arg].split(";");
+    // print("arg " + arg + " has " + configParts.length + " parts");
+
+    /* if "known args come in, filter them... else they're targets */
+    if (configParts[0].split("=")[0] == "PLATFORM") {
+        // print("FOUND PLATFORM ARG - " + configParts[0]);
+        platform = configParts[0].split("=")[1];
+        continue;
+    }
+    else if (configParts[0].split("=")[0] == "BIOS_SMPENABLED") {
+        // print("FOUND SMP_ENABLED ARG - " + configParts[0]);
+        smpEnabled = configParts[0].split("=")[1].match(/^1$/);
+        continue;
+    }
     /*
      * Get the compiler's installation directory.
      * For "ti.targets.elf.C674=/vendors/c6x/7.2.0", we get "/vendors/c6x/7.2.0"
      */
-    var targetName = arguments[arg].split("=")[0];
-    var rootDir = arguments[arg].split("=")[1];
+    var targetName = configParts[0].split("=")[0];
+    var rootDir = configParts[0].split("=")[1];
 
     /* only build for the specified compilers */
     if (rootDir == "" || rootDir == undefined) {
         continue;
     }
 
+//    print("Building '" + targetName + "' using '" + rootDir + "' ...");
+
     var target = xdc.useModule(targetName);
     target.rootDir = rootDir;
-    target.ccOpts.suffix += ccOpts[targetName];
+    if (ccOpts[targetName] != undefined) {
+        target.ccOpts.suffix += ccOpts[targetName];
+    }
+    if (lnkOpts[targetName] != undefined) {
+        target.lnkOpts.suffix += lnkOpts[targetName];
+    }
+
+    /* for all the other parts, assign target.<left> = <right> */
+    for (var i = 1; i < configParts.length; i++) {
+        var modCfgParam = configParts[i].split("=")[0];
+        var modCfgValue = configParts[i].split("=")[1];
+        var modCfgIndex = modCfgParam.split(".");
+        var element = target;
+
+//        print("Configuring target." + modCfgParam + " = " + modCfgValue);
+
+        for (j = 0; j < (modCfgIndex.length -1); j++) {
+                element = element[modCfgIndex[j]];
+        }
+        element[modCfgIndex[j]] = modCfgValue;
+    }
 
     /* Add appropriate platforms to build for based on target name */
     if (targetName.match(/elf\.C674/)) {
-        target.platforms = [ "ti.platforms.evmOMAPL138:DSP" ];
+        if (platform == 'omapl138') {
+            target.platforms.$add("ti.platforms.evmOMAPL138:DSP");
+        }
     }
 
-    if (targetName.match(/elf\.C66/)) {
-        target.lnkOpts.suffix += " -cr";
-        target.platforms = [
-            //"ti.platforms.simKepler"
-            //"ti.platforms.evm6614:DSP"
-            "ti.platforms.evmTCI6638K2K"
-        ];
+    if (targetName.match(/elf\.C66$/)) {
+        switch (platform) {
+            case 'tci6636':
+                target.platforms.$add("ti.platforms.evmTCI6636K2H");
+                break;
+
+            case 'tci6638':
+                target.platforms.$add("ti.platforms.evmTCI6638K2K");
+                break;
+
+            case 'dra7xx':
+                target.platforms.$add("ti.platforms.evmDRA7XX:dsp1");
+                target.platforms.$add("ti.platforms.evmDRA7XX:dsp2");
+                break;
+
+            default:
+                print("Unknown platform, skipping " + platform);
+                break;
+        }
     }
 
     if (targetName.match(/elf\.C64T/)) {
-        target.lnkOpts.prefix += " -e=ti_sysbios_family_c64p_Hwi0";
-
-        target.platforms = [
-            "ti.platform.omap54xx.dsp",
-        ];
+        if (platform == 'omap54xx_smp') {
+            target.platforms.$add("ti.platforms.sdp5430:DSP");
+        }
     }
 
-    /*
-     * TODO: for now, continue to support OMAP5 for M3 targets until all users
-     * migrate to the new OMAP5-based M4 platform.  Eventually remove omap54xx
-     * from the M3 target.platforms[] array.
-     */
-    if (targetName.match(/elf\.M(3|4)$/)) {
-        target.lnkOpts.prefix += " --retain=.resource_table";
-        target.lnkOpts.prefix += " --cinit_compression=off";
+    if (targetName.match(/elf\.M4$/)) {
+        switch (platform) {
+            case 'omap54xx_smp':
+                target.platforms.$add("ti.platforms.sdp5430:IPU");
+                break;
 
-        target.platforms =  [
-            "ti.platform.omap54xx.ipu",
-        ];
+            case 'dra7xx':
+                target.platforms.$add("ti.platforms.evmDRA7XX:ipu2");
+                target.platforms.$add("ti.platforms.evmDRA7XX:ipu1");
+                break;
+
+            default:
+                print("Unknown platform, skipping " + platform);
+                break;
+        }
     }
 
     Build.targets.$add(target);
 }
 
+if (smpEnabled) {
+    /* Enable building SMP-BIOS enabled libraries for targets that support it */
+    if (Pkg.name.match(/^ti\.sdo\.(ipc|utils)/)) {
+        xdc.module("ti.targets.arm.elf.M3").profiles["smp"] =
+                xdc.module("ti.targets.arm.elf.M3").profiles["debug"];
+        xdc.module("ti.targets.arm.elf.M4").profiles["smp"] =
+                xdc.module("ti.targets.arm.elf.M4").profiles["debug"];
+    }
+}
 
 /* lib/ is a generated directory that 'xdc clean' should remove */
-var Pkg = xdc.useModule('xdc.bld.PackageContents');
 Pkg.generatedFiles.$add("lib/");
 
 /*