summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 3d83275)
raw | patch | inline | side by side (from parent 1: 3d83275)
author | Ramsey Harris <ramsey@ti.com> | |
Fri, 25 Sep 2015 23:19:51 +0000 (16:19 -0700) | ||
committer | Angela Stegmaier <angelabaker@ti.com> | |
Tue, 29 Sep 2015 17:34:57 +0000 (12:34 -0500) |
Consolidate Interrupt and NotifyCircSetup modules from package
ti.ipc.family.tci6638 into package ti.sdo.ipc.family.tci663x.
This package is now able to support both Linux and non-Linux
configurations. Replace Interrupt binding in VirtQueue with a
proxy. Existing configurations will receive a warning when using
the deprecated modules. The Interrupt module snoops for VirtQueue
and NotifyCircSetup to avoid host conflict. Remove deprecated
modules from custom build flow.
ti.ipc.family.tci6638 into package ti.sdo.ipc.family.tci663x.
This package is now able to support both Linux and non-Linux
configurations. Replace Interrupt binding in VirtQueue with a
proxy. Existing configurations will receive a warning when using
the deprecated modules. The Interrupt module snoops for VirtQueue
and NotifyCircSetup to avoid host conflict. Remove deprecated
modules from custom build flow.
17 files changed:
diff --git a/packages/ti/ipc/family/tci6638/Interrupt.c b/packages/ti/ipc/family/tci6638/Interrupt.c
index 25fdbeaffd09fa498e266b2b6195aa7e55c11809..c250acd97c8bfae58b08a854a167838735c29f9d 100644 (file)
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== Interrupt.c ========
* C647x based interrupt manager.
#include <xdc/std.h>
#include <xdc/runtime/Assert.h>
-#include <xdc/runtime/Log.h>
-#include <xdc/runtime/Diags.h>
-#include <xdc/runtime/Startup.h>
-
-#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>
-#include "Interrupt.h"
-
#include "package/internal/Interrupt.xdc.h"
-extern volatile cregister UInt DNUM;
-
-Void Interrupt_isr(UArg arg);
-
-/* Shift to source bit id for CORES 0-3 */
-#define MAP_TO_BITPOS(intId) \
- (intId == Interrupt_SRCS_BITPOS_CORE0 ? (intId + DNUM) : intId)
-
-/* Map procId to coreId (DNUM)
- *
- * NOTE: This assumes HOST clusterId is 0, CORE0 clusterId is 1, etc.
- */
-#define MAP_RPROCID_TO_COREID(procId) \
- ((procId) - Interrupt_module->clusterId - 1)
-
-#define MAP_RPROCID_TO_SRCC(rProcId, intId) \
- (intId == Interrupt_SRCS_BITPOS_CORE0 ? \
- (intId + MAP_RPROCID_TO_COREID(rProcId)) : intId)
-
-/*
- *************************************************************************
- * Module functions
- *************************************************************************
- */
/*
- * ======== Interrupt_Module_startup ========
- */
-Int Interrupt_Module_startup(Int phase)
-{
- volatile UInt32 *kick0 = (volatile UInt32 *)Interrupt_KICK0;
- volatile UInt32 *kick1 = (volatile UInt32 *)Interrupt_KICK1;
- UInt16 procId = MultiProc_self();
-
- /* 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 MultiProc to start before testing the assert below */
- if (!ti_sdo_utils_MultiProc_Module_startupDone()) {
- return (Startup_NOTDONE);
- }
-
- Interrupt_module->clusterId = MultiProc_getBaseIdOfCluster();
-
- /* 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.
- */
- Assert_isTrue((MultiProc_getId("HOST") - Interrupt_module->clusterId) == 0,
- NULL);
-
- if (!Interrupt_enableKick) {
- /* Do not unlock the kick registers */
- return (Startup_DONE);
- }
-
- /*
- * Only write to the KICK registers if:
- * - This core is the SR0 owner
- * - There is no SR0 and this core has procId '1' (IPC 3.x: this case).
- */
- /* TODO: What if CORE0 is not started, but the others are? */
- if (DNUM == 0) {
- if (Interrupt_KICK0 && Interrupt_KICK1){
- /* unlock the KICK mechanism in the Bootcfg MMRs if defined */
- kick0[0] = 0x83e70b13; /* must be written with this value */
- kick1[0] = 0x95a4f1e0; /* must be written with this value */
- }
- }
-
- return (Startup_DONE);
-}
-
-/*!
* ======== Interrupt_intEnable ========
- * Enable interrupt
*/
Void Interrupt_intEnable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
- Hwi_enableInterrupt(intInfo->intVectorId);
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
}
/*!
* ======== Interrupt_intDisable ========
- * Disables interrupts
*/
Void Interrupt_intDisable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
- Hwi_disableInterrupt(intInfo->intVectorId);
-}
-
-Void Interrupt_intClearAll()
-{
- volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
- UInt val = ipcgr[DNUM]; /* Interrupt source bits */
-
- ipcar[DNUM] = val;
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
}
/*
* ======== Interrupt_intRegister ========
- * Register ISR for remote processor interrupt
*/
Void Interrupt_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
- Fxn func, UArg arg)
+ Fxn func, UArg arg)
{
- Hwi_Params hwiAttrs;
- Interrupt_FxnTable *table;
-
- UInt pos;
- Assert_isTrue(intInfo != NULL, NULL);
-
- pos = MAP_RPROCID_TO_SRCC(remoteProcId, intInfo->localIntId);
-
- 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: */
- table = &(Interrupt_module->fxnTable[pos]);
- table->func = func;
- table->arg = arg;
-
- /* Make sure the interrupt only gets plugged once */
- Interrupt_module->numPlugged++;
- if (Interrupt_module->numPlugged == 1) {
-
- /* Clear all pending interrupts */
- Interrupt_intClearAll();
-
- /* Register interrupt to remote processor */
- Hwi_Params_init(&hwiAttrs);
- hwiAttrs.maskSetting = Hwi_MaskingOption_SELF;
- hwiAttrs.arg = arg;
- hwiAttrs.eventId = Interrupt_INTERDSPINT;
-
- Hwi_create(intInfo->intVectorId,
- (Hwi_FuncPtr)Interrupt_isr, &hwiAttrs, NULL);
-
- Hwi_enableInterrupt(intInfo->intVectorId);
- }
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
}
Void Interrupt_intUnregister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
- Hwi_Handle hwiHandle;
- Interrupt_FxnTable *table;
- UInt pos;
-
- Assert_isTrue(intInfo != NULL, NULL);
-
- Interrupt_module->numPlugged--;
- if (Interrupt_module->numPlugged == 0) {
- /* No need to disable interrupt: Hwi_delete takes care of this */
- hwiHandle = Hwi_getHandle(intInfo->intVectorId);
- Hwi_delete(&hwiHandle);
- }
-
- /* Unset the function table */
- pos = MAP_RPROCID_TO_SRCC(remoteProcId, intInfo->localIntId);
-
- table = &(Interrupt_module->fxnTable[pos]);
- table->func = NULL;
- table->arg = 0;
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
}
/*
* ======== 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 procId, IInterrupt_IntInfo *intInfo, UArg arg)
{
- UInt32 val;
- volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- volatile UInt32 *ipcgrh = (volatile UInt32 *)Interrupt_IPCGRH;
- UInt pos;
-
- Assert_isTrue((intInfo != NULL), NULL);
- pos = MAP_TO_BITPOS(intInfo->localIntId);
-
- /* 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 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
- */
- *ipcgrh = val;
- }
- else
- {
- /* Interrupt is to be generated on another DSP. */
- ipcgr[MAP_RPROCID_TO_COREID(procId)] = val;
- }
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
}
/*
* ======== Interrupt_intClear ========
- * 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 procId to get true
- * SRCS bit position for the DSP core.
- *
- * Otherwise, the localIntId is used directly as the bit position.
- *
- * Only callers setting procId == HOST id care about return value.
*/
UInt Interrupt_intClear(UInt16 procId, IInterrupt_IntInfo *intInfo)
{
- volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
- UInt payload = Interrupt_INVALIDPAYLOAD;
- UInt val = ipcgr[DNUM]; /* Interrupt source bits */
- UInt pos;
-
- Assert_isTrue((intInfo != NULL), NULL);
-
- pos = MAP_RPROCID_TO_SRCC(procId, intInfo->localIntId);
- ipcar[DNUM] = (1 << pos);
-
- Log_print2(Diags_USER1, "Interrupt_intClear: ipcgr: 0x%x, cleared: 0x%x",
- val, (1 << pos));
-
- if (procId == MultiProc_getId("HOST")) {
- payload = ((val & (UInt)(1 << Interrupt_SRCS_BITPOS_HOST)) ?
- val : Interrupt_INVALIDPAYLOAD);
- }
-
- return (payload);
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
+ return (Interrupt_INVALIDPAYLOAD);
}
/*
* ======== Interrupt_checkAndClear ========
- * Return 1 if the interrupt was set (if so, we clear it);
- * Otherwise, returns 0.
*/
UInt Interrupt_checkAndClear(UInt16 procId, IInterrupt_IntInfo *intInfo)
{
- volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
- UInt val = ipcgr[DNUM]; /* Interrupt source bits */
- UInt pos;
-
- Assert_isTrue((intInfo != NULL), NULL);
-
- pos = MAP_TO_BITPOS(intInfo->localIntId);
- if (val & (1 << pos)) {
- ipcar[DNUM] = (1 << pos);
- return(1);
- }
-
- return(0);
-}
-
-/*
- * ======== Interrupt_isr ========
- */
-Void Interrupt_isr(UArg arg)
-{
- Int i;
- Interrupt_FxnTable *table;
- volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
- UInt val = ipcgr[DNUM]; /* Interrupt source bits */
-
- Log_print1(Diags_USER1,
- "Interrupt_isr: Interrupt(s) received: 0x%x", (IArg)val);
-
- for (i = Interrupt_SRCS_BITPOS_CORE0; i < 32; i++) {
- if (val & (1 << i)) {
- /* Clear the specific interrupt: */
- ipcar[DNUM] = (1 << i);
-
- /* Call the client function: */
- table = &(Interrupt_module->fxnTable[i]);
- if (table->func != NULL) {
- Log_print1(Diags_USER1,
- "Interrupt_isr: source id bit: %d", i);
- (table->func)(table->arg);
- }
- }
- }
+ Assert_isTrue(FALSE, Interrupt_A_notImplemented);
+ return (0);
}
diff --git a/packages/ti/ipc/family/tci6638/Interrupt.xdc b/packages/ti/ipc/family/tci6638/Interrupt.xdc
index f19855518306926eb049d88a8e63fbc39b1582a7..d2c12e58d7491fd86f8a7723f2c10de36b7b1220 100644 (file)
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
*/
+
/*
* ======== Interrupt.xdc ========
*/
+package ti.ipc.family.tci6638;
+
+import xdc.runtime.Assert;
/*!
* ======== Interrupt ========
* TCI66xx IPC interrupt manager
*/
-
-@ModuleStartup
-
module Interrupt inherits ti.sdo.ipc.notifyDrivers.IInterrupt
{
*/
config Bool enableKick = true;
+ /*! Function not implemented
+ */
+ config Assert.Id A_notImplemented = {
+ msg: "A_notImplemented: this function is not implemented"
+ };
+
/*!
* ======== Interrupt_intClearAll ========
* Clear all pending interrupts.
const UInt SRCS_BITPOS_HOST = 31;
/*! Ptr to the IPC Generation Registers */
- config Ptr IPCGR0;
+ config Ptr IPCGR0 = null;
/*! Ptr to the IPC Acknowledgment Registers */
- config Ptr IPCAR0;
+ config Ptr IPCAR0 = null;
/*! Ptr to the IPC Host Generation Host Register */
- config Ptr IPCGRH;
+ config Ptr IPCGRH = null;
/*! Ptr to the IPC Acknowledgement Host Register */
- config Ptr IPCARH;
+ config Ptr IPCARH = null;
/*! Ptr to the KICK0 Bootcfg Registers */
- config Ptr KICK0;
+ config Ptr KICK0 = null;
/*! Ptr to the KICK1 Bootcfg Registers */
- config Ptr KICK1;
+ config Ptr KICK1 = null;
/*! Inter-processor interrupt id (varies per device) */
- config UInt INTERDSPINT;
+ config UInt INTERDSPINT = -1;
/*! Vector interrupt id for Hwi_create */
- config UInt DSPINT;
-
- /*! Function table */
- struct FxnTable {
- Fxn func;
- UArg arg;
- }
+ config UInt DSPINT = -1;
-
- /*!
- * ======== isr ========
- * Stub function plugged as interrupt handler
- */
- Void isr(UArg arg);
-
- struct Module_State {
- 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 d2ddc169a2959d4f15a73ea345990d7cd0ff7622..4b07a648075f46f94b7135a0de6859176fc15f46 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*
- * ======== Interrupt.xs ========
- */
-
-var deviceSettings = {
- 'Kepler' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5,
- },
- 'TMS320TCI6638' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5,
- },
- 'TMS320TCI6636' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5
- },
- 'TMS320TCI6630K2L' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5
- },
- 'TMS320C66AK2H12' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5,
- },
- 'TMS320C66AK2E05' : {
- IPCGR0: 0x02620240,
- IPCAR0: 0x02620280,
- IPCGRH: 0x02620260,
- IPCARH: 0x026202A0,
- KICK0: 0x02620038,
- KICK1: 0x0262003C,
- INTERDSPINT: 105,
- DSPINT: 5
- }
-}
-var Settings = xdc.loadCapsule('ti/sdo/ipc/family/Settings.xs');
-Settings.setDeviceAliases(deviceSettings, Settings.deviceAliases);
-var Hwi = null;
-var Interrupt = null;
-var MultiProc = null;
/*
- * ======== module$meta$init ========
+ * ======== Interrupt.xs ========
*/
-function module$meta$init()
-{
- /* Only process during "cfg" phase */
- if (xdc.om.$name != "cfg") {
- return;
- }
-
- var settings = deviceSettings[Program.cpu.deviceName];
-
- this.IPCGR0 = settings.IPCGR0;
- this.IPCAR0 = settings.IPCAR0;
- this.IPCGRH = settings.IPCGRH;
- this.IPCARH = settings.IPCARH;
- this.KICK0 = settings.KICK0;
- this.KICK1 = settings.KICK1;
- this.INTERDSPINT = settings.INTERDSPINT;
- this.DSPINT = settings.DSPINT;
-}
/*
* ======== module$use ========
*/
function module$use()
{
- Interrupt = this;
+ xdc.useModule('xdc.runtime.Assert');
+ xdc.useModule('ti.sdo.ipc.notifyDrivers.IInterrupt');
- Hwi = xdc.useModule("ti.sysbios.family.c64p.Hwi");
- MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
+ this.$logWarning("This module has been deprecated. To eliminate "
+ + "this warning, remove \"xdc.useModule('" + this.$name + "')\" "
+ + "from your application configuration script. The correct "
+ + "interrupt delegate will be included automatically.", this);
-}
+ /* If the NotifyDriverCirc module was used, assume that this module
+ * was assigned as the delegate for the interrupt proxy. Override that
+ * assignment with the correct delegate.
+ */
+ var driver = "ti.sdo.ipc.notifyDrivers.NotifyDriverCirc";
-/*
- * ======== module$validate ========
- */
-function module$validate()
-{
- /* verify the host is first in the multiproc name list */
- if (MultiProc.getIdMeta("HOST") != 0) {
- this.$logError("Processor HOST is missing from MultiProc name list",
- MultiProc, null);
+ if (driver in xdc.om) {
+ var NotifyDriverCirc = xdc.module(driver);
+ if (NotifyDriverCirc.$used) {
+ NotifyDriverCirc.InterruptProxy =
+ xdc.useModule('ti.sdo.ipc.family.tci663x.Interrupt');
+ }
}
-}
-
-/*
- * ======== module$static$init ========
- */
-function module$static$init(state, mod)
-{
-
- state.numPlugged = 0;
- state.clusterId = MultiProc.baseIdOfCluster;
-
- /* The function table length should be the number of IPCAR bits */
- state.fxnTable.length = 32;
- for (var i = 0; i < state.fxnTable.length; i++) {
- state.fxnTable[i].func = null;
- state.fxnTable[i].arg = 0;
+ if (this.$written("enableKick")) {
+ this.$logWarning("The configuration parameter 'enableKick' has "
+ + "been deprecated. Please refer to the interrupt delegate "
+ + "for more information.", this);
}
}
diff --git a/packages/ti/ipc/family/tci6638/NotifyCircSetup.c b/packages/ti/ipc/family/tci6638/NotifyCircSetup.c
index d4b026caae67f599d11f5164d07683f29e9686cf..ef7ada5559223673c9f3a884bc9dc1b15c0e8b0f 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
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
/*
* ======== NotifyCircSetup.c ========
*/
#include <xdc/std.h>
#include <xdc/runtime/Assert.h>
-#include <ti/sdo/ipc/notifyDrivers/NotifyDriverCirc.h>
-#include <ti/sdo/ipc/_Notify.h>
-#include <ti/ipc/MultiProc.h>
-
-#include <xdc/runtime/Error.h>
#include "package/internal/NotifyCircSetup.xdc.h"
-/*!
+
+/*
* ======== NotifyCircSetup_attach ========
*/
Int NotifyCircSetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
- NotifyDriverCirc_Params notifyShmParams;
- NotifyDriverCirc_Handle shmDrvHandle;
- ti_sdo_ipc_Notify_Handle notifyHandle;
- Error_Block eb;
-
- Assert_isTrue(remoteProcId != MultiProc_getId("HOST"), NULL);
-
- /* Initialize the error block */
- Error_init(&eb);
-
- /* init params and set default values */
- NotifyDriverCirc_Params_init(¬ifyShmParams);
- notifyShmParams.intVectorId = NotifyCircSetup_dspIntVectId;
- notifyShmParams.localIntId = NotifyCircSetup_SRCS_BITPOS_CORE0;
- notifyShmParams.sharedAddr = sharedAddr;
- notifyShmParams.remoteProcId = remoteProcId;
-
- shmDrvHandle = NotifyDriverCirc_create(¬ifyShmParams, &eb);
- if (shmDrvHandle == NULL) {
- return (Notify_E_FAIL);
- }
-
- notifyHandle = ti_sdo_ipc_Notify_create(
- NotifyDriverCirc_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL,
- &eb);
- if (notifyHandle == NULL) {
- NotifyDriverCirc_delete(&shmDrvHandle);
-
- return (Notify_E_FAIL);
- }
-
- return (Notify_S_SUCCESS);
+ Assert_isTrue(FALSE, NotifyCircSetup_A_notImplemented);
+ return (-1);
}
-/*!
+/*
* ======== NotifyCircSetup_sharedMemReq ========
*/
SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
{
- SizeT memReq;
- NotifyDriverCirc_Params params;
-
- Assert_isTrue(remoteProcId != MultiProc_getId("HOST"), NULL);
-
- NotifyDriverCirc_Params_init(¶ms);
- params.sharedAddr = sharedAddr;
- params.intVectorId = NotifyCircSetup_dspIntVectId;
- params.remoteProcId = remoteProcId;
-
- memReq = NotifyDriverCirc_sharedMemReq(¶ms);
-
- return(memReq);
+ Assert_isTrue(FALSE, NotifyCircSetup_A_notImplemented);
+ return (0);
}
-/*!
+/*
* ======== NotifyCircSetup_numIntLines ========
*/
UInt16 NotifyCircSetup_numIntLines(UInt16 remoteProcId)
{
- UInt16 retval = 1;
-
- if (remoteProcId == MultiProc_getId("HOST")) {
- retval = 0;
- }
-
- return (retval);
+ Assert_isTrue(FALSE, NotifyCircSetup_A_notImplemented);
+ return (0);
}
diff --git a/packages/ti/ipc/family/tci6638/NotifyCircSetup.xdc b/packages/ti/ipc/family/tci6638/NotifyCircSetup.xdc
index 9347e4eaa67dad28201af6f69da25e89acb76574..d0d90aed5a96f31a8eca93e325aa5720dd978d9f 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
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
/*
* ======== NotifyCircSetup.xdc ========
*/
+package ti.ipc.family.tci6638;
+
+import xdc.runtime.Assert;
/*!
* ======== NotifyCircSetup ========
* Manages setup of the default Notify driver handles
- *
- * Creates the default notify drivers for each pair of processors.
*/
module NotifyCircSetup inherits ti.sdo.ipc.interfaces.INotifySetup
{
/* The interrupt vector id */
config UInt dspIntVectId = 5;
+ /*! Function not implemented
+ */
+ config Assert.Id A_notImplemented = {
+ msg: "A_notImplemented: this function is not implemented"
+ };
+
internal:
/*! Source ID bit position for CORE0 */
diff --git a/packages/ti/ipc/family/tci6638/NotifyCircSetup.xs b/packages/ti/ipc/family/tci6638/NotifyCircSetup.xs
index c45d4da789430f6fb8a6c43ad761a5ec5a2ca7e7..d24b94c0254b994bb07af9155d5da340692acec7 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
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
/*
* ======== NotifyCircSetup.xs ========
*/
-var NotifyCircSetup = null;
-var MultiProc = null;
-var Notify = null;
-var NotifyDriverShm = null;
-
/*
* ======== module$use ========
*/
function module$use()
{
- NotifyCircSetup = this;
- NotifyDriverCirc =
- xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
- Notify = xdc.useModule('ti.sdo.ipc.Notify');
- MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+ xdc.useModule('xdc.runtime.Assert');
+
+ this.$logWarning("This module has been deprecated. To eliminate "
+ + "this warning, remove \"xdc.useModule('" + this.$name + "')\" "
+ + "from your application configuration script. The correct "
+ + "setup module for notify will be included automatically.", this);
+
+ /* If the Notify module was used, assume that this module was assigned
+ * as the delegate for the setup proxy. Override that assignment with
+ * the correct delegate.
+ */
+ var modName = "ti.sdo.ipc.Notify";
+
+ if (modName in xdc.om) {
+ var Notify = xdc.module(modName);
+ if (Notify.$used) {
+ Notify.SetupProxy =
+ xdc.useModule('ti.sdo.ipc.family.tci663x.NotifyCircSetup');
+ }
+ }
+
+ if (this.$written("dspIntVectId")) {
+ this.$logWarning("The configuration parameter 'dspIntVectId' has "
+ + "been deprecated. To specify the CPU interrupt number for "
+ + "IPC, please refer to the interrupt delegate.", this);
+ }
}
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.c b/packages/ti/ipc/family/tci6638/VirtQueue.c
index 031b5326c5319c1fb668a0cb8c39c2704629a479..504afba00d9e18586f8d9cf0f5c8ed4655c40664 100644 (file)
#include <ti/sysbios/family/c66/Cache.h>
#include <ti/sysbios/knl/Swi.h>
-#include <ti/ipc/family/tci6638/Interrupt.h>
#include <ti/ipc/remoteproc/Resource.h>
#include <ti/ipc/MultiProc.h>
Void VirtQueue_kick(VirtQueue_Handle vq)
{
struct vring *vring = vq->vringPtr;
- Interrupt_IntInfo intInfo;
/* For now, simply interrupt remote processor */
if (vring->avail->flags & VRING_AVAIL_F_NO_INTERRUPT) {
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);
+ VirtQueue_InterruptProxy_intSend(vq->procId, NULL, 0);
}
/*
/*
* ======== VirtQueue_startup ========
*/
-Void VirtQueue_startup(UInt16 remoteProcId, Bool isHost)
+Void VirtQueue_startup(UInt16 procId, Bool isHost)
{
- Interrupt_IntInfo intInfo;
- intInfo.intVectorId = Interrupt_DSPINT;
- intInfo.localIntId = Interrupt_SRCS_BITPOS_HOST;
-
-
- /*
- * Wait for first kick from host, which happens to coincide with the
+ /* Wait for first kick from host, which happens to coincide with the
* priming of host's receive buffers, indicating host is ready to send.
* 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...");
- while (!Interrupt_checkAndClear(remoteProcId, &intInfo));
-
- Interrupt_intRegister(remoteProcId, &intInfo, (Fxn)VirtQueue_isr, 0);
+ while (!VirtQueue_InterruptProxy_intClear(procId, NULL));
+ VirtQueue_InterruptProxy_intRegister(procId, NULL, (Fxn)VirtQueue_isr, 0);
Log_print0(Diags_USER1, "Passed VirtQueue_startup");
}
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.xdc b/packages/ti/ipc/family/tci6638/VirtQueue.xdc
index 30047247b0c43ae89939c9c5f294cc8ac3dae40f..0e3616936e41bac443ac174871b74bfebda83b7a 100644 (file)
*
* ============================================================================
*/
+package ti.ipc.family.tci6638;
-import ti.sysbios.knl.Swi;
-import ti.sdo.utils.MultiProc;
-import ti.sysbios.gates.GateAll;
+import ti.sdo.ipc.notifyDrivers.IInterrupt;
+import ti.sdo.utils.MultiProc;
+import ti.sysbios.gates.GateAll;
+import ti.sysbios.knl.Swi;
/*!
* ======== VirtQueue ========
*/
// -------- Module Proxies --------
+ /*! @_nodoc
+ * IInterrupt proxy that handles interrupts between multiple CPU cores
+ */
+ proxy InterruptProxy inherits IInterrupt;
+
// -------- Module Parameters --------
/* Per Core offset of start of VRING control structures from CORE0 */
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.xs b/packages/ti/ipc/family/tci6638/VirtQueue.xs
index 6c1399cb8d30ca8944c5d55956ce5ef3e10f2ed7..17001968e07920c2959c371e30209c52f2273322 100644 (file)
*/
function module$use()
{
- VirtQueue = this;
- var MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
+ var VirtQueue = this;
+ var MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
- xdc.useModule("ti.sysbios.knl.Swi");
- Interrupt = xdc.useModule("ti.ipc.family.tci6638.Interrupt");
- //xdc.useModule("ti.ipc.remoteproc.Resource");
xdc.useModule("ti.sysbios.gates.GateAll");
+ xdc.useModule("ti.sysbios.knl.Swi");
+
if (MultiProc.id == MultiProc.INVALIDID) {
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns.$add(VirtQueue.init);
}
+
+ if (VirtQueue.InterruptProxy == null) {
+ var Settings = xdc.module("ti.sdo.ipc.family.Settings");
+ var interruptDelegate = Settings.getDefaultInterruptDelegate();
+ VirtQueue.InterruptProxy = xdc.useModule(interruptDelegate);
+ }
}
/*
* ======== module$static$init ========
*/
-function module$static$init(mod, params)
+function module$static$init(state, mod)
{
- /* Init VirtQueue params */
- mod.hostSlaveSynced = 0;
- mod.virtQueueInitialized = 0;
- mod.queueRegistry = null;
- mod.traceBufPtr = null;
+ state.hostSlaveSynced = 0;
+ state.virtQueueInitialized = 0;
+ state.queueRegistry = null;
+ state.traceBufPtr = null;
}
index c811a74a2ca30461f1e51223d74942d6c75bbf0d..3a2c649517e0221dc112e7ead0fbef8d28c312d2 100644 (file)
"ti/ipc/family/tci6614/Interrupt.c " +
"ti/ipc/family/tci6614/VirtQueue.c " +
"ti/ipc/family/tci6614/NotifySetup.c " +
- "ti/ipc/family/tci6638/Interrupt.c " +
"ti/ipc/family/tci6638/VirtQueue.c " +
- "ti/ipc/family/tci6638/NotifyCircSetup.c " +
"ti/ipc/family/vayu/VirtQueue.c ";
var C674Sources = "ti/sdo/ipc/gates/GateHWSpinlock.c " +
diff --git a/packages/ti/sdo/ipc/family/tci663x/Interrupt.c b/packages/ti/sdo/ipc/family/tci663x/Interrupt.c
index 7f0e5ac844e791676130ae21d1f3a2a6f9bffdbe..6989d06ead30d515bcd778ad822c8be72367ed0d 100644 (file)
/*
- * Copyright (c) 2012-2014, Texas Instruments Incorporated
- * All rights reserved.
+ * Copyright (c) 2014-2015 Texas Instruments Incorporated - http://www.ti.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
*
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== Interrupt.c ========
- * C647x based interrupt manager.
*/
-
#include <xdc/std.h>
#include <xdc/runtime/Assert.h>
#include <xdc/runtime/Startup.h>
+#include <xdc/runtime/System.h>
-#include <ti/sysbios/family/c64p/Hwi.h>
+#include <ti/sysbios/hal/Hwi.h>
-#include <ti/sdo/ipc/_Ipc.h>
+#include <ti/sdo/ipc/family/tci663x/MultiProcSetup.h>
#include <ti/sdo/ipc/notifyDrivers/IInterrupt.h>
#include <ti/sdo/utils/_MultiProc.h>
-#include <ti/sdo/ipc/_SharedRegion.h>
-
-#include <ti/sdo/ipc/family/tci663x/MultiProcSetup.h>
#include "package/internal/Interrupt.xdc.h"
+extern volatile cregister UInt DNUM;
+
/*
*************************************************************************
*/
Int Interrupt_Module_startup(Int phase)
{
- UInt16 procId = MultiProc_self();
+ UInt16 hostId;
+ String name;
+ UInt nameId;
- /*
- * 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 Startup (because user function might set local procId) */
+ if (!Startup_Module_startupDone()) {
+ return (Startup_NOTDONE);
+ }
+ else if (MultiProc_self() == MultiProc_INVALIDID) {
+ /* if user function is missing, this will eventually fail */
+ return (Startup_NOTDONE);
+ }
+
+ if (!ti_sdo_utils_MultiProc_Module_startupDone()) {
return (Startup_NOTDONE);
}
+ if (Interrupt_module->baseId == MultiProc_INVALIDID) {
+ Interrupt_module->baseId = MultiProc_getBaseIdOfCluster();
+ }
+ Assert_isTrue(Interrupt_module->baseId != MultiProc_INVALIDID,
+ Interrupt_A_clusterBaseId);
+
+ /* If this assert fails, then MultiProc config has changed to break
+ * an assumption in Linux rpmsg driver, that HOST is listed first in
+ * MultiProc name list configuration.
+ */
+ if ((hostId = MultiProc_getId("HOST")) != MultiProc_INVALIDID) {
+ Assert_isTrue((hostId - Interrupt_module->baseId) == 0,
+ Interrupt_A_hostConfig);
+ }
+
+ /* Validate the running executable has been loaded onto the correct
+ * processor. In other words, make sure CORE0 was loaded onto DSP0
+ * (i.e. DNUM == 0), CORE1 loaded onto DSP1, etc.
+ */
+ name = MultiProc_getName(MultiProc_self());
+ nameId = (UInt)(name[4] - '0');
+
+ if (nameId != DNUM) {
+ System_abort("incorrect executable loaded onto processor");
+ }
+
+ if (!Interrupt_enableKick) {
+ /* do not unlock the kick registers */
+ return (Startup_DONE);
+ }
+
+ /* only write KICK registers from CORE0 */
+ if (DNUM == 0) {
+ /* TODO: What if CORE0 is not started, but the others are? */
+ if (Interrupt_KICK0 && Interrupt_KICK1) {
+ volatile UInt32 *kick0 = (volatile UInt32 *)Interrupt_KICK0;
+ volatile UInt32 *kick1 = (volatile UInt32 *)Interrupt_KICK1;
+
+ /* unlock the KICK mechanism in the Bootcfg MMRs if defined */
+ *kick0 = 0x83e70b13; /* must be written with this value */
+ *kick1 = 0x95a4f1e0; /* must be written with this value */
+ }
+ }
return (Startup_DONE);
}
/*
* ======== Interrupt_intEnable ========
* Enable interrupt
+ * TODO: fix this with interrupt mask
*/
Void Interrupt_intEnable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
/*
* ======== Interrupt_intDisable ========
* Disables interrupts
+ * TODO: fix this with interrupt mask
*/
Void Interrupt_intDisable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
* ======== Interrupt_intRegister ========
* Register ISR for remote processor interrupt
*/
-Void Interrupt_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
- Fxn func, UArg arg)
+Void Interrupt_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *unused,
+ Fxn func, UArg arg)
{
- UInt key, i;
+ UInt key;
Hwi_Params hwiAttrs;
- extern volatile cregister UInt DNUM;
+ UInt16 clusterId;
+ volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
+ UInt32 val;
- /* Disable global interrupts */
+ /* disable global interrupts */
key = Hwi_disable();
- /* setup the function args using the same Hwi int */
- Interrupt_module->args[remoteProcId] = arg;
+ /* setup the function table with client function and argument */
+ clusterId = remoteProcId - Interrupt_module->baseId;
+ Interrupt_module->clientTab[clusterId].func = func;
+ Interrupt_module->clientTab[clusterId].arg = arg;
- /* Make sure the interrupt only gets plugged once */
- Interrupt_module->numPlugged++;
- if (Interrupt_module->numPlugged == 1) {
- /* set the function */
- Interrupt_module->func = func;
+ /* make sure the interrupt gets plugged only once */
+ if (Interrupt_module->numPlugged++ == 0) {
- /* Clear any pending interrupt */
- for (i = 0; i < ti_sdo_utils_MultiProc_numProcessors; i++) {
- Interrupt_intClear(i, NULL);
- }
+ /* clear all pending ipc interrupts */
+ val = ipcar[DNUM];
+ ipcar[DNUM] = val;
- /* Register interrupt to remote processor */
+ /* register ipc interrupt */
Hwi_Params_init(&hwiAttrs);
hwiAttrs.maskSetting = Hwi_MaskingOption_SELF;
- hwiAttrs.arg = arg;
- hwiAttrs.eventId = Interrupt_INTERDSPINT;
-
- Hwi_create(intInfo->intVectorId,
- (Hwi_FuncPtr)Interrupt_intShmStub, &hwiAttrs, NULL);
-
- Hwi_enableInterrupt(intInfo->intVectorId);
+ hwiAttrs.eventId = Interrupt_INTERDSPINT;
+ Interrupt_module->hwi = Hwi_create(Interrupt_ipcIntr, Interrupt_isr,
+ &hwiAttrs, NULL);
}
- /* Restore global interrupts */
+ /* restore global interrupts */
Hwi_restore(key);
}
*/
Void Interrupt_intUnregister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
{
- Hwi_Handle hwiHandle;
+ UInt key;
+ UInt16 clusterId;
- Interrupt_module->numPlugged--;
- if (Interrupt_module->numPlugged == 0) {
- /* No need to disable interrupt: Hwi_delete takes care of this */
- hwiHandle = Hwi_getHandle(intInfo->intVectorId);
- Hwi_delete(&hwiHandle);
+ /* disable global interrupts */
+ key = Hwi_disable();
- /* unset the function */
- Interrupt_module->func = NULL;
+ if (--Interrupt_module->numPlugged == 0) {
+ Hwi_delete(&Interrupt_module->hwi);
}
- /* Unset the function arg */
- Interrupt_module->args[remoteProcId] = 0;
+ /* clear function table entry */
+ clusterId = remoteProcId - Interrupt_module->baseId;
+ Interrupt_module->clientTab[clusterId].func = NULL;
+ Interrupt_module->clientTab[clusterId].arg = (UArg)(-1);
+
+ /* restore global interrupts */
+ Hwi_restore(key);
}
/*
* ======== Interrupt_intSend ========
* Send interrupt to the remote processor
*/
-Void Interrupt_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
- UArg arg)
+Void Interrupt_intSend(UInt16 procId, IInterrupt_IntInfo *unused, UArg arg)
{
UInt32 val;
- extern volatile cregister UInt DNUM;
volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
+ volatile UInt32 *ipcgrh = (volatile UInt32 *)Interrupt_IPCGRH;
+ int clusterId;
+ UInt dnum;
- /*
- * bit 0 is set to generate interrupt.
+ /* bit 0 is set to generate interrupt.
* bits 4-7 is 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 << (DNUM + Interrupt_SRCSx_SHIFT)) | 1;
- ipcgr[MultiProcSetup_procMap[remoteProcId]] = val;
+ if (procId == MultiProc_getId("HOST")) {
+ /* interrupt the host processor, use IPCGRH register */
+ *ipcgrh = val;
+ }
+ else {
+ /* compute ipcgr address for recipient processor */
+ clusterId = procId - Interrupt_module->baseId;
+ dnum = Interrupt_module->hwTab[clusterId].dnum;
+ ipcgr[dnum] = val;
+ }
}
/*
* ======== Interrupt_intPost ========
- * Send interrupt to the remote processor
+ * Post an interrupt to local processor
*/
-Void Interrupt_intPost(UInt16 srcProcId, IInterrupt_IntInfo *intInfo,
- UArg arg)
+Void Interrupt_intPost(UInt16 srcProcId, IInterrupt_IntInfo *intInfo, UArg arg)
{
+ int clusterId;
+ int bit;
UInt32 val;
- extern volatile cregister UInt DNUM;
volatile UInt32 *ipcgr = (volatile UInt32 *)Interrupt_IPCGR0;
- /*
- * bit 0 is set to generate interrupt.
- * bits 4-7 is 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 << (MultiProcSetup_procMap[srcProcId] + Interrupt_SRCSx_SHIFT)) | 1;
+ /* compute srcsx bit of source processor */
+ clusterId = srcProcId - Interrupt_module->baseId;
+ bit = Interrupt_module->hwTab[clusterId].srcsx;
+ val = (1 << bit) | 1;
- ipcgr[DNUM] = val;
+ /* raise the interrupt to myself */
+ ipcgr[DNUM] = val;
}
/*
* Does not clear the IFR bit by way of ICR write because that should
* only be done during init time.
*/
-UInt Interrupt_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
+UInt Interrupt_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *unused)
{
- extern volatile cregister UInt DNUM;
+ int clusterId;
+ int pos;
volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
+ UInt val;
+ UInt stat = 0;
+
+ /* compute srcsx bit of remote processor */
+ clusterId = remoteProcId - Interrupt_module->baseId;
+ pos = Interrupt_module->hwTab[clusterId].srcsx;
+
+ /* read ipcar register to get source bits */
+ val = ipcar[DNUM];
- ipcar[DNUM] = (1 << (MultiProcSetup_procMap[remoteProcId] +
- Interrupt_SRCSx_SHIFT));
+ if (val & (1 << pos)) {
+ /* write ipc acknowledgement register to clear source bit */
+ ipcar[DNUM] = (1 << pos);
+ stat = 1;
+ }
- return (0);
+ return (stat);
}
/*
*/
/*
- * ======== Interrupt_intShmStub ========
+ * ======== Interrupt_isr ========
*/
-Void Interrupt_intShmStub(UArg arg)
+Void Interrupt_isr(UArg unused)
{
- Int i;
- extern volatile cregister UInt DNUM;
+ int clId;
+ Interrupt_ClientEntry *entry;
volatile UInt32 *ipcar = (volatile UInt32 *)Interrupt_IPCAR0;
- UInt32 ipcarVal = ipcar[DNUM];
+ UInt32 val;
+ int bit;
+
+ /* ipc acknowledgement register value */
+ val = ipcar[DNUM];
+
+ for (clId = 0; clId < ti_sdo_utils_MultiProc_numProcsInCluster; clId++) {
+ bit = Interrupt_module->hwTab[clId].srcsx;
+
+ if (val & (1 << bit)) {
+
+ /* clear the interrupt source */
+ ipcar[DNUM] = (1 << bit);
- for (i = 0; i < ti_sdo_utils_MultiProc_numProcsInCluster; i++) {
- if ((ipcarVal) &
- (1 << (MultiProcSetup_procMap[i + MultiProc_getBaseIdOfCluster()]
- + Interrupt_SRCSx_SHIFT))) {
+ /* invoke the client isr */
+ entry = &(Interrupt_module->clientTab[clId]);
- Interrupt_module->func(Interrupt_module->args[i +
- MultiProc_getBaseIdOfCluster()]);
+ if (entry->func != NULL) {
+ (entry->func)(entry->arg);
+ }
}
}
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/Interrupt.xdc b/packages/ti/sdo/ipc/family/tci663x/Interrupt.xdc
index 2af219004c508ec455f0229c4f3005b03f4341ec..693b68a3059d452d6379141f8e8014958419e1d0 100644 (file)
/*
- * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
- * All rights reserved.
+ * Copyright (c) 2014-2015 Texas Instruments Incorporated - http://www.ti.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
*
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== Interrupt.xdc ========
*/
+package ti.sdo.ipc.family.tci663x;
import xdc.rov.ViewInfo;
+import xdc.runtime.Assert;
+import ti.sysbios.hal.Hwi;
/*!
* ======== Interrupt ========
module Interrupt inherits ti.sdo.ipc.notifyDrivers.IInterrupt
{
+
+ /*! Return value from Interrupt_intClear() when procId != HOST
+ *
+ * When acknowledging an interrupt from the host, the IPCGR register
+ * value is returned as the payload. For all other processors,
+ * Interrupt_INVALIDPAYLOAD is returned.
+ */
+ const UInt INVALIDPAYLOAD = 0xFFFFFFFF;
+
+ /*!
+ * ======== enableKick ========
+ * If set to 'true' IPC will unlock the KICK registers on C66x devices
+ *
+ * IPC unlocks the KICK registers on the local core if the local
+ * core is CORE0.
+ */
+ config Bool enableKick = true;
+
+ /*! cpu interrupt number for IPC */
+ config UInt ipcIntr = 5;
+
+ /*! Host processor must be first in MultiProc name list
+ *
+ * If the host processor is present in the MultiProc name list,
+ * it must be listed as the first member. The internal implementation
+ * depends on this ordering.
+ */
+ config Assert.Id A_hostConfig = {
+ msg: "A_hostConfig: HOST must be first in MultiProc name list"
+ };
+
+ /*! The cluster base ID has not been set
+ *
+ * The cluster base ID must be set either by the configuration script
+ * or during the startup phase by a user defined function. This assert
+ * indicates neither has been done.
+ */
+ config Assert.Id A_clusterBaseId = {
+ msg: "A_clusterBaseId: cluster base ID has not been set"
+ };
+
/* @_nodoc */
metaonly struct InterruptDataStruct {
UInt remoteCoreId;
internal:
- /*! Shift value used for setting/identifying interrupt source */
+ /* Shift value used for setting/identifying interrupt source */
const UInt SRCSx_SHIFT = 4;
- /*! Ptr to the IPC Generation Registers */
+ /* Ptr to the IPC Generation Registers */
config Ptr IPCGR0;
- /*! Ptr to the IPC Acknowledgment Registers */
+ /* Ptr to the IPC Acknowledgment Registers */
config Ptr IPCAR0;
- /*! Inter-processor interrupt id (varies per device) */
+ /* Ptr to the IPC Host Generation Host Register */
+ config Ptr IPCGRH;
+
+ /* Ptr to the IPC Acknowledgement Host Register */
+ config Ptr IPCARH;
+
+ /* Ptr to the KICK0 Bootcfg Registers */
+ config Ptr KICK0;
+
+ /* Ptr to the KICK1 Bootcfg Registers */
+ config Ptr KICK1;
+
+ /* Inter-processor interrupt id (varies per device) */
config UInt INTERDSPINT;
- /*!
- * ======== intShmStub ========
+ /* client table entry */
+ struct ClientEntry {
+ Fxn func; /* client function */
+ UArg arg; /* client argument */
+ };
+
+ /* hardware configuration data */
+ struct HwCfg {
+ UInt dnum; /* DNUM value */
+ UInt srcsx; /* source bit position */
+ };
+
+ /*
+ * ======== isr ========
* Stub function plugged as interrupt handler
*/
- Void intShmStub(UArg arg);
+ Void isr(UArg arg);
+ /*
+ * ======== Module_State ========
+ * Define the module state structure
+ */
struct Module_State {
- Fxn func;
- UInt numPlugged; /* # of times the interrupt was registered */
- UArg args[]; /* one entry for each core (in cluster) */
+ UInt numPlugged; /* # of times interrupt was registered */
+ UInt16 baseId; /* cluster base procId */
+ Hwi.Handle hwi; /* Hwi object for ipc interrupt */
+ ClientEntry clientTab[]; /* index by clusterId */
+ HwCfg hwTab[]; /* index by clusterId */
};
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/Interrupt.xs b/packages/ti/sdo/ipc/family/tci663x/Interrupt.xs
index 30ecdd56603ff939aab570af312f1d19956b5fca..e2da8ffe922a9c2078f28f6e87ab1bd8886cbbe0 100644 (file)
/*
- * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
- * All rights reserved.
+ * Copyright (c) 2014-2015 Texas Instruments Incorporated - http://www.ti.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
*
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== Interrupt.xs ========
*/
var deviceSettings = {
- /* all TCI663x devices inherit from TCI6634 according to Settings.xs */
+ /* all Keystone II devices inherit from TCI6634 */
'TMS320TCI6634' : {
IPCGR0: 0x02620240,
IPCAR0: 0x02620280,
- INTERDSPINT: 105,
- },
-}
+ IPCGRH: 0x02620260,
+ IPCARH: 0x026202A0,
+ KICK0: 0x02620038,
+ KICK1: 0x0262003C,
+ INTERDSPINT: 105
+ }
+};
+
var Settings = xdc.loadCapsule('ti/sdo/ipc/family/Settings.xs');
Settings.setDeviceAliases(deviceSettings, Settings.deviceAliases);
-var Hwi;
-var Interrupt;
-var Ipc;
var MultiProc;
-var SharedRegion;
-var MultiProcSetup;
/*
* ======== module$meta$init ========
*/
function module$meta$init()
{
- /* Only process during "cfg" phase */
+ /* only process during "cfg" phase */
if (xdc.om.$name != "cfg") {
return;
}
this.IPCGR0 = settings.IPCGR0;
this.IPCAR0 = settings.IPCAR0;
+ this.IPCGRH = settings.IPCGRH;
+ this.IPCARH = settings.IPCARH;
+ this.KICK0 = settings.KICK0;
+ this.KICK1 = settings.KICK1;
this.INTERDSPINT = settings.INTERDSPINT;
}
-
/*
* ======== module$use ========
*/
function module$use()
{
- Interrupt = this;
- Hwi = xdc.useModule("ti.sysbios.family.c64p.Hwi");
- Ipc = xdc.useModule("ti.sdo.ipc.Ipc");
- MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
- SharedRegion = xdc.useModule("ti.sdo.ipc.SharedRegion");
- MultiProcSetup = xdc.useModule("ti.sdo.ipc.family.tci663x.MultiProcSetup");
+ xdc.useModule("ti.sysbios.hal.Hwi");
+ xdc.useModule("ti.sdo.ipc.family.tci663x.MultiProcSetup");
+
+ MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
+
+ /* Hack: fix conflict between NotifyDriverCirc and VirtQueue.
+ *
+ * If both of these modules are in the configuration, then instruct
+ * the NotifyCircSetup module to exclude the host during the IPC
+ * attach phase.
+ */
+ var ncsName = this.$package.$name + ".NotifyCircSetup";
+ var vqName = "ti.ipc.family.tci6638.VirtQueue";
+
+ var notifySetup = ((ncsName in xdc.om) && xdc.module(ncsName).$used);
+ var virtQue = ((vqName in xdc.om) && xdc.module(vqName).$used);
+
+ if (notifySetup && virtQue) {
+ xdc.module(ncsName).includeHost = false;
+ }
}
/*
*/
function module$static$init(state, mod)
{
- var args = Interrupt.$object.args;
- var MultiProc = xdc.module('ti.sdo.utils.MultiProc');
+ state.numPlugged = 0;
+ state.baseId = MultiProc.baseIdOfCluster;
+ state.hwi = null;
- /* The function table length should be the number of processors */
- args.length = MultiProc.numProcessors;
- for (var i = 0; i < args.length; i++) {
- args[i] = 0;
+ /* initialize client function table */
+ state.clientTab.length = MultiProc.numProcsInCluster;
+
+ for (var i = 0; i < state.clientTab.length; i++) {
+ state.clientTab[i].func = null;
+ state.clientTab[i].arg = -1;
}
- state.func = null;
- state.numPlugged = 0;
+ /* initialize ipcar source bit mapping */
+ state.hwTab.length = MultiProc.numProcsInCluster;
+
+ for (var i = 0; i < state.hwTab.length; i++) {
+ var name = MultiProc.nameList[i];
+
+ if (name == "HOST") {
+ state.hwTab[i].dnum = MultiProc.INVALIDID;
+ /* by convention, host is bit 31 in ipcgr and ipcar registers */
+ state.hwTab[i].srcsx = 31;
+ }
+ else {
+ /* the numeric part of the name string determines the coreId */
+ var coreId = Number(name.substring("CORE".length));
+ state.hwTab[i].dnum = coreId;
+ state.hwTab[i].srcsx = coreId + mod.SRCSx_SHIFT;
+ }
+ }
}
/*
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 clientTab = Program.fetchArray(Interrupt.clientTab$fetchDesc,
+ mod.clientTab, MultiProcCfg.numProcessors);
var localId = MultiProc.self$view();
$addr(modCfg.IPCAR0), MultiProcCfg.numProcessors, false);
}
- for (var i = 0; i < MultiProcCfg.numProcessors; i++) {
+ for (var i = 0; i < MultiProcCfg.numProcsInCluster; i++) {
var entryView =
Program.newViewStruct('ti.sdo.ipc.family.tci663x.Interrupt',
'Registered Interrupts');
- entryView.remoteCoreId = i;
- if (Number(mod.func) != 0) {
- entryView.isrFxn =
- Program.lookupFuncName(Number(mod.func))[0];
- entryView.isrArg = "0x" + Number(args[i]).toString(16);
+
+ entryView.remoteCoreId = MultiProc.baseIdOfCluster + i;
+
+ var fxn = Number(clientTab[i].func);
+ if (fxn != 0) {
+ entryView.isrFxn = Program.lookupFuncName(fxn)[0];
+ entryView.isrArg = "0x" + Number(clientTab[i].arg).toString(16);
}
else {
entryView.isrFxn = "(unplugged)";
}
}
-
view.elements.$add(entryView);
}
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xdc b/packages/ti/sdo/ipc/family/tci663x/MultiProcSetup.xdc
index 9f729156f268e9959f7a024f82497173bc13246d..8230ad2ba40de89a9c02ee95e61bc00905e22657 100644 (file)
};
internal:
- /* Map the clusterId to the coreId (only for DSP processos)
+ /* Map the clusterId to the coreId (only for DSP processors)
*
* The procMap array is indexed by clusterId. The element value
* is the coreId (equivalent to DNUM).
diff --git a/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.c b/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.c
index f13509da4d1db21a9e8af452a1177b24e222d8d9..001216f526b9f4681b1cff787f5fef570a1c6794 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
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== NotifyCircSetup.c ========
*/
-
#include <xdc/std.h>
-#include <ti/sdo/ipc/notifyDrivers/NotifyDriverCirc.h>
-#include <ti/sdo/ipc/_Notify.h>
-
#include <xdc/runtime/Error.h>
+#include <ti/ipc/MultiProc.h>
+#include <ti/sdo/ipc/_Notify.h>
+#include <ti/sdo/ipc/notifyDrivers/NotifyDriverCirc.h>
+
#include "package/internal/NotifyCircSetup.xdc.h"
+
/*!
* ======== NotifyCircSetup_attach ========
*/
Int NotifyCircSetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
- NotifyDriverCirc_Params notifyShmParams;
- NotifyDriverCirc_Handle shmDrvHandle;
+ NotifyDriverCirc_Params notifyCircParams;
+ NotifyDriverCirc_Handle circDrvHandle;
ti_sdo_ipc_Notify_Handle notifyHandle;
Error_Block eb;
Error_init(&eb);
/* init params and set default values */
- NotifyDriverCirc_Params_init(¬ifyShmParams);
- notifyShmParams.intVectorId = NotifyCircSetup_dspIntVectId;
- notifyShmParams.sharedAddr = sharedAddr;
- notifyShmParams.remoteProcId = remoteProcId;
+ NotifyDriverCirc_Params_init(¬ifyCircParams);
+ notifyCircParams.sharedAddr = sharedAddr;
+ notifyCircParams.remoteProcId = remoteProcId;
- shmDrvHandle = NotifyDriverCirc_create(¬ifyShmParams, &eb);
- if (shmDrvHandle == NULL) {
+ circDrvHandle = NotifyDriverCirc_create(¬ifyCircParams, &eb);
+
+ if (circDrvHandle == NULL) {
return (Notify_E_FAIL);
}
notifyHandle = ti_sdo_ipc_Notify_create(
- NotifyDriverCirc_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL,
- &eb);
- if (notifyHandle == NULL) {
- NotifyDriverCirc_delete(&shmDrvHandle);
+ NotifyDriverCirc_Handle_upCast(circDrvHandle), remoteProcId,
+ 0, NULL, &eb);
+ if (notifyHandle == NULL) {
+ NotifyDriverCirc_delete(&circDrvHandle);
return (Notify_E_FAIL);
}
*/
SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
{
- SizeT memReq;
NotifyDriverCirc_Params params;
+ SizeT memReq;
NotifyDriverCirc_Params_init(¶ms);
- params.sharedAddr = sharedAddr;
- params.intVectorId = NotifyCircSetup_dspIntVectId;
- params.remoteProcId = remoteProcId;
+ params.sharedAddr = sharedAddr;
+ params.remoteProcId = remoteProcId;
memReq = NotifyDriverCirc_sharedMemReq(¶ms);
- return(memReq);
+ return (memReq);
}
/*!
*/
UInt16 NotifyCircSetup_numIntLines(UInt16 remoteProcId)
{
- return (1);
+ UInt16 rval;
+
+ if (remoteProcId == MultiProc_getId("HOST")) {
+ rval = NotifyCircSetup_includeHost ? 1 : 0;
+ }
+ else {
+ rval = 1;
+ }
+
+ return (rval);
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.xdc b/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.xdc
index a68a7182aaa24048d78b57440559ce0a5f1ab972..8709a94fe96bb5d4a84469b51a29428ddb2594e1 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
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== NotifyCircSetup.xdc ========
- *
*/
/*!
/* The interrupt vector id */
config UInt dspIntVectId = 5;
+ /* Setup notify driver with host.
+ *
+ * When this config parameter is true, the host processor will
+ * be included in the IPC attach phase which will ultimately
+ * create an instance of the notify circ driver. When set to
+ * false, the host is excluded.
+ */
+ config Bool includeHost = true;
+
internal:
}
diff --git a/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.xs b/packages/ti/sdo/ipc/family/tci663x/NotifyCircSetup.xs
index 0648fbbf17a7e74bcd1f55e9d80d87fc7daa83db..0f8a5011a8a43c15b767009d0363047f5b4f0b67 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
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== NotifyCircSetup.xs ========
- *
*/
-var NotifyCircSetup = null;
-var MultiProc = null;
-var MultiProcSetup = null;
-var Notify = null;
-var NotifyDriverShm = null;
/*
* ======== module$use ========
*/
function module$use()
{
- NotifyCircSetup = this;
- NotifyDriverCirc = xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
- Notify = xdc.useModule('ti.sdo.ipc.Notify');
- MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
- MultiProcSetup = xdc.useModule('ti.sdo.ipc.family.tci663x.MultiProcSetup');
+ xdc.useModule('ti.sdo.ipc.family.tci663x.MultiProcSetup');
+ xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
+ xdc.useModule('ti.sdo.utils.MultiProc');
+
+ if (this.$written("dspIntVectId")) {
+ this.$logWarning("The configuration parameter 'dspIntVectId' has "
+ + "been deprecated. To specify the CPU interrupt number for "
+ + "IPC, please refer to the interrupt delegate.", this);
+ }
}