summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9472831)
raw | patch | inline | side by side (parent: 9472831)
author | Ramsey Harris <ramsey@ti.com> | |
Tue, 3 Feb 2015 16:29:37 +0000 (08:29 -0800) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Wed, 4 Feb 2015 19:04:35 +0000 (11:04 -0800) |
Added segmentSize to MultiProcSetup to define the number of
processors on the device. Needed for sending interrupts to
processors in a different cluster but still on the local device.
Added cluster awareness. Added cluster support to the tci6638
package. Cleaned up Log_print statements. Replaced interface
IInterrupt references with Interrupt module references.
processors on the device. Needed for sending interrupts to
processors in a different cluster but still on the local device.
Added cluster awareness. Added cluster support to the tci6638
package. Cleaned up Log_print statements. Replaced interface
IInterrupt references with Interrupt module references.
diff --git a/packages/ti/ipc/family/tci6638/Interrupt.c b/packages/ti/ipc/family/tci6638/Interrupt.c
index 600bddb19fd8b43a8de460d33e05f1b2c222676f..fe4f67e3c7cdb8fd50bd4f318c2e58dbe9ab62db 100644 (file)
/*
- * Copyright (c) 2013-2014, Texas Instruments Incorporated
+ * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <ti/sysbios/family/c64p/Hwi.h>
+#include <ti/sdo/utils/_MultiProc.h>
#include <ti/ipc/MultiProc.h>
#include <ti/sdo/ipc/notifyDrivers/IInterrupt.h>
#define MAP_TO_BITPOS(intId) \
(intId == Interrupt_SRCS_BITPOS_CORE0 ? (intId + DNUM) : intId)
-/*
- * Map remoteProcId to CORE ID [0-3]
- * NOTE: This assumes that HOST is at MultiProcId == 0, and CORE0 at 1i
+/* Map procId to coreId (DNUM)
+ *
+ * NOTE: This assumes HOST clusterId is 0, CORE0 clusterId is 1, etc.
*/
-#define MAP_RPROCID_TO_COREID(rProcId) (rProcId-1)
+#define MAP_RPROCID_TO_COREID(procId) \
+ ((procId) - Interrupt_module->clusterId - 1)
#define MAP_RPROCID_TO_SRCC(rProcId, intId) \
- (intId == Interrupt_SRCS_BITPOS_CORE0 ? \
- (intId + (rProcId-1)) : intId)
+ (intId == Interrupt_SRCS_BITPOS_CORE0 ? \
+ (intId + MAP_RPROCID_TO_COREID(rProcId)) : intId)
+
/*
*************************************************************************
* Module functions
volatile UInt32 *kick0 = (volatile UInt32 *)Interrupt_KICK0;
volatile UInt32 *kick1 = (volatile UInt32 *)Interrupt_KICK1;
UInt16 procId = MultiProc_self();
+ UInt16 hostClusterId;
- /*
- * If this assert fails, the MultiProc config has changed to break
- * an assumption in Linux rpmsg driver, that HOST is listed first in
- * MultiProc ID configuration.
- */
- Assert_isTrue(0 == MultiProc_getId("HOST"), NULL);
+ /* wait for Startup and procId to be set, because user fxn should set it */
+ if (!Startup_Module_startupDone()) {
+ return (Startup_NOTDONE);
+ }
+ else if (procId == MultiProc_INVALIDID) {
+ return (Startup_NOTDONE);
+ }
- /*
- * Wait for Startup to be done (if MultiProc id not yet set) because a
- * user fxn should set it
- */
- if (!Startup_Module_startupDone() && procId == MultiProc_INVALIDID) {
+ /* wait for MultiProc to start before testing the assert below */
+ if (!ti_sdo_utils_MultiProc_Module_startupDone()) {
return (Startup_NOTDONE);
}
+ /* If this assert fails, the MultiProc config has changed to break
+ * an assumption in Linux rpmsg driver, that HOST is listed first in
+ * MultiProc name list configuration.
+ */
+ Interrupt_module->clusterId = MultiProc_getBaseIdOfCluster();
+ hostClusterId = MultiProc_getId("HOST") - Interrupt_module->clusterId;
+ Assert_isTrue(0 == hostClusterId, NULL);
+
if (!Interrupt_enableKick) {
/* Do not unlock the kick registers */
return (Startup_DONE);
ipcar[DNUM] = val;
}
-
/*
* ======== Interrupt_intRegister ========
* Register ISR for remote processor interrupt
pos = MAP_RPROCID_TO_SRCC(remoteProcId, intInfo->localIntId);
- Log_print2(Diags_USER1, "Interrupt_intRegister: pos: %d, func: 0x%x\n",
+ Log_print2(Diags_USER1, "Interrupt_intRegister: pos: %d, func: 0x%x",
(IArg)pos, (IArg)func);
/* setup the function table with client function and arg to call: */
/* Make sure the interrupt only gets plugged once */
Interrupt_module->numPlugged++;
if (Interrupt_module->numPlugged == 1) {
+
/* Clear all pending interrupts */
Interrupt_intClearAll();
@@ -212,14 +222,13 @@ Void Interrupt_intUnregister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
table->arg = 0;
}
-/*!
+/*
* ======== Interrupt_intSend ========
* Send interrupt to the remote processor, identifying this core as source.
* If CORE0 BIT POS, we add DNUM to identify this core as the source;
* Otherwise, we just use the localIntId as the source bit position.
*/
-Void Interrupt_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
- UArg arg)
+Void Interrupt_intSend(UInt16 procId, IInterrupt_IntInfo *intInfo, UArg arg)
{
UInt32 val;
volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
Assert_isTrue((intInfo != NULL), NULL);
pos = MAP_TO_BITPOS(intInfo->localIntId);
- /*
- * bit 0 is set to generate the interrupt.
+ /* bit 0 is set to generate the interrupt.
* bits 4-7 are set to specify the interrupt generation source.
* The convention is that bit 4 (SRCS0) is used for core 0,
* bit 5 (SRCS1) for core 1, etc... .
*/
val = (1 << pos) | 1;
- Log_print3(Diags_USER1,
- "Interrupt_intSend: setting bit %d in SRCS as 0x%x to for rprocId #%d",
- (IArg)pos, (IArg)val, (IArg)remoteProcId);
- if (remoteProcId == MultiProc_getId("HOST"))
+ Log_print3(Diags_USER1, "Interrupt_intSend: setting bit %d in SRC "
+ "(val=0x%x) for procId %d", (IArg)pos, (IArg)val, (IArg)procId);
+
+ if (procId == MultiProc_getId("HOST"))
{
/* Interrupt is to be generated on the Host processor. Go through
* IPCGRH register
else
{
/* Interrupt is to be generated on another DSP. */
- ipcgr[MAP_RPROCID_TO_COREID(remoteProcId)] = val;
+ ipcgr[MAP_RPROCID_TO_COREID(procId)] = val;
}
}
* Acknowledge interrupt by clearing the corresponding source bit.
*
* intInfo->localIntId encodes the Source bit position to be cleared.
- * If this corresponds to Core0, adjust using remoteProcId to get true
+ * If this corresponds to Core0, adjust using procId to get true
* SRCS bit position for the DSP core.
*
* Otherwise, the localIntId is used directly as the bit position.
*
- * Only callers setting remoteProcId == HOST id care about return value.
+ * Only callers setting procId == HOST id care about return value.
*/
-UInt Interrupt_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
+UInt Interrupt_intClear(UInt16 procId, IInterrupt_IntInfo *intInfo)
{
volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
UInt pos;
Assert_isTrue((intInfo != NULL), NULL);
- pos = MAP_RPROCID_TO_SRCC(remoteProcId, intInfo->localIntId);
+
+ pos = MAP_RPROCID_TO_SRCC(procId, intInfo->localIntId);
ipcar[DNUM] = (1 << pos);
- Log_print2(Diags_USER1, "Interrupt_intClear: ipcgr: 0x%x, cleared: 0x%x\n",
- val, (1 << pos));
+ Log_print2(Diags_USER1, "Interrupt_intClear: ipcgr: 0x%x, cleared: 0x%x",
+ val, (1 << pos));
- if (remoteProcId == MultiProc_getId("HOST")) {
- payload = ((val & (UInt)(1 << Interrupt_SRCS_BITPOS_HOST)) ? val :
- Interrupt_INVALIDPAYLOAD);
+ if (procId == MultiProc_getId("HOST")) {
+ payload = ((val & (UInt)(1 << Interrupt_SRCS_BITPOS_HOST)) ?
+ val : Interrupt_INVALIDPAYLOAD);
}
return (payload);
* Return 1 if the interrupt was set (if so, we clear it);
* Otherwise, returns 0.
*/
-UInt Interrupt_checkAndClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
+UInt Interrupt_checkAndClear(UInt16 procId, IInterrupt_IntInfo *intInfo)
{
volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
diff --git a/packages/ti/ipc/family/tci6638/Interrupt.xdc b/packages/ti/ipc/family/tci6638/Interrupt.xdc
index 98ba03ded03ca81e35dcaecf79ec3637d5457ac4..f19855518306926eb049d88a8e63fbc39b1582a7 100644 (file)
/*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Void isr(UArg arg);
struct Module_State {
- FxnTable fxnTable[]; /* indexed by Source ID bit pos */
- UInt numPlugged; /* # of times the interrupt was registered */
+ UInt numPlugged; /* # of times the interrupt was registered */
+ UInt16 clusterId; /* cluster base procId */
+ FxnTable fxnTable[]; /* indexed by Source ID bit pos */
};
}
diff --git a/packages/ti/ipc/family/tci6638/Interrupt.xs b/packages/ti/ipc/family/tci6638/Interrupt.xs
index a6d85224d852475607c723fb839e6ceadcf7b6cc..c8da505cd1c7b16ea3ea92ce942b21b099177248 100644 (file)
/*
- * Copyright (c) 2013-2014, Texas Instruments Incorporated
+ * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
* ======== module$static$init ========
*/
-function module$static$init(mod, params)
+function module$static$init(state, mod)
{
- var fxnTable = Interrupt.$object.fxnTable;
+
+ state.numPlugged = 0;
+ state.clusterId = MultiProc.baseIdOfCluster;
/* The function table length should be the number of IPCAR bits */
- fxnTable.length = 32;
- for (var i = 0; i < fxnTable.length; i++) {
- fxnTable[i].func = null;
- fxnTable[i].arg = 0;
- }
+ state.fxnTable.length = 32;
- mod.numPlugged = 0;
+ for (var i = 0; i < state.fxnTable.length; i++) {
+ state.fxnTable[i].func = null;
+ state.fxnTable[i].arg = 0;
+ }
}
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.c b/packages/ti/ipc/family/tci6638/VirtQueue.c
index 2f6936276976ae8f891658141c6671070277e106..b3caa632d32e065b138a14f4781fc465dd1950cb 100644 (file)
/*
- * Copyright (c) 2011-2014, Texas Instruments Incorporated
+ * Copyright (c) 2011-2015 Texas Instruments Incorporated - http://www.ti.com
* 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.
*/
+
/** ============================================================================
* @file VirtQueue.c
*
* @brief Virtio Queue implementation for BIOS
*
* Differences between BIOS version and Linux kernel (include/linux/virtio.h):
- * - Renamed module from virtio.h to VirtQueue_Object.h to match the API prefixes;
- * - BIOS (XDC) types and CamelCasing used;
- * - virtio_device concept removed (i.e, assumes no containing device);
- * - simplified scatterlist from Linux version;
- * - VirtQueue_Objects are created statically here, so just added a VirtQueue_Object_init()
- * fxn to take the place of the Virtio vring_new_virtqueue() API;
+ * - Renamed module from virtio.h to VirtQueue.h to match the API prefixes
+ * - XDC Standard Types and CamelCasing used
+ * - virtio_device concept removed (i.e, assumes no containing device)
+ * - simplified scatterlist from Linux version
+ * - VirtQueue objects are created statically, added VirtQueue_Instance_init()
+ * fxn to take the place of the Virtio vring_new_virtqueue() API
* - The notify function is implicit in the implementation, and not provided
- * by the client, as it is in Linux virtio.
+ * by the client, as it is in Linux virtio
*
* All VirtQueue operations can be called in any context.
- *
- * The virtio header should be included in an application as follows:
- * @code
- * #include <ti/ipc/rpmsg/VirtQueue.h>
- * @endcode
- *
*/
#include <xdc/std.h>
#include <ti/sysbios/family/c66/Cache.h>
#include <ti/sysbios/knl/Swi.h>
-#include <ti/sdo/ipc/notifyDrivers/IInterrupt.h>
#include <ti/ipc/family/tci6638/Interrupt.h>
#include <ti/ipc/remoteproc/Resource.h>
#include <ti/ipc/rpmsg/virtio_ring.h>
/* Used for defining the size of the virtqueue registry */
-#define NUM_QUEUES 2
+#define NUM_QUEUES 2
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define RP_MSG_BUFS_SPACE (VirtQueue_RP_MSG_NUM_BUFS * RPMSG_BUF_SIZE * 2)
/* With 256 buffers, our vring will occupy 3 pages */
-#define RP_MSG_RING_SIZE ((DIV_ROUND_UP(vring_size(VirtQueue_RP_MSG_NUM_BUFS, \
- VirtQueue_RP_MSG_VRING_ALIGN), VirtQueue_PAGE_SIZE)) * VirtQueue_PAGE_SIZE)
+#define RP_MSG_RING_SIZE \
+ ((DIV_ROUND_UP(vring_size(VirtQueue_RP_MSG_NUM_BUFS, \
+ VirtQueue_RP_MSG_VRING_ALIGN), \
+ VirtQueue_PAGE_SIZE)) * VirtQueue_PAGE_SIZE)
/* The total IPC space needed to communicate with a remote processor */
#define RPMSG_IPC_MEM (RP_MSG_BUFS_SPACE + 2 * RP_MSG_RING_SIZE)
-#define ID_DSP_TO_A9 0
-#define ID_A9_TO_DSP 1
+#define ID_SELF_TO_HOST 0
+#define ID_HOST_TO_SELF 1
extern volatile cregister UInt DNUM;
Void VirtQueue_init()
{
extern cregister volatile UInt DNUM;
+ UInt16 clusterId;
UInt16 procId;
- /*
- * VirtQueue_init() must be called before MultiProcSetup_init().
- * (Check the xdc_runtime_Startup_firstFxns__A in the XDC generated code)
- * Abort if the procId has already been set. We must set it!
+ /* VirtQueue_init() must be called before MultiProcSetup_init().
+ * Check the xdc_runtime_Startup_firstFxns__A array in the XDC
+ * generated code. Abort if the procId has already been set; we
+ * must set it!
*/
if (MultiProc_self() != MultiProc_INVALIDID) {
System_abort("VirtQueue_init(): MultiProc_self already set!");
return;
}
- procId = DNUM + 1;
+ /* clusterId is needed to support single image loading */
+ clusterId = MultiProc_getBaseIdOfCluster();
+
+ /* compute local procId, add one to account for HOST processor */
+ procId = clusterId + DNUM + 1;
- /* Set the local ID */
+ /* set the local procId */
MultiProc_setLocalId(procId);
}
UInt32 marValue;
VirtQueue_module->traceBufPtr = Resource_getTraceBufPtr();
- /* Create the thread protection gate */
+
+ /* create the thread protection gate */
vq->gateH = GateAll_create(NULL, eb);
if (Error_check(eb)) {
Log_error0("VirtQueue_create: could not create gate object");
vq->swiHandle = params->swiHandle;
switch (vq->id) {
- case ID_DSP_TO_A9:
- case ID_A9_TO_DSP:
+ case ID_SELF_TO_HOST:
+ case ID_HOST_TO_SELF:
vringAddr = (struct vring *)Resource_getVringDA(vq->id);
Assert_isTrue(vringAddr != NULL, NULL);
/* Add per core offset: must match on host side: */
return(0);
}
- Log_print3(Diags_USER1,
- "vring: %d 0x%x (0x%x)\n", vq->id, (IArg)vringAddr,
+ Log_print3(Diags_USER1, "vring: %d 0x%x (0x%x)", vq->id, (IArg)vringAddr,
RP_MSG_RING_SIZE);
- vring_init(vq->vringPtr, VirtQueue_RP_MSG_NUM_BUFS, vringAddr, VirtQueue_RP_MSG_VRING_ALIGN);
+ vring_init(vq->vringPtr, VirtQueue_RP_MSG_NUM_BUFS, vringAddr,
+ VirtQueue_RP_MSG_VRING_ALIGN);
queueRegistry[vq->id] = vq;
return(0);
Void VirtQueue_kick(VirtQueue_Handle vq)
{
struct vring *vring = vq->vringPtr;
- IInterrupt_IntInfo intInfo;
+ Interrupt_IntInfo intInfo;
/* For now, simply interrupt remote processor */
if (vring->avail->flags & VRING_AVAIL_F_NO_INTERRUPT) {
- Log_print0(Diags_USER1,
- "VirtQueue_kick: no kick because of VRING_AVAIL_F_NO_INTERRUPT\n");
+ Log_print0(Diags_USER1, "VirtQueue_kick: no kick because of "
+ "VRING_AVAIL_F_NO_INTERRUPT");
return;
}
- Log_print2(Diags_USER1,
- "VirtQueue_kick: Sending interrupt to proc %d with payload 0x%x\n",
- (IArg)vq->procId, (IArg)vq->id);
+ Log_print2(Diags_USER1, "VirtQueue_kick: Sending interrupt to proc %d "
+ "with payload 0x%x", (IArg)vq->procId, (IArg)vq->id);
intInfo.localIntId = Interrupt_SRCS_BITPOS_CORE0;
Interrupt_intSend(vq->procId, &intInfo, vq->id);
IArg key;
key = GateAll_enter(vq->gateH);
- Log_print6(Diags_USER1, "getAvailBuf vq: 0x%x %d %d %d 0x%x 0x%x\n",
- (IArg)vq,
- vq->last_avail_idx, vring->avail->idx, vring->num,
- (IArg)&vring->avail, (IArg)vring->avail);
+ Log_print6(Diags_USER1, "getAvailBuf vq: 0x%x %d %d %d 0x%x 0x%x",
+ (IArg)vq, (IArg)vq->last_avail_idx, (IArg)vring->avail->idx,
+ (IArg)vring->num, (IArg)&vring->avail, (IArg)vring->avail);
/* Clear flag here to avoid race condition with remote processor.
* This is a negative flag, clearing it means that we want to
{
VirtQueue_Object *vq;
- Log_print1(Diags_USER1, "VirtQueue_isr received msg = 0x%x\n", msg);
+ Log_print1(Diags_USER1, "VirtQueue_isr received msg = 0x%x", msg);
vq = queueRegistry[0];
if (vq) {
*/
Void VirtQueue_startup(UInt16 remoteProcId, Bool isHost)
{
- IInterrupt_IntInfo intInfo;
+ Interrupt_IntInfo intInfo;
intInfo.intVectorId = Interrupt_DSPINT;
intInfo.localIntId = Interrupt_SRCS_BITPOS_HOST;
* Since interrupt is cleared, we throw away this first kick, which is
* OK since we don't process this in the ISR anyway.
*/
- Log_print0(Diags_USER1, "VirtQueue_startup: Polling for host int...\n");
+ Log_print0(Diags_USER1, "VirtQueue_startup: Polling for host int...");
while (!Interrupt_checkAndClear(remoteProcId, &intInfo));
Interrupt_intRegister(remoteProcId, &intInfo, (Fxn)VirtQueue_isr, 0);
- Log_print0(Diags_USER1, "Passed VirtQueue_startup\n");
+ Log_print0(Diags_USER1, "Passed VirtQueue_startup");
}
/* By convention, Host VirtQueues host are the even number in the pair */
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.xdc b/packages/ti/ipc/family/tci6638/VirtQueue.xdc
index 0bde155a3d8c6cc4308eab45df76103a878976a5..4ad35394289e69ccbcb84d277ef10eb14bbcddc1 100644 (file)
/*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
internal: /* not for client use */
- /*! Statically retrieve procIds to avoid doing this at runtime */
- config UInt hostProcId = MultiProc.INVALIDID;
-
void init();
/*!
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.xs b/packages/ti/ipc/family/tci6638/VirtQueue.xs
index bc62655f46068d3b95dfda317513ea92d3c936dc..6c1399cb8d30ca8944c5d55956ce5ef3e10f2ed7 100644 (file)
/*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns.$add(VirtQueue.init);
}
-
- this.hostProcId = MultiProc.getIdMeta("HOST");
}
/*
diff --git a/packages/ti/sdo/ipc/family/tci663x/Interrupt.xdc b/packages/ti/sdo/ipc/family/tci663x/Interrupt.xdc
index 78616031169020759b1268be897a84b395797d59..2af219004c508ec455f0229c4f3005b03f4341ec 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
viewInitFxn: 'viewInterruptsData',
structName: 'InterruptDataStruct'
}
- ],
+ ]
]
});
struct Module_State {
Fxn func;
- UArg args[]; /* One entry for each core */
- UInt numPlugged; /* # of times the interrupt was registered */
+ UInt numPlugged; /* # of times the interrupt was registered */
+ UArg args[]; /* one entry for each core (in cluster) */
};
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/Interrupt.xs b/packages/ti/sdo/ipc/family/tci663x/Interrupt.xs
index d878b5d97a8fa8b9b549ac094847396aeee05c90..30ecdd56603ff939aab570af312f1d19956b5fca 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
* ======== module$static$init ========
*/
-function module$static$init(mod, params)
+function module$static$init(state, mod)
{
var args = Interrupt.$object.args;
var MultiProc = xdc.module('ti.sdo.utils.MultiProc');
args[i] = 0;
}
- mod.func = null;
- mod.numPlugged = 0;
+ state.func = null;
+ state.numPlugged = 0;
}
/*
var modCfg = Program.getModuleConfig('ti.sdo.ipc.family.tci663x.Interrupt');
var MultiProcCfg = Program.getModuleConfig('ti.sdo.utils.MultiProc');
- var args = Program.fetchArray(Interrupt.args$fetchDesc,
- mod.args,
- MultiProcCfg.numProcessors);
+ var args = Program.fetchArray(Interrupt.args$fetchDesc, mod.args,
+ MultiProcCfg.numProcessors);
var localId = MultiProc.self$view();
diff --git a/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.c b/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.c
index 45e06954c3ce9e95b133dadce28aa4edc71053e2..e5770e362459002912d5d437e41217ea57365766 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
MultiProc_setLocalId(procId);
}
-
/*
* ======== MultiProcSetup_getProcId ========
*/
UInt16 MultiProcSetup_getProcId(UInt coreId)
{
UInt i;
- for (i = 0; i < ti_sdo_utils_MultiProc_numProcessors; i++) {
+ UInt baseId;
+
+ baseId = MultiProc_getBaseIdOfCluster();
+
+ /* search the procMap array for the given coreId */
+ for (i = 0; i < MultiProcSetup_segmentSize; i++) {
if (MultiProcSetup_procMap[i] == coreId) {
- return (i);
+ return (baseId + i);
}
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xdc b/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xdc
index ff76df514b7b48c7c093aeac093b7ef27f983c14..9f729156f268e9959f7a024f82497173bc13246d 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
msg: "A_invalidProcessor: This core is not present in the MultiProc name list"
};
- /*! ProcId -> CoreId mapping (indexed by procId) */
+internal:
+ /* Map the clusterId to the coreId (only for DSP processos)
+ *
+ * The procMap array is indexed by clusterId. The element value
+ * is the coreId (equivalent to DNUM).
+ */
config UInt16 procMap[];
-internal:
+ /* Maximum number of processors on this device
+ *
+ * We consider the CortexA15 quad-core processor to be one
+ * logical processor. There are up to eight DSP processors.
+ */
+ config UInt16 segmentSize = 9;
- /*!
+ /*
* ======== getProcId ========
- * Returns the MultiProc ID corresponding to a specific core
+ * Returns the MultiProc ID corresponding to the given coreId
*/
UInt16 getProcId(UInt coreId);
diff --git a/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xs b/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xs
index 51e122f147e4873607750f51bd397682184d9b2b..e6490fc010dcc2bb4eccd7ae35005d80fd57b607 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
MultiProcSetup = this;
MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
- /*
- * Only configure the local procId if the user hasn't disabled the config
- * and if the procId hasn't been statically set
+ /* If not disabled by user and if procId has not been configured,
+ * add run-time function to set it.
*/
- if (MultiProcSetup.configureProcId == true &&
- MultiProc.id == MultiProc.INVALIDID) {
+ if ((MultiProcSetup.configureProcId)
+ && (MultiProc.id == MultiProc.INVALIDID)) {
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns.$add(MultiProcSetup.init);
}
-}
-/*
- * ======== module$static$init ========
- */
-function module$static$init(mod, params)
-{
+ /* the procMap is for all processors on the local device */
+ this.procMap.length = this.segmentSize;
- /* The procMap is based upon the MuliProc id, init it here */
- this.procMap.length = MultiProc.numProcessors;
for (var i = 0; i < this.procMap.length; i++) {
this.procMap[i] = -1;
}
- /* Set the procMap based on the configured names in MultiProc.setConfig */
- for (var i = MultiProc.baseIdOfCluster; i < MultiProc.baseIdOfCluster +
- MultiProc.numProcsInCluster; i++) {
+ /* make sure the MultiProc.nameList length fits into segmentSize */
+ if (MultiProc.nameList.length > this.segmentSize) {
+ this.$logError("The MultiProc.nameList length ("
+ + MultiProc.nameList.length + ") is larger than "
+ + "MultiProcSetup.segmentSize (" + this.segmentSize + ")", this);
+ }
+
+ /* Use the MultiProc.nameList to initialize the procMap array
+ * with the corresponding coreId.
+ */
+ for (var i = 0; i < MultiProc.nameList.length; i++) {
- /* The nameList is based on an index */
- if (MultiProc.nameList[i - MultiProc.baseIdOfCluster] == null) {
- /* nameList is NULL, don't need to set the procMap */
- break;
+ /* exclude host processor */
+ if (MultiProc.nameList[i] == "HOST") {
+ continue;
}
- this.procMap[i] = Number(MultiProc.nameList[i -
- MultiProc.baseIdOfCluster].substring("CORE".length));
+ /* the numeric part of the name string determines the coreId */
+ var name = MultiProc.nameList[i];
+ var coreId = Number(name.substring("CORE".length));
+ this.procMap[i] = coreId;
}
}