]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
OMAP5: Remove BIOS-side SMP build flag
authorChris Ring <cring@ti.com>
Fri, 1 Mar 2013 21:30:14 +0000 (13:30 -0800)
committerChris Ring <cring@ti.com>
Tue, 5 Mar 2013 15:46:42 +0000 (07:46 -0800)
Always build both SMP and non-SMP libraries.  The intention is to build
all libraries during the package build step, and make getLibs() smart
enough to return the appropriate library depending on the application's
cfg script.

Also includes some minor build script cleanup in that package.

ipc-bios.bld
ipc-bios.mak
packages/ti/ipc/family/omap54xx/package.bld
packages/ti/ipc/family/omap54xx/package.xs
packages/ti/ipc/rpmsg/package.bld
packages/ti/ipc/rpmsg/package.xs
packages/ti/ipc/transports/package.bld
packages/ti/pm/package.bld

index 26908a800f1fd25c176449325f1d6d928696c356..362e7a570e895fc2f57a7d61e74a33247cde1ef7 100644 (file)
@@ -63,7 +63,8 @@
  *     Build       an alias for xdc.om.xdc.bld.BuildEnvironment
  */
 
-var build_smp = java.lang.System.getenv("BUILD_SMP");
+/* for M3-devices only (OMAP5), build using the SMP-enabled platform */
+var build_smp = "1";
 
 /* Common ccopts suffix used for all C6x targets */
 var c6xOpts = " -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -g ";
