]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/mcbsp-lld.git/blobdiff - config.bld
PRSDK-3732 Update MCBSP count to prevent memory corruption.
[keystone-rtos/mcbsp-lld.git] / config.bld
index 3ba2466d5041b92ac86c8198d53d6c46d2f3347f..4e07c8072acac31eb5317401771ae6cdd125c3a0 100644 (file)
  *****************************************************************************/
 
 /* Get the Tools Base directory from the Environment Variable. */
-var toolsBaseDir = java.lang.System.getenv("XDCCGROOT");
+var toolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var m4ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+var a9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
+var arm9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_ARM9");
+var a8ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+/* Get the extended debug flags */
+var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
+
+/* Get the extended debug flags for A15 */
+var extDbgFlags_a15 = java.lang.System.getenv("EXTDBGFLAGS_A15");
+
+/* Get the extended debug flags for A8 */
+var extDbgFlags_a8 = java.lang.System.getenv("EXTDBGFLAGS_A8");
+
+/* Get the extended debug flags for A9 */
+var extDbgFlags_a9 = java.lang.System.getenv("EXTDBGFLAGS_A9");
+
+/* Get the extended debug flags for ARM9 */
+var extDbgFlags_arm9 = java.lang.System.getenv("EXTDBGFLAGS_ARM9");
+/* Get the extended debug flags for M4 */
+var extDbgFlags_m4 = java.lang.System.getenv("EXTDBGFLAGS_M4");
 
 /* Get the base directory for the MCBSP Driver Package */
 var mcbspDriverPath = new java.io.File(".//").getPath();
@@ -20,69 +42,191 @@ var mcbspDriverPath = new java.io.File(".//").getPath();
 /* Read the part number from the environment variable. */
 var mcbspLLDPartNumber = java.lang.System.getenv("PARTNO");
 
+/* Get the base directory for the hyplnk LLD Package */
+var mcbsplldPath = new java.io.File(".//").getPath();
+/* Include Path */
+var mcbsplldIncPath = " -i" + mcbsplldPath;
 /* Configure the MCBSP Release Version Information */
-var mcbspDriverReleaseVersion = [01,00,00,02];
+var mcbspDriverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
 
 /* C66 ELF compiler configuration for Little Endian Mode. */
 var C66LE           = xdc.useModule('ti.targets.elf.C66');
 C66LE.rootDir       = toolsBaseDir;
 C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";
+if(extDbgFlags)     
+    C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags; 
 
 /* C6740 elf compiler configuration for Little Endian Mode. */
-var C67LE           = xdc.useModule('ti.targets.elf.C674');
-C67LE.rootDir       = toolsBaseDir;
-C67LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";
+var C674LE           = xdc.useModule('ti.targets.elf.C674');
+C674LE.rootDir       = toolsBaseDir;
+C674LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";
+if(extDbgFlags)     
+    C674LE.ccOpts.prefix = C674LE.ccOpts.prefix + " " + extDbgFlags; 
 
 /* C66 ELF compiler configuration for Big Endian Mode. */
 var C66BE           = xdc.useModule('ti.targets.elf.C66_big_endian');
 C66BE.rootDir       = toolsBaseDir;
 C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
+if(extDbgFlags)     
+    C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
+
+/* C674 ELF compiler configuration for Big Endian Mode. */
+var C674BE           = xdc.useModule('ti.targets.elf.C674_big_endian');
+C674BE.rootDir       = toolsBaseDir;
+C674BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
+if(extDbgFlags)     
+    C674BE.ccOpts.prefix = C674BE.ccOpts.prefix + " " + extDbgFlags;
 
-/* Check if we need to run the STATIC Analysis or not? */
-var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
+/* ARMv7 A15 compiler configuration */
+var A15LE            = xdc.useModule('gnu.targets.arm.A15F');
+A15LE.rootDir        = a15ToolsBaseDir;
+A15LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a15)     
+    A15LE.ccOpts.prefix = A15LE.ccOpts.prefix + " " + extDbgFlags_a15; 
+    
+/* ARMv7 A9 compiler configuration */
+var A9LE            = xdc.useModule('gnu.targets.arm.A9F');
+A9LE.rootDir        = a9ToolsBaseDir;
+A9LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a9 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a9)     
+    A9LE.ccOpts.prefix = A9LE.ccOpts.prefix + " " + extDbgFlags_a9; 
+
+/* ARMv5 ARM9 compiler configuration */
+var ARM9LE            = xdc.useModule('ti.targets.arm.elf.Arm9');
+ARM9LE.rootDir        = arm9ToolsBaseDir;
+ARM9LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=arm926ej-s -msoft-float -mfloat-abi=soft -march=armv5te -marm -DDRA7xx -Dxdc_target_types__=gnu/targets/arm/std.h -Dxdc_target_name__=Arm9 -gstrict-dwarf -Wall -D__ARMv5 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_arm9)     
+    ARM9LE.ccOpts.prefix = ARM9LE.ccOpts.prefix + " " + extDbgFlags_arm9; 
+       
+/* ARMv7 A8 compiler configuration */
+var A8LE            = xdc.useModule('gnu.targets.arm.A8F');
+A8LE.rootDir        = a8ToolsBaseDir;
+A8LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a8 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a8)     
+    A8LE.ccOpts.prefix = A8LE.ccOpts.prefix + " " + extDbgFlags_a8; 
+
+/* M4 ELF compiler configuration for Little Endian Mode. */
+var M4LE            = xdc.useModule('ti.targets.arm.elf.M4');
+M4LE.rootDir        = m4ToolsBaseDir;
+M4LE.ccOpts.prefix  = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD";
+if(extDbgFlags_m4)
+    M4LE.ccOpts.prefix = M4LE.ccOpts.prefix + " " + extDbgFlags_m4; 
 
