From: Chris Ring Date: Mon, 29 Apr 2013 19:30:53 +0000 (-0700) Subject: Build: Fix SMP support for platforms without 'ipu' in the name X-Git-Tag: 3.00.00.17_eng~19 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=279ba06bba34b6ba8aa132dc0b45dd011ed06500 Build: Fix SMP support for platforms without 'ipu' in the name A few SMP-aware packages only support platforms with the name 'ipu' in them. Remove this explicit platform name check and replace it with a more correct check (e.g. by detecting BIOS.smpEnabled, or using the platform's .deviceName field - which doesn't vary across platform names). --- diff --git a/packages/ti/ipc/family/omap54xx/package.xs b/packages/ti/ipc/family/omap54xx/package.xs index 5ab1c20..0334cca 100644 --- a/packages/ti/ipc/family/omap54xx/package.xs +++ b/packages/ti/ipc/family/omap54xx/package.xs @@ -71,7 +71,8 @@ function getLibs(prog) return (""); } - if (prog.platformName.match(/ipu/)) { + var BIOS = xdc.module('ti.sysbios.BIOS'); + if (BIOS.smpEnabled) { smp = "_smp"; } diff --git a/packages/ti/ipc/remoteproc/Resource.xdt b/packages/ti/ipc/remoteproc/Resource.xdt index 3b3ab58..709c4d6 100644 --- a/packages/ti/ipc/remoteproc/Resource.xdt +++ b/packages/ti/ipc/remoteproc/Resource.xdt @@ -40,20 +40,29 @@ %if (prog.platformName.match(/OMAPL138/)) { #include %} -%if (prog.platformName.match(/evm6614/)) { +%else if (prog.platformName.match(/evm6614/)) { #include //#include // Test with v3.3 Linux. %} -%if (prog.platformName.match(/Kepler/) || +%else if (prog.platformName.match(/Kepler/) || % prog.platformName.match(/TCI6638/)) { #include %} -%if (prog.platformName.match(/omap54xx\.ipu/)) { +%else if (prog.cpu.deviceName.match(/^OMAP5430$/)) { +% if (prog.cpu.attrs.cpuCore.match(/^CM4$/)) { #define OMAP5 #include -%} -%if (prog.platformName.match(/omap54xx\.dsp/)) { +% } else if (prog.cpu.attrs.cpuCore.match(/^64T$/)) { #include +% } +% else { +% print("ti.ipc.remoteproc.Resource.xdt - unable to provide OMAP5 " + +% "resource table (" + prog.cpu.attrs.cpuCore + ")"); +% } +%} +%else { +% print("ti.ipc.remoteproc.Resource.xdt - unable to provide resource table " + +% "(" + prog.cpu.deviceName + ", " + prog.cpu.attrs.cpuCore + ")"); %} Void ti_ipc_remoteproc_Resource_init__I() diff --git a/packages/ti/ipc/tests/ping_rpmsg.cfg b/packages/ti/ipc/tests/ping_rpmsg.cfg index 84063fa..48369c4 100644 --- a/packages/ti/ipc/tests/ping_rpmsg.cfg +++ b/packages/ti/ipc/tests/ping_rpmsg.cfg @@ -33,8 +33,9 @@ //print ("Program.cpu.deviceName = " + Program.cpu.deviceName); //print ("Program.platformName = " + Program.platformName); -/* This will match for omap5 SMP only: */ -if (Program.platformName.match(/ipu/)) { +/* This will match for omap5 IPU only: */ +if (Program.cpu.deviceName.match(/^OMAP5430$/) && + Program.cpu.attrs.cpuCore.match(/^CM4$/)) { var Task = xdc.useModule('ti.sysbios.knl.Task'); var params = new Task.Params; params.instance.name = "ping"; diff --git a/packages/ti/ipc/tests/rpmsg_transport.cfg b/packages/ti/ipc/tests/rpmsg_transport.cfg index b107208..f658c25 100644 --- a/packages/ti/ipc/tests/rpmsg_transport.cfg +++ b/packages/ti/ipc/tests/rpmsg_transport.cfg @@ -34,8 +34,9 @@ //print ("Program.cpu.deviceName = " + Program.cpu.deviceName); //print ("Program.platformName = " + Program.platformName); -/* This will match for omap5 SMP only: */ -if (Program.platformName.match(/ipu/)) { +/* This will match for omap5 IPU only: */ +if (Program.cpu.deviceName.match(/^OMAP5430$/) && + Program.cpu.attrs.cpuCore.match(/^CM4$/)) { /* This initializes the MessageQ Transport RPMSG stack: */ xdc.loadPackage('ti.ipc.ipcmgr'); var BIOS = xdc.useModule('ti.sysbios.BIOS'); diff --git a/packages/ti/srvmgr/package.xs b/packages/ti/srvmgr/package.xs index 051817f..79db6f0 100644 --- a/packages/ti/srvmgr/package.xs +++ b/packages/ti/srvmgr/package.xs @@ -59,7 +59,8 @@ function getLibs(prog) return ""; /* nothing to contribute */ } - if (prog.platformName.match(/ipu/)) { + BIOS = xdc.module('ti.sysbios.BIOS'); + if ((BIOS != undefined) && BIOS.smpEnabled) { smp = "_smp"; } diff --git a/packages/ti/trace/SysMin.xs b/packages/ti/trace/SysMin.xs index 60ce92b..e24a9c8 100644 --- a/packages/ti/trace/SysMin.xs +++ b/packages/ti/trace/SysMin.xs @@ -34,7 +34,7 @@ */ var SysMin = this; -var Core = null; +var Core = undefined; /* * ======== module$static$init ======== @@ -42,7 +42,15 @@ var Core = null; function module$static$init(obj, params) { var segname = Program.sectMap[".tracebuf"]; + if (segname == undefined) { + this.$logError(".tracebuf section not found in Program.sectMap", this); + } + var segment = Program.cpu.memoryMap[segname]; + if (segment == undefined) { + this.$logError(".tracebuf section found, but not in " + + "Program.cpu.memoryMap", this); + } if (params.bufSize > segment.len) { this.$logError("bufSize 0x" + Number(params.bufSize).toString(16) + @@ -56,7 +64,7 @@ function module$static$init(obj, params) + " = 0x" + Number(this.LINEBUFSIZE).toString(16), this); } - if (Program.platformName.match(/ipu/)) { + if (Core != undefined) { obj.lineBuffers.length = Core.numCores; } else { @@ -89,9 +97,7 @@ function module$static$init(obj, params) */ function module$use(obj, params) { - if (Program.platformName.match(/ipu/)) { - Core = xdc.module("ti.sysbios.hal.Core"); - } + Core = xdc.useModule("ti.sysbios.hal.Core"); } /* diff --git a/packages/ti/trace/package.xs b/packages/ti/trace/package.xs index ef39be8..2569eae 100644 --- a/packages/ti/trace/package.xs +++ b/packages/ti/trace/package.xs @@ -51,7 +51,8 @@ function getLibs(prog) return ""; /* nothing to contribute */ } - if (prog.platformName.match(/ipu/)) { + BIOS = xdc.module('ti.sysbios.BIOS'); + if ((BIOS != undefined) && BIOS.smpEnabled) { smp = "_smp"; }