@@ -130,7 +131,7 @@ for (arg = 0; arg < arguments.length; arg++) {
     target.rootDir = rootDir;
     target.ccOpts.suffix += ccOpts[targetName];
 
-    /* Add appropriate platforms to build for based on target name */    
+    /* Add appropriate platforms to build for based on target name */
     if (targetName.match(/elf\.C674/)) {
         target.platforms = [ "ti.platforms.evmOMAPL138:DSP" ];
     }
index 3799555eeaf19d61fe69557ac53ac8192b25637e..b8220002597629ff3a834710501fc9d67d854b91 100644 (file)
@@ -123,14 +123,12 @@ export XDCPATH
 #XDCOPTIONS=v
 export XDCOPTIONS
 
-BUILD_SMP       ?= 1
-
 #
 # Set XDC executable command
 # Note that XDCBUILDCFG points to the ipc-bios.bld file which uses
 # the arguments specified by XDCARGS
 #
-XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" BUILD_SMP=$(BUILD_SMP) XDCBUILDCFG=./ipc-bios.bld
+XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./ipc-bios.bld
 
 ######################################################
 ## Shouldnt have to modify anything below this line ##
index 10efe6cbe957814ebe6e676641f79b9c5b28e38b..ce888f4d0b726b9efddef0b95ee241f9b4ffc285 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2013-2012, Texas Instruments Incorporated
+ * Copyright (c) 2011-2013, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 /*
  *  ======== package.bld ========
- *
  */
 
-/* explicit references to global objects */
 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
 var Pkg = xdc.useModule('xdc.bld.PackageContents');
-var smpBuild = java.lang.System.getenv("BUILD_SMP");
 
-/* clean lib folder */
-Pkg.generatedFiles.$add("lib/");
-Pkg.libDir = "package/";
+/*
+ * This package distributes its sources in the default release.  This is to
+ * enable better understanding by the customer/field, as well as enable
+ * modification and profiling techniques in the field.
+ */
+Pkg.attrs.exportSrc = true;
+
+Pkg.otherFiles = ["package.bld", "InterruptProxy.h", "InterruptDsp.h",
+        "InterruptIpu.h"];
 
-/* add custom files to all releases */
-Pkg.attrs.exportSrc = false;
-Pkg.attrs.exportCfg = true;
-Pkg.otherFiles = [
-    "InterruptProxy.h",
-];
+/* remove this output directory during a clean */
+Pkg.generatedFiles.$add("lib/");
 
 /* list of libraries to build */
 var libArray = new Array();
-if (smpBuild == "1") {
-    /* rpmsg library for IPU SMP target */
-    libArray.push(
-        {
-            name: "ti.ipc.rpmsg_smp",
-            sources: [
-                "VirtQueue",
-                "InterruptIpu",
-            ],
-            libAttrs: {
-                defs: " -DSMP"
-            },
-            isas: [ "v7M" ],
-        }
-    );
-}
-else {
-    /* rpmsg library for IPU non-SMP target */
-    libArray.push(
-        {
-            name: "ti.ipc.rpmsg",
-            sources: [
-                "VirtQueue",
-                "InterruptIpu",
-                "OffloadM3",
-            ],
-            libAttrs: {
-                defs: " -DM3_ONLY"
-            },
-            isas: [ "v7M" ],
-        }
-    );
-
-    /* rpmsg library for DSP target */
-    libArray.push(
-        {
-            name: "ti.ipc.rpmsg",
-            sources: [
-                "VirtQueue",
-                "InterruptDsp",
-            ],
-            libAttrs: {
-                defs: " -DDSP"
-            },
-            isas: [ "64T" ],
-        }
-    );
-}
 
-/* generate the package libraries */
-/* check if profile specified in XDCARGS */
-/* XDCARGS="... profile=debug ..." */
-var cmdlProf = (" " + arguments.join(" ") + " ").match(/ profile=([^ ]+) /);
-cmdlProf = cmdlProf != null ? cmdlProf[1] : null;
+/* rpmsg library for IPU SMP target */
+libArray.push(
+    {
+        name: "ti.ipc.rpmsg_smp",
+        sources: [
+            "VirtQueue",
+            "InterruptIpu",
+        ],
+        libAttrs: {
+            defs: " -DSMP"
+        },
+        isas: [ "v7M" ],
+    }
+);
+
+/* rpmsg library for IPU non-SMP target */
+libArray.push(
+    {
+        name: "ti.ipc.rpmsg",
+        sources: [
+            "VirtQueue",
+            "InterruptIpu",
+            "OffloadM3",
+        ],
+        libAttrs: {
+            defs: " -DM3_ONLY"
+        },
+        isas: [ "v7M" ],
+    }
+);
+
+/* rpmsg library for DSP target */
+libArray.push(
+    {
+        name: "ti.ipc.rpmsg",
+        sources: [
+            "VirtQueue",
+            "InterruptDsp",
+        ],
+        libAttrs: {
+            defs: " -DDSP"
+        },
+        isas: [ "64T" ],
+    }
+);
+
 
 /* ==== loop over array of libraries ==== */
 for (var i = 0; i < libArray.length; i++) {
@@ -116,19 +107,6 @@ for (var i = 0; i < libArray.length; i++) {
     for (var j = 0; j < Build.targets.length; j++) {
         var targ = Build.targets[j];
 
-        /* skip target if not compatible with source code */
-        if ("icw" in lib) {
-            var skipTarget = true;
-            var targIsaChain = "/" + targ.getISAChain().join("/") + "/";
-            for (var k = 0; k < lib.icw.length; k++) {
-                if (targIsaChain.match("/" + lib.icw[k] + "/")) {
-                    skipTarget = false;
-                    break;
-                }
-            }
-            if (skipTarget) continue;
-        }
-
         /* skip target if it does not generate code for the given isa */
         if ("isas" in lib) {
             var skipTarget = true;
@@ -142,11 +120,6 @@ for (var i = 0; i < libArray.length; i++) {
         /* ==== loop over all profiles ==== */
         for (var profile in targ.profiles) {
 
-            /* skip profile if different than specified on command line */
-            if ((cmdlProf != null) && (profile != cmdlProf)) {
-                continue;
-            }
-
             /* name = lib/profile/name.a+suffix */
             var name = "lib/" + profile + "/" + lib.name;
 
index d549b0ae7e36efa2a12c1954c8369a03c0e3d5b0..f91b6c7851bdcd32f7f004b3d25f8c142df0f715 100644 (file)
  *
  */
 
-/*
- *  ======== init ========
- */
-function init()
-{
-    xdc.loadPackage('ti.pm');
-}
-
 /*
  *  ======== close ========
  */
 function close()
 {
-    Program.exportModule('ti.sysbios.hal.Cache');
-    Program.exportModule('ti.sysbios.knl.Idle');
+    /* bring in modules we use in this package */
+    xdc.useModule('ti.sysbios.knl.Swi');
+    xdc.useModule('ti.sysbios.hal.Cache');
+    xdc.loadPackage('ti.pm');
 }
 
 /*
@@ -57,15 +51,17 @@ function close()
  */
 function getLibs(prog)
 {
-    var suffix;
     var file;
     var libAry = [];
     var profile = this.profile;
     var smp = "";
 
-    suffix = prog.build.target.findSuffix(this);
+    var suffix = prog.build.target.findSuffix(this);
     if (suffix == null) {
-        return "";  /* nothing to contribute */
+        /* no matching lib found in this package, return "" */
+        $trace("Unable to locate a compatible library, returning none.",
+                1, ['getLibs']);
+        return ("");
     }
 
     if (prog.platformName.match(/ipu/)) {
index b5eb5933f18bd2fa3ff7dd4b0b925f922ca3509b..74b5aea0c5f37f606b320d3f9ef94ad30cabce4f 100644 (file)
@@ -35,7 +35,6 @@
 
 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
 var Pkg = xdc.useModule('xdc.bld.PackageContents');
-var smpBuild = java.lang.System.getenv("BUILD_SMP");
 
 Pkg.attrs.exportSrc = true;
 
@@ -47,46 +46,60 @@ var SRCS = ["MessageQCopy.c", "NameMap.c"];
 /* remove this output directory during a clean */
 Pkg.generatedFiles.$add("lib/");
 
+var myCopts = "";
 
 for (var i = 0; i < Build.targets.length; i++) {
     var targ = Build.targets[i];
-    var isaDefs = "";
     var name = Pkg.name;
 
-    print("targ.isa: " + targ.isa);
-    print("smpBuild: " + smpBuild);
-
-    /* Yuck, yuck, yuck! */
-    if (targ.isa == "674") {
-        isaDefs = "-DOMAPL138";
-    } else if (targ.isa == "66") {
-        /* TBD: Only one of Appleton or Kepler can build for now: */
-       isaDefs = "-DTCI6638";
-       //isaDefs = "-DTCI6614";
-    } else if (targ.isa == "v7M") {
-        if (smpBuild == "1") {
-            isaDefs = "-DOMAP5 -DSMP";
-            name = name + "_smp";
-        }
-        else {
-            isaDefs = "-DOMAP5 -DDM3_ONLY";
-        }
-    } else if (targ.isa == "64T" && smpBuild == 0) {
-        isaDefs = "-DOMAP5 -DDSP";
+    if (targ.$name.match(/^ti\.targets\.*/)) {
+        myCopts = "--gcc";  /* Rpmsg.h requires gcc-isms */
     } else {
-        continue;
+        myCopts = "";
     }
 
-    print("name: " + name);
-    print("isaDefs: " + isaDefs);
-
     /* Build for all profiles */
     for (var profile in targ.profiles) {
 
-       Pkg.addLibrary("lib/" + profile + "/" + name, targ, {
-           profile: profile,
-           copts: "--gcc",   /* b/c Rpmsg.h requires gcc-isms */
-           defs: isaDefs
-       }).addObjects(SRCS);
+        /* Build a platform-specific library */
+        if (targ.isa == "674") {
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_omapl138", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DOMAPL138"
+            }).addObjects(SRCS);
+        } else if (targ.isa == "66") {
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_tci6638", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DTCI6638"
+            }).addObjects(SRCS);
+
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_tci6614", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DTCI6614"
+            }).addObjects(SRCS);
+        } else if (targ.isa == "v7M") {
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_omap5_smp", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DOMAP5 -DSMP"
+            }).addObjects(SRCS);
+
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_omap5", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DOMAP5 -DDM3_ONLY"
+            }).addObjects(SRCS);
+        } else if (targ.isa == "64T") {
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_omap5", targ, {
+                profile: profile,
+                copts: myCopts,
+                defs: "-DOMAP5 -DDSP"
+            }).addObjects(SRCS);
+        } else {
+            continue;
+        }
     }
 }