-/* Setup the Coverity Filters to perform Static Analysis. */
-if (coverityAnalysis == "ON") {
-    var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH");
-    var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg";
+/* device name (k2?) is inserted between first an second element of this
+   list to construct device file name for each device */
+var deviceConstruct = [ "device/", "/src/device_mcbsp_loopback.c" ];
 
-    var coverityFilter = [
+/* Create the SoC List  */
+var socs = { 
+    /* device independent libraries */
+    all :
     {
-        moduleName: "tisb.coverity.filters.Coverity",
-        params: {
-            cfgDir:  cfgBase,  // The Coverity configuration file directory
-            rootDir: coverityInstallPath,
-            outDir: xdc.csd() + "cov_out",
-            analyzeLibs: true
-        }
+        /* Build this library */
+        build: "true",
+        /* SoC lib disabled as this is device independent lib */
+        socDevLib: "false",
+        /* Library options */
+        copts: "",
+        /* target lists, kept blank now, would be updated based on argument lists */
+        targets: []
+    },
+    k2g :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains k2g */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DDEVICE_K2G -DSOC_K2G",
+        /* target list */
+        targets: [ C66LE, C66BE ]
     },
-    ];
+       omapl138 :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains omapl138 */
+        build: "false",
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_OMAPL138",
+       /* target list */
+       targets: [ C674LE ]
+    },
+    c6657 :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains c6657 */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DSOC_C6657",
+        /* target list */
+        targets: [ C66LE, C66BE ]
+    },
+};
 
-    /* Run the coverity filters on the LE Build only. */
-    C66LE.profiles["release"].filters = coverityFilter;
+/**************************************************************************
+ * FUNCTION NAME : merge
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to merge two arrarys
+ **************************************************************************/
+function merge() {
+    var args = arguments;
+    var hash = {};
+    var arr = [];
+    for (var i = 0; i < args.length; i++) {
+       for (var j = 0; j < args[i].length; j++) {
+         if (hash[args[i][j]] !== true) {
+           arr[arr.length] = args[i][j];
+           hash[args[i][j]] = true;
+         }
+       }
+     }
+    return arr;
 }
 
-/* Check if we need to create the Makefiles? */
-var miniBuild = java.lang.System.getenv("MINI_PACKAGE");
-if (miniBuild == "ON")
+/* Grab input from XDCARGS */
+var buildArguments  = [];
+
+/* Construct the build arguments */
+for (var tmp=0; arguments[tmp] != undefined; tmp++)
 {
-    var makeC66LEFilter = {
-        moduleName: "build.filter.Make",
-        params: {
-          makefileName: "simpleC66LE.mak",
+
+    /* If no arguments are provided, override for building all */
+    if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )
+        buildArguments[buildArguments.length++] = "all";
+    else
+        buildArguments[buildArguments.length++] = arguments[tmp];
+}
+
+/* Build targets on this build */
+var build_targets = [];
+var soc_names = Object.keys(socs);
+
+for (var i=0; i < buildArguments.length; i++ ) {
+    /* Build it for all targets */
+    if (buildArguments[i] == "all") {
+        for (var j = 0; j < soc_names.length; j++)  {
+            build_targets = merge (build_targets.slice(0), socs[soc_names[j]].targets.slice(0));
+            /* Set build to "true" for that SoC */
+            socs[soc_names[j]].build = "true";
         }
-    };
-    C66LE.profiles["release"].filters[C66LE.profiles["release"].filters.length++] = makeC66LEFilter;
-    
-    var makeC66BEFilter = {
-        moduleName: "build.filter.Make",
-        params: {
-          makefileName: "simpleC66BE.mak",
+    }
+    else {
+        /* Skip the first argument, which is ./config.bld to get to next SoCs */
+        if (i == 0) continue;          
+        /* Set that build to true if it is found in supported build socs */
+        for (j = 0; j < soc_names.length; j++) {
+            if (buildArguments[i] == soc_names[j]) {
+                socs[buildArguments[i]].build = "true";
+                build_targets = merge (build_targets.slice(0), socs[buildArguments[i]].targets.slice(0));
+                break;
+            }
         }
-    }; 
-    C66BE.profiles["release"].filters[C66BE.profiles["release"].filters.length++] = makeC66BEFilter;
+    }   
 }
 
-/* List all the build targets here. */
-Build.targets = [ C67LE ];
-
+/* Update the Build target generated list */
+socs["all"].targets = build_targets; 
+Build.targets   = build_targets;