index 57510c699909838616007b0c1f0562898d6f8a43..a189ace13b55218601ee5e5741d3cde1c18b7128 100644 (file)
@@ -49,9 +49,11 @@ function close()
  */
 function getLibs(prog)
 {
-    var suffix = prog.build.target.findSuffix(this);
+    var device = prog.cpu.deviceName;
+    var platform = "";
     var smp = "";
 
+    var suffix = prog.build.target.findSuffix(this);
     if (suffix == null) {
         /* no matching lib found in this package, return "" */
         $trace("Unable to locate a compatible library, returning none.",
@@ -63,8 +65,28 @@ function getLibs(prog)
         smp = "_smp";
     }
 
+
+    switch (device) {
+        case "OMAP4430":
+            /* OMAP5 */
+            platform = "omap5";
+            break;
+
+        case "OMAPL138":
+            platform = "omapl138";
+            break;
+
+        case "Kepler":
+            platform = "tci6638";
+            break;
+
+        default:
+            throw ("Unspported device: " + device);
+            break;
+    }
+
     /* the location of the libraries are in lib/<profile>/* */
-    var name = this.$name + smp + ".a" + suffix;
+    var name = this.$name + "_" + platform + smp + ".a" + suffix;
     var lib = "lib/" + this.profile + "/" + name;
 
 
index 1535e9d0b4c10dbc165e958bf12394c0005a9fe3..19b1593b0ff9411e8349cd2ea497f38df5d146b1 100644 (file)
@@ -50,16 +50,23 @@ var SRCS = ["TransportVirtioSetup.c", "TransportVirtio.c"];
 /* remove this output directory during a clean */
 Pkg.generatedFiles.$add("lib/");
 
+var myCopts = "";
+
 for (var i = 0; i < Build.targets.length; i++) {
     var targ = Build.targets[i];
 
+    if (targ.$name.match(/^ti\.targets\.*/)) {
+        myCopts = "--gcc";  /* Rpmsg.h requires gcc-isms */
+    } else {
+        myCopts = "";
+    }
 
     /* Build for all profiles */
     for (var profile in targ.profiles) {
 
         Pkg.addLibrary("lib/" + profile + "/" + Pkg.name, targ, {
             profile: profile,
-            copts: "--gcc"   /* b/c Rpmsg.h requires gcc-isms */
+            copts: myCopts
         }).addObjects(SRCS);
     }
 }
index bb9268cfd75065832977963eb8f4cff1e8413340..2e6950cc21f961f69bd44f2f7549aa802fbb5817 100644 (file)
@@ -38,7 +38,6 @@
 /* explicit references to global objects */
 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
 var Pkg = xdc.useModule('xdc.bld.PackageContents');
-var smpBuild = java.lang.System.getenv("BUILD_SMP");
 
 /* clean lib folder */
 Pkg.generatedFiles.$add("lib/");
@@ -53,50 +52,42 @@ Pkg.otherFiles = [
 
 /* list of libraries to build */
 var libArray = new Array();
-if (smpBuild == "1") {
-    /* pm library for IPU SMP target */
-    libArray.push(
-        {
-            name: "ti.pm_smp",
-            sources: [
-                "IpcPower",
-            ],
-            libAttrs: {
-                defs: " -DSMP"
-            },
-            isas: [ "v7M" ],
-        }
-    );
-}
-else {
-    /* pm library for IPU non-SMP target */
-    libArray.push(
-        {
-            name: "ti.pm",
-            sources: [
-                "IpcPower",
-            ],
-            isas: [ "v7M" ],
-        }
-    );
-
-    /* pm library for DSP target */
-    libArray.push(
-        {
-            name: "ti.pm",
-            sources: [
-                "IpcPowerDsp",
-            ],
-            isas: [ "64T" ],
-        }
-    );
-}
 
-/* generate the package libraries */
-/* check if profile specified in XDCARGS */
-/* XDCARGS="... profile=debug ..." */
-var cmdlProf = (" " + arguments.join(" ") + " ").match(/ profile=([^ ]+) /);
-cmdlProf = cmdlProf != null ? cmdlProf[1] : null;
+/* pm library for IPU SMP target */
+libArray.push(
+    {
+        name: "ti.pm_smp",
+        sources: [
+            "IpcPower",
+        ],
+        libAttrs: {
+            defs: " -DSMP"
+        },
+        isas: [ "v7M" ],
+    }
+);
+
+/* pm library for IPU non-SMP target */
+libArray.push(
+    {
+        name: "ti.pm",
+        sources: [
+            "IpcPower",
+        ],
+        isas: [ "v7M" ],
+    }
+);
+
+/* pm library for DSP target */
+libArray.push(
+    {
+        name: "ti.pm",
+        sources: [
+            "IpcPowerDsp",
+        ],
+        isas: [ "64T" ],
+    }
+);
 
 /* ==== loop over array of libraries ==== */
 for (var i = 0; i < libArray.length; i++) {
@@ -106,19 +97,6 @@ for (var i = 0; i < libArray.length; i++) {
     for (var j = 0; j < Build.targets.length; j++) {
         var targ = Build.targets[j];
 
-        /* skip target if not compatible with source code */
-        if ("icw" in lib) {
-            var skipTarget = true;
-            var targIsaChain = "/" + targ.getISAChain().join("/") + "/";
-            for (var k = 0; k < lib.icw.length; k++) {
-                if (targIsaChain.match("/" + lib.icw[k] + "/")) {
-                    skipTarget = false;
-                    break;
-                }
-            }
-            if (skipTarget) continue;
-        }
-
         /* skip target if it does not generate code for the given isa */
         if ("isas" in lib) {
             var skipTarget = true;
@@ -132,11 +110,6 @@ for (var i = 0; i < libArray.length; i++) {
         /* ==== loop over all profiles ==== */
         for (var profile in targ.profiles) {
 
-            /* skip profile if different than specified on command line */
-            if ((cmdlProf != null) && (profile != cmdlProf)) {
-                continue;
-            }
-
             /* name = lib/profile/name.a+suffix */
             var name = "lib/" + profile + "/" + lib.name;