SDOCM00106428 Add notify mailbox driver support on DRA7xx (Part 3)
authorRamsey Harris <ramsey@ti.com>
Fri, 21 Feb 2014 17:51:14 +0000 (09:51 -0800)
committerChris Ring <cring@ti.com>
Mon, 24 Feb 2014 16:53:58 +0000 (08:53 -0800)
Added notify mailbox driver support for ARP32. The IPC interrupt on
arp32 will dispatch to the appropriate driver (shm or mbx). This
improves the NotifyDriverShm performance because it checks only the
mailboxes which might have raised the given event instead of always
checking all mailboxes. Improved ROV view of NotifyDriverMbx. Added
a mailbox tab which shows inbound and outbound mailbox status. Better
ISA handling in source code and script code.

packages/ti/sdo/ipc/family/vayu/InterruptArp32.c
packages/ti/sdo/ipc/family/vayu/InterruptArp32.xdc
packages/ti/sdo/ipc/family/vayu/InterruptArp32.xs
packages/ti/sdo/ipc/family/vayu/InterruptDsp.c
packages/ti/sdo/ipc/family/vayu/InterruptDsp.xs
packages/ti/sdo/ipc/family/vayu/NotifyDriverMbx.c
packages/ti/sdo/ipc/family/vayu/NotifyDriverMbx.xdc
packages/ti/sdo/ipc/family/vayu/NotifyDriverMbx.xs
packages/ti/sdo/ipc/family/vayu/NotifySetup.c
packages/ti/sdo/ipc/family/vayu/NotifySetup.xdc
packages/ti/sdo/ipc/family/vayu/NotifySetup.xs

index 6d706d12486b9c7f99b08a298f9e1d59b3568397..8b0fdbe2c9e1c6afe3cb8a5f0ebc69875ab2e8cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 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.
  */
+
 /*
  *  ======== InterruptArp32.c ========
  *  ARP32 mailbox based interrupt manager
  */
-
 #include <xdc/std.h>
 #include <xdc/runtime/Assert.h>
 #include <xdc/runtime/Error.h>
 
 #include <ti/sysbios/family/arp32/Hwi.h>
 
-#include <ti/sdo/utils/_MultiProc.h>
 #include <ti/sdo/ipc/_Ipc.h>
+#include <ti/sdo/ipc/family/vayu/NotifySetup.h>
 #include <ti/sdo/ipc/notifyDrivers/IInterrupt.h>
+#include <ti/sdo/utils/_MultiProc.h>
 
 #include "package/internal/InterruptArp32.xdc.h"
 
@@ -113,8 +114,7 @@ Void InterruptArp32_intEnable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
  *  ======== InterruptArp32_intDisable ========
  *  Disables remote processor interrupt
  */
-Void InterruptArp32_intDisable(UInt16 remoteProcId,
-                                IInterrupt_IntInfo *intInfo)
+Void InterruptArp32_intDisable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
 {
     UInt16 index;
 
@@ -127,13 +127,10 @@ Void InterruptArp32_intDisable(UInt16 remoteProcId,
  *  ======== InterruptArp32_intRegister ========
  */
 Void InterruptArp32_intRegister(UInt16 remoteProcId,
-                                 IInterrupt_IntInfo *intInfo,
-                                 Fxn func, UArg arg)
+        IInterrupt_IntInfo *intInfo, Fxn func, UArg arg)
 {
     UInt        key;
     UInt16      index;
-    UInt        mbxIdx;
-    Hwi_Params  hwiAttrs;
     Error_Block eb;
     InterruptArp32_FxnTable *table;
 
@@ -161,31 +158,9 @@ Void InterruptArp32_intRegister(UInt16 remoteProcId,
 
     InterruptArp32_intClear(remoteProcId, intInfo);
 
-    if ((index == DSP1_ID) || (index == IPU1_ID) || (index == HOST_ID)) {
-        mbxIdx = 0;
-    }
-    else if ((index == DSP2_ID) || (index == IPU2_ID) ||
-             (index == IPU1_1_ID) || (index == IPU2_1_ID)) {
-        mbxIdx = 1;
-    }
-    else if (index < InterruptArp32_NUM_EVES) {
-        mbxIdx = 2;
-    }
-
-    /* Make sure the interrupt only gets plugged once */
-    InterruptArp32_module->numPlugged[mbxIdx]++;
-    if (InterruptArp32_module->numPlugged[mbxIdx] == 1) {
-        /* Register interrupt to remote processor */
-        Hwi_Params_init(&hwiAttrs);
-        hwiAttrs.arg = arg;
-        hwiAttrs.vectorNum = intInfo->intVectorId;
-
-        Hwi_create(InterruptArp32_eveInterruptTable[index],
-                  (Hwi_FuncPtr)InterruptArp32_intShmStub,
-                   &hwiAttrs,
-                   &eb);
-        Hwi_enableInterrupt(InterruptArp32_eveInterruptTable[index]);
-    }
+    /* plug the cpu interrupt */
+    NotifySetup_plugHwi(remoteProcId, intInfo->intVectorId,
+            InterruptArp32_intShmStub);
 
     /* enable the mailbox and Hwi */
     InterruptArp32_intEnable(remoteProcId, intInfo);
@@ -201,41 +176,22 @@ Void InterruptArp32_intUnregister(UInt16 remoteProcId,
                                    IInterrupt_IntInfo *intInfo)
 {
     UInt16 index;
-    UInt   mbxIdx;
-    Hwi_Handle  hwiHandle;
     InterruptArp32_FxnTable *table;
 
     index = PROCID(remoteProcId);
 
-    if ((remoteProcId == DSP1_ID) || (remoteProcId == IPU1_ID) ||
-        (remoteProcId == HOST_ID)) {
-        mbxIdx = 0;
-    }
-    else if ((remoteProcId == DSP2_ID) || (remoteProcId == IPU2_ID) ||
-        (remoteProcId == IPU1_1_ID) || (remoteProcId == IPU2_1_ID)) {
-        mbxIdx = 1;
-    }
-    else if (remoteProcId < InterruptArp32_NUM_EVES) {
-        mbxIdx = 2;
-    }
-
-    /* Disable the mailbox interrupt source */
+    /* disable the mailbox interrupt source */
     InterruptArp32_intDisable(remoteProcId, intInfo);
 
-    InterruptArp32_module->numPlugged[mbxIdx]--;
-    if (InterruptArp32_module->numPlugged[mbxIdx] == 0) {
-        /* Delete the Hwi */
-        hwiHandle = Hwi_getHandle(InterruptArp32_eveInterruptTable[index]);
-        Hwi_delete(&hwiHandle);
-    }
+    /* unplug isr */
+    NotifySetup_unplugHwi(remoteProcId, intInfo->intVectorId);
 
     /* Clear the FxnTable entry for the remote processor */
     table = &(InterruptArp32_module->fxnTable[index]);
     table->func = NULL;
-    table->arg  = 0;
+    table->arg = 0;
 }
 
-
 /*
  *  ======== InterruptArp32_intSend ========
  *  Send interrupt to the remote processor
@@ -260,7 +216,6 @@ Void InterruptArp32_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
     Hwi_restore(key);
 }
 
-
 /*
  *  ======== InterruptArp32_intPost ========
  *  Simulate an interrupt from a remote processor
@@ -316,29 +271,12 @@ UInt InterruptArp32_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
 /*
  *  ======== InterruptArp32_intShmStub ========
  */
-Void InterruptArp32_intShmStub(UArg arg)
+Void InterruptArp32_intShmStub(UInt16 idx)
 {
-    UInt16 index;
-    UInt16 selfIdx;
-    UInt16 loopIdx;
+    UInt16 srcVirtId;
     InterruptArp32_FxnTable *table;
 
-    selfIdx = MultiProc_self();
-
-    for (loopIdx = 0; loopIdx < MultiProc_getNumProcsInCluster(); loopIdx++) {
-
-        if (loopIdx == selfIdx) {
-            continue;
-        }
-
-        index = MBX_TABLE_IDX(loopIdx, selfIdx);
-
-        if ((REG32(MAILBOX_STATUS(index)) != 0) &&
-            (REG32(MAILBOX_IRQENABLE_SET(index)) &
-             MAILBOX_REG_VAL(SUBMBX_IDX(index)))) {
-            /* call function with arg */
-            table = &(InterruptArp32_module->fxnTable[PROCID(loopIdx)]);
-            (table->func)(table->arg);
-        }
-    }
+    srcVirtId = idx / InterruptArp32_NUM_CORES;
+    table = &(InterruptArp32_module->fxnTable[srcVirtId]);
+    (table->func)(table->arg);
 }
index ed7246d07b07fedd95b6dc34c8ee2a5ddd7f76cf..40d5c9a84ceebd2565e3f0e3c8e9b51372851c08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 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.
  */
+
 /*
  *  ======== InterruptArp32.xdc ========
- *
  */
+package ti.sdo.ipc.family.vayu;
 
 import ti.sdo.utils.MultiProc;
 
@@ -40,7 +41,6 @@ import ti.sdo.utils.MultiProc;
  *  ======== InterruptArp32 ========
  *  ARP32 based interrupt manager
  */
-
 module InterruptArp32 inherits ti.sdo.ipc.notifyDrivers.IInterrupt
 {
     /* Total number of cores on Vayu SoC */
@@ -58,6 +58,8 @@ module InterruptArp32 inherits ti.sdo.ipc.notifyDrivers.IInterrupt
     /* Base address for the Mailbox subsystem */
     config UInt32 mailboxBaseAddr[NUM_EVE_MBX + NUM_SYS_MBX];
 
+internal:
+
     /*
      * Mailbox table for storing encoded Base Address, mailbox user Id,
      * and sub-mailbox index.
@@ -68,8 +70,6 @@ module InterruptArp32 inherits ti.sdo.ipc.notifyDrivers.IInterrupt
 
     config UInt32 procIdTable[NUM_CORES];
 
-internal:
-
     /*! Statically retrieve procIds to avoid doing this at runtime */
     config UInt eve1ProcId     = MultiProc.INVALIDID;
     config UInt eve2ProcId     = MultiProc.INVALIDID;
@@ -90,14 +90,14 @@ internal:
     }
 
     /*! Stub to be plugged for dsp-arp32 interrupts */
-    Void intShmStub(UArg arg);
+    Void intShmStub(UInt16 idx);
 
     struct Module_State {
-        /*
-         * Create a function table of length 8 (Total number of cores in the
-         * System) for each EVE core.
+
+        /*  Interrupt isr dispatch table. This table is indexed
+         *  by virtual processor ID.
          */
-        FxnTable   fxnTable[NUM_CORES];
+        FxnTable fxnTable[NUM_CORES];
 
         /*
          * numPlugged is used to track number of times the interrupt was
index 8716ecba0f95ae75adc3d2634330e98b49db2a83..66e250f52cfd69785dba99912806e06ec5800475 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 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.
  */
+
 /*
  *  ======== InterruptArp32.xs ========
- *
  */
-
-var Hwi         = null;
-var Core        = null;
-var MultiProc   = null;
-var InterruptArp32       = null;
+var InterruptArp32 = null;
 
 /*
  *  ======== module$use ========
  */
 function module$use()
 {
-    Hwi              = xdc.useModule("ti.sysbios.family.arp32.Hwi");
-    MultiProc        = xdc.useModule("ti.sdo.utils.MultiProc");
-    Ipc              = xdc.useModule("ti.sdo.ipc.Ipc");
-    InterruptArp32   = xdc.useModule("ti.sdo.ipc.family.vayu.InterruptArp32");
-    TableInit        = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
+    var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
+    var MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
+    InterruptArp32 = this;
+
+    xdc.useModule('xdc.runtime.Assert');
+    xdc.useModule('xdc.runtime.Error');
+    xdc.useModule("ti.sysbios.family.arp32.Hwi");
+    xdc.useModule("ti.sdo.ipc.Ipc");
+    xdc.useModule('ti.sdo.ipc.family.vayu.NotifySetup');
+    xdc.useModule('ti.sdo.ipc.notifyDrivers.IInterrupt');
 
     /* Initialize procIdTable */
     TableInit.initProcId(InterruptArp32);
@@ -104,7 +105,7 @@ function module$use()
     /*
      * In case of a spec change, follow the process shown below:
      * 1. Update the mailboxBaseAddr Table.
-     * 2. Update the dspInterruptTable.
+     * 2. Update the eveInterruptTable.
      * 3. Update Virtual Index assignment.
      * 4. Update NUMCORES, NUMEVES and EVEMBX2BASEIDX variables
      *    in order to correctly intialize the mailboxTable.
@@ -115,17 +116,16 @@ function module$use()
  *  ======== module$static$init ========
  *  Initialize module values.
  */
-function module$static$init(mod, params)
+function module$static$init(state, mod)
 {
-    var idx;
-    var remoteProcId;
+    var i;
 
-    for (remoteProcId=0; remoteProcId < InterruptArp32.procIdTable.length; remoteProcId++) {
-        mod.fxnTable[remoteProcId].func  = null;
-        mod.fxnTable[remoteProcId].arg   = 0;
+    for (i = 0; i < mod.procIdTable.length; i++) {
+        state.fxnTable[i].func  = null;
+        state.fxnTable[i].arg   = 0;
     }
 
-    for (idx = 0; idx < (InterruptArp32.NUM_EVE_MBX/InterruptArp32.NUM_EVES); idx++) {
-        mod.numPlugged[idx] = 0;
+    for (i = 0; i < (mod.NUM_EVE_MBX/mod.NUM_EVES); i++) {
+        state.numPlugged[i] = 0;
     }
 }
index 560083b1bb566ff0654cbaf5ade67cc84d4c5f87..907f85c9d0f21376a23f9940579ef2bc30a86110 100644 (file)
@@ -29,6 +29,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== InterruptDsp.c ========
  *  Mailbox 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/family/c64p/EventCombiner.h>
+#include <ti/sysbios/family/c64p/Hwi.h>
 #include <ti/sysbios/family/shared/vayu/IntXbar.h>
 
 #include <ti/sdo/ipc/_Ipc.h>
@@ -242,7 +242,7 @@ Void InterruptDsp_intUnregister(UInt16 remoteProcId,
 
     index = PROCID(remoteProcId);
 
-    /* Disable the mailbox interrupt source */
+    /* disable the mailbox interrupt source */
     InterruptDsp_intDisable(remoteProcId, intInfo);
 
     /* unplug isr and unprogram the event dispatcher */
index 65a9b41b4f1236aa8152647a7352e06296c691c7..787964c5a980530682edcddf02f0c6cf8cd5cecb 100644 (file)
@@ -33,7 +33,6 @@
 /*
  *  ======== InterruptDsp.xs ========
  */
-
 var InterruptDsp = null;
 
 /*
@@ -41,12 +40,18 @@ var InterruptDsp = null;
  */
 function module$use()
 {
+    /* load modules needed in meta domain and in target domain */
     var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
     InterruptDsp = this;
-    xdc.useModule("ti.sysbios.family.c64p.EventCombiner");
-    xdc.useModule("ti.sysbios.family.c64p.Hwi");
-    xdc.useModule("ti.sysbios.family.shared.vayu.IntXbar");
-    xdc.useModule("ti.sdo.ipc.Ipc");
+    xdc.useModule('xdc.runtime.Assert');
+    xdc.useModule('xdc.runtime.Startup');
+    xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+    xdc.useModule('ti.sysbios.family.c64p.Hwi');
+    xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+    xdc.useModule('ti.sdo.ipc.Ipc');
+    xdc.useModule('ti.sdo.ipc.family.vayu.NotifySetup');
+    xdc.useModule('ti.sdo.ipc.notifyDrivers.IInterrupt');
+    xdc.useModule('ti.sdo.utils.MultiProc');
 
     /* Initialize procIdTable */
     TableInit.initProcId(InterruptDsp);
index 987500ae220f6a07737044e25fb5efdc08403546..aa63a36609903593e27a0742d778f7e7e08da611 100644 (file)
@@ -33,7 +33,6 @@
 /*
  *  ======== NotifyDriverMbx.c ========
  */
-
 #include <xdc/std.h>
 #include <xdc/runtime/Assert.h>
 #include <xdc/runtime/Startup.h>
  */
 Int NotifyDriverMbx_Module_startup(Int phase)
 {
-#if defined(xdc_target__isaCompatible_64)
+#if defined(xdc_target__isaCompatible_64P)
+
     extern cregister volatile UInt DNUM;
 
     if (IntXbar_Module_startupDone()) {
@@ -180,12 +180,27 @@ Int NotifyDriverMbx_Module_startup(Int phase)
         }
         return (Startup_DONE);
     }
+
+    return (Startup_NOTDONE);
+
+#elif defined(xdc_target__isaCompatible_arp32)
+
+    /* nothing to do on this processor */
+    return (Startup_DONE);
+
 #elif defined(xdc_target__isaCompatible_v7M)
 
-#else
+    /* TODO */
+    return (Startup_DONE);
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+    /* TODO */
+    return (Startup_DONE);
 
+#else
+#error Invalid target
 #endif
-    return (Startup_NOTDONE);
 }
 
 /*
@@ -204,14 +219,11 @@ Void NotifyDriverMbx_Instance_init(NotifyDriverMbx_Object *obj,
     UInt16      selfVirtId;
     UInt16      index;
 
-    /*
-     * Check whether remote proc ID has been set and isn't the same as the
-     * local proc ID
-     */
     Assert_isTrue((params->remoteProcId != MultiProc_INVALIDID) &&
             (params->remoteProcId != MultiProc_self()),
             ti_sdo_ipc_Ipc_A_invParam);
 
+    /* TODO: this check is weak */
     if (params->remoteProcId >= MultiProc_getNumProcessors() ||
         params->remoteProcId == MultiProc_INVALIDID) {
         return;    /* keep Coverity happy */
@@ -229,7 +241,7 @@ Void NotifyDriverMbx_Instance_init(NotifyDriverMbx_Object *obj,
     /* clear mailbox of any old messages */
     selfVirtId = PROCID(MultiProc_self());
     index = (selfVirtId * NotifyDriverMbx_NUM_CORES) + obj->remoteVirtId;
-    MAILBOX_INIT(index)
+    MAILBOX_INIT(index);
 
     /* must use processor virtual ID to store driver handle in table */
     NotifyDriverMbx_module->drvHandles[obj->remoteVirtId] = obj;
@@ -241,7 +253,7 @@ Void NotifyDriverMbx_Instance_init(NotifyDriverMbx_Object *obj,
     /* enable the mailbox interrupt from the remote core */
     NotifyDriverMbx_enable(obj);
 
-    /* Restore global interrupts */
+    /* restore global interrupts */
     Hwi_restore(key);
 }
 
@@ -358,53 +370,51 @@ Int NotifyDriverMbx_sendEvent(NotifyDriverMbx_Object *obj, UInt32 eventId,
         numMsgs = 2;
     }
 
-#if defined(xdc_target__isaCompatible_64)
+#if defined(xdc_target__isaCompatible_64P) || \
+    defined(xdc_target__isaCompatible_arp32)
+
     index = (selfVirtId * NotifyDriverMbx_NUM_CORES) + obj->remoteVirtId;
     PUT_NOTIFICATION(index);
 
 #elif defined(xdc_target__isaCompatible_v7M)
 
-#if 0
-    if (!(BIOS_smpEnabled) && (Core_getId())) {
-        if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            PUT_NOTIFICATION(VPSS_TO_DSP)
-        }
-        else if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            PUT_NOTIFICATION(VPSS_TO_HOST)
-        }
-        else {
-            PUT_NOTIFICATION(VPSS_TO_VIDEO)
-        }
-    }
-    else {
-        if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            PUT_NOTIFICATION(VIDEO_TO_DSP)
-        }
-        else if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            PUT_NOTIFICATION(VIDEO_TO_HOST)
-        }
-        else {
-            PUT_NOTIFICATION(VIDEO_TO_VPSS)
-        }
-    }
-
-#endif
+//  if (!(BIOS_smpEnabled) && (Core_getId())) {
+//      if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          PUT_NOTIFICATION(VPSS_TO_DSP)
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          PUT_NOTIFICATION(VPSS_TO_HOST)
+//      }
+//      else {
+//          PUT_NOTIFICATION(VPSS_TO_VIDEO)
+//      }
+//  }
+//  else {
+//      if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          PUT_NOTIFICATION(VIDEO_TO_DSP)
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          PUT_NOTIFICATION(VIDEO_TO_HOST)
+//      }
+//      else {
+//          PUT_NOTIFICATION(VIDEO_TO_VPSS)
+//      }
+//  }
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+//  if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//      PUT_NOTIFICATION(HOST_TO_DSP)
+//  }
+//  else if (remoteProcId == NotifyDriverMbx_videoProcId) {
+//      PUT_NOTIFICATION(HOST_TO_VIDEO)
+//  }
+//  else {
+//      PUT_NOTIFICATION(HOST_TO_VPSS)
+//  }
 
 #else
-
-#if 0
-    if (remoteProcId == NotifyDriverMbx_dspProcId) {
-        PUT_NOTIFICATION(HOST_TO_DSP)
-    }
-    else if (remoteProcId == NotifyDriverMbx_videoProcId) {
-        PUT_NOTIFICATION(HOST_TO_VIDEO)
-    }
-    else {
-        PUT_NOTIFICATION(HOST_TO_VPSS)
-    }
-
-#endif
-
+#error Invalid target
 #endif
 
     return (Notify_S_SUCCESS);
@@ -418,51 +428,51 @@ Void NotifyDriverMbx_disable(NotifyDriverMbx_Object *obj)
     UInt16 selfVirtId = PROCID(MultiProc_self());
     UInt16 index;
 
-#if defined(xdc_target__isaCompatible_64)
+#if defined(xdc_target__isaCompatible_64P) || \
+    defined(xdc_target__isaCompatible_arp32)
+
     index = (obj->remoteVirtId * NotifyDriverMbx_NUM_CORES) + selfVirtId;
     REG32(MAILBOX_IRQENABLE_CLR(index)) = MAILBOX_REG_VAL(SUBMBX_IDX(index));
 
 #elif defined(xdc_target__isaCompatible_v7M)
 
-#if 0
-    if (!(BIOS_smpEnabled) && (Core_getId())) {
-        if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(HOST_TO_VPSS);
-        }
-        else if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
-        }
-        else {
-            REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(VIDEO_TO_VPSS);
-        }
-    }
-    else {
-        if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(HOST_TO_VIDEO);
-        }
-        else if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(DSP_TO_VIDEO);
-        }
-        else {
-            REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(VPSS_TO_VIDEO);
-        }
-    }
-#endif
+//  if (!(BIOS_smpEnabled) && (Core_getId())) {
+//      if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(HOST_TO_VPSS);
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
+//      }
+//      else {
+//          REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(VIDEO_TO_VPSS);
+//      }
+//  }
+//  else {
+//      if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(HOST_TO_VIDEO);
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(DSP_TO_VIDEO);
+//      }
+//      else {
+//          REG32(MAILBOX_IRQENABLE_CLR_VIDEO) = MAILBOX_REG_VAL(VPSS_TO_VIDEO);
+//      }
+//  }
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+//  if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//      REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(DSP_TO_HOST);
+//  }
+//  else if (remoteProcId == NotifyDriverMbx_videoProcId) {
+//      REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(VIDEO_TO_HOST);
+//  }
+//  else {
+//      REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(VPSS_TO_HOST);
+//  }
 
 #else
-
-#if 0
-    if (remoteProcId == NotifyDriverMbx_dspProcId) {
-        REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(DSP_TO_HOST);
-    }
-    else if (remoteProcId == NotifyDriverMbx_videoProcId) {
-        REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(VIDEO_TO_HOST);
-    }
-    else {
-        REG32(MAILBOX_IRQENABLE_CLR_HOST) = MAILBOX_REG_VAL(VPSS_TO_HOST);
-    }
-#endif
-
+#error Invalid target
 #endif
 }
 
@@ -474,51 +484,51 @@ Void NotifyDriverMbx_enable(NotifyDriverMbx_Object *obj)
     UInt16 selfVirtId = PROCID(MultiProc_self());
     UInt16 index;
 
-#if defined(xdc_target__isaCompatible_64)
+#if defined(xdc_target__isaCompatible_64P) || \
+    defined(xdc_target__isaCompatible_arp32)
+
     index = (obj->remoteVirtId * NotifyDriverMbx_NUM_CORES) + selfVirtId;
     REG32(MAILBOX_IRQENABLE_SET(index)) = MAILBOX_REG_VAL(SUBMBX_IDX(index));
 
 #elif defined(xdc_target__isaCompatible_v7M)
 
-#if 0
-    if (!(BIOS_smpEnabled) && (Core_getId())) {
-        if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(HOST_TO_VPSS);
-        }
-        else if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
-        }
-        else {
-            REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(VIDEO_TO_VPSS);
-        }
-    }
-    else {
-        if (remoteProcId == NotifyDriverMbx_hostProcId) {
-            REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(HOST_TO_VIDEO);
-        }
-        else if (remoteProcId == NotifyDriverMbx_dspProcId) {
-            REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(DSP_TO_VIDEO);
-        }
-        else {
-            REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(VPSS_TO_VIDEO);
-        }
-    }
-#endif
+//  if (!(BIOS_smpEnabled) && (Core_getId())) {
+//      if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(HOST_TO_VPSS);
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
+//      }
+//      else {
+//          REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(VIDEO_TO_VPSS);
+//      }
+//  }
+//  else {
+//      if (remoteProcId == NotifyDriverMbx_hostProcId) {
+//          REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(HOST_TO_VIDEO);
+//      }
+//      else if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//          REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(DSP_TO_VIDEO);
+//      }
+//      else {
+//          REG32(MAILBOX_IRQENABLE_SET_VIDEO) = MAILBOX_REG_VAL(VPSS_TO_VIDEO);
+//      }
+//  }
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+//  if (remoteProcId == NotifyDriverMbx_dspProcId) {
+//      REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(DSP_TO_HOST);
+//  }
+//  else if (remoteProcId == NotifyDriverMbx_videoProcId) {
+//      REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(VIDEO_TO_HOST);
+//  }
+//  else {
+//      REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(VPSS_TO_HOST);
+//  }
 
 #else
-
-#if 0
-    if (remoteProcId == NotifyDriverMbx_dspProcId) {
-        REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(DSP_TO_HOST);
-    }
-    else if (remoteProcId == NotifyDriverMbx_videoProcId) {
-        REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(VIDEO_TO_HOST);
-    }
-    else {
-        REG32(MAILBOX_IRQENABLE_SET_HOST) = MAILBOX_REG_VAL(VPSS_TO_HOST);
-    }
-#endif
-
+#error Invalid target
 #endif
 }
 
@@ -582,7 +592,9 @@ Void NotifyDriverMbx_isr(UInt16 idx)
     UInt32 msg, payload;
     UInt16 eventId;
 
-#if defined(xdc_target__isaCompatible_64)
+#if defined(xdc_target__isaCompatible_64P) || \
+    defined(xdc_target__isaCompatible_arp32)
+
     UInt16 srcVirtId;
 
     srcVirtId = idx / NotifyDriverMbx_NUM_CORES;
@@ -590,35 +602,33 @@ Void NotifyDriverMbx_isr(UInt16 idx)
 
 #elif defined(xdc_target__isaCompatible_v7M)
 
-#if 0
-    do {
-        numProcessed = 0;
-        if (!(BIOS_smpEnabled) && (Core_getId())) {
-            GET_NOTIFICATION(VPSS, HOST)
-            GET_NOTIFICATION(VPSS, DSP)
-            GET_NOTIFICATION(VPSS, VIDEO)
-        }
-        else {
-            GET_NOTIFICATION(VIDEO, HOST)
-            GET_NOTIFICATION(VIDEO, DSP)
-            GET_NOTIFICATION(VIDEO, VPSS)
-        }
-    }
-    while (numProcessed != 0);
-#endif
+//  do {
+//      numProcessed = 0;
+//      if (!(BIOS_smpEnabled) && (Core_getId())) {
+//          GET_NOTIFICATION(VPSS, HOST)
+//          GET_NOTIFICATION(VPSS, DSP)
+//          GET_NOTIFICATION(VPSS, VIDEO)
+//      }
+//      else {
+//          GET_NOTIFICATION(VIDEO, HOST)
+//          GET_NOTIFICATION(VIDEO, DSP)
+//          GET_NOTIFICATION(VIDEO, VPSS)
+//      }
+//  }
+//  while (numProcessed != 0);
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+//  do {
+//      numProcessed = 0;
+//      GET_NOTIFICATION(HOST, DSP)
+//      GET_NOTIFICATION(HOST, VPSS)
+//      GET_NOTIFICATION(HOST, VIDEO)
+//  }
+//  while (numProcessed != 0);
 
 #else
-
-#if 0
-    do {
-        numProcessed = 0;
-        GET_NOTIFICATION(HOST, DSP)
-        GET_NOTIFICATION(HOST, VPSS)
-        GET_NOTIFICATION(HOST, VIDEO)
-    }
-    while (numProcessed != 0);
-#endif
-
+#error Invalid target
 #endif
 }
 
index f6b4d8e4d92e52741a7cd5a7a9b11f127c0fc457..3fe0be765c227cb05a3230416896b2a8bed296e7 100644 (file)
@@ -81,9 +81,15 @@ module NotifyDriverMbx inherits ti.sdo.ipc.interfaces.INotifyDriver
     /*! @_nodoc */
     metaonly struct BasicView {
         String      remoteProc;
+    }
+
+    /*! @_nodoc */
+    metaonly struct MailboxView {
+        String      direction;
         String      mailboxAddr;
         Int         subMbxId;
-        Int         count;
+        Int         msgCount;
+        Int         mbxInterrupt;
     }
 
     /*!  @_nodoc */
@@ -105,6 +111,13 @@ module NotifyDriverMbx inherits ti.sdo.ipc.interfaces.INotifyDriver
                         viewInitFxn: 'viewInitBasic',
                         structName: 'BasicView'
                     }
+                ],
+                ['Mailbox',
+                    {
+                        type: ViewInfo.INSTANCE_DATA,
+                        viewInitFxn: 'viewInitMailbox',
+                        structName: 'MailboxView'
+                    }
                 ]
 //              ['Module',
 //                  {
index be8251d7146d38ed46309beb8b90514b79419519..510ef86f76ee9633e39d8a0c75363fb1c2b99271 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2014, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 /*
  *  ======== NotifyDriverMbx.xs ================
  */
-
 var NotifyDriverMbx = null;
 var Core = null;
+var isaChain = "";
 
 /*
  *  ======== module$use ========
  */
 function module$use()
 {
+    /* load modules needed in meta domain and in target domain */
     var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
-
+    var MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
     NotifyDriverMbx = this;
+    xdc.useModule('xdc.runtime.Assert');
+    xdc.useModule('xdc.runtime.Error');
+    xdc.useModule('xdc.runtime.Startup');
+    xdc.useModule("ti.sysbios.BIOS");
 
-    xdc.useModule("ti.sysbios.family.shared.vayu.IntXbar");
-    xdc.useModule("ti.sysbios.family.c64p.EventCombiner");
-    xdc.useModule("ti.sysbios.family.c64p.Hwi");
-    xdc.useModule("ti.sdo.ipc.Notify");
-    xdc.useModule("ti.sdo.utils.MultiProc");
+    /* concatinate isa chain into single string for easier matching */
+    isaChain = "#" + Program.build.target.getISAChain().join("#") + "#";
 
-    if (Program.build.target.$name.match(/M3/)) {
+    if (isaChain.match(/#64P#/)) {
+        xdc.useModule("ti.sysbios.family.c64p.EventCombiner");
+        xdc.useModule("ti.sysbios.family.c64p.Hwi");
+        xdc.useModule("ti.sysbios.family.shared.vayu.IntXbar");
+    }
+    else if (isaChain.match(/#arp32#/)) {
+        xdc.useModule('ti.sysbios.family.arp32.Hwi');
+    }
+    else if (isaChain.match(/#v7M#/)) {
         Core = xdc.useModule("ti.sysbios.family.arm.ducati.Core");
     }
 
+    xdc.useModule('ti.sdo.ipc.Ipc');
+    xdc.useModule("ti.sdo.ipc.Notify");
+    xdc.useModule('ti.sdo.ipc.family.vayu.NotifySetup');
+    xdc.useModule('ti.sdo.ipc.interfaces.INotifyDriver');
+
     /* initialize procIdTable */
-    TableInit.initProcId(NotifyDriverMbx);
+    TableInit.initProcId(this);
 
     /* Initialize mailboxTable */
-    TableInit.generateTable(NotifyDriverMbx);
-
-    /* Initialize mailbox base address table */
-    this.mailboxBaseAddr[0]  = 0x4208B000;  /* EVE1 Internal Mailbox 0 */
-    this.mailboxBaseAddr[1]  = 0x4208C000;  /* EVE1 Internal Mailbox 1 */
-    this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
-    this.mailboxBaseAddr[3]  = 0x4218B000;  /* EVE2 Internal Mailbox 0 */
-    this.mailboxBaseAddr[4]  = 0x4218C000;  /* EVE2 Internal Mailbox 1 */
-    this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
-    this.mailboxBaseAddr[6]  = 0x4228B000;  /* EVE3 Internal Mailbox 0 */
-    this.mailboxBaseAddr[7]  = 0x4228C000;  /* EVE3 Internal Mailbox 1 */
-    this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
-    this.mailboxBaseAddr[9]  = 0x4238B000;  /* EVE4 Internal Mailbox 0 */
-    this.mailboxBaseAddr[10] = 0x4238C000;  /* EVE4 Internal Mailbox 1 */
-    this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
-    this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
-    this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
-    this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
-    this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+    TableInit.generateTable(this);
+
+    if (isaChain.match(/#64P#|#v7M#|#v7A#/)) {
+        /* initialize mailbox base address table */
+        this.mailboxBaseAddr[0]  = 0x4208B000;  /* EVE1 Internal Mailbox 0 */
+        this.mailboxBaseAddr[1]  = 0x4208C000;  /* EVE1 Internal Mailbox 1 */
+        this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
+        this.mailboxBaseAddr[3]  = 0x4218B000;  /* EVE2 Internal Mailbox 0 */
+        this.mailboxBaseAddr[4]  = 0x4218C000;  /* EVE2 Internal Mailbox 1 */
+        this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
+        this.mailboxBaseAddr[6]  = 0x4228B000;  /* EVE3 Internal Mailbox 0 */
+        this.mailboxBaseAddr[7]  = 0x4228C000;  /* EVE3 Internal Mailbox 1 */
+        this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
+        this.mailboxBaseAddr[9]  = 0x4238B000;  /* EVE4 Internal Mailbox 0 */
+        this.mailboxBaseAddr[10] = 0x4238C000;  /* EVE4 Internal Mailbox 1 */
+        this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
+        this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
+        this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
+        this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
+        this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+    }
+    else if (isaChain.match(/#arp32#/)) {
+        this.mailboxBaseAddr[0]  = 0x4008B000;  /* EVE1 Internal Mailbox 0 */
+        this.mailboxBaseAddr[1]  = 0x4008C000;  /* EVE1 Internal Mailbox 1 */
+        this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
+        this.mailboxBaseAddr[3]  = 0x4008B000;  /* EVE2 Internal Mailbox 0 */
+        this.mailboxBaseAddr[4]  = 0x4008C000;  /* EVE2 Internal Mailbox 1 */
+        this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
+        this.mailboxBaseAddr[6]  = 0x4008B000;  /* EVE3 Internal Mailbox 0 */
+        this.mailboxBaseAddr[7]  = 0x4008C000;  /* EVE3 Internal Mailbox 1 */
+        this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
+        this.mailboxBaseAddr[9]  = 0x4008B000;  /* EVE4 Internal Mailbox 0 */
+        this.mailboxBaseAddr[10] = 0x4008C000;  /* EVE4 Internal Mailbox 1 */
+        this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
+        this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
+        this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
+        this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
+        this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+
+        /* each EVE receives its message using the local mailbox address */
+        if (MultiProc.id == this.eve1ProcId) {
+            this.mailboxBaseAddr[2] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve2ProcId) {
+            this.mailboxBaseAddr[5] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve3ProcId) {
+            this.mailboxBaseAddr[8] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve4ProcId) {
+            this.mailboxBaseAddr[11] = 0x4008D000;
+        }
+    }
+    else {
+        throw("Invalid target: " + Program.build.target.$name);
+    }
 }
 
 
@@ -93,21 +145,7 @@ function module$static$init(state, mod)
         state.drvHandles[i] = null;
     }
 
-    /* TODO this code is specific to the DSP, need to add other processors */
-
-
-    if (Program.build.target.$name.match(/M3/)) {
-/* TODO */
-if (0) {
-        if (Core.id == 0) {
-            Hwi.construct(state.hwi, 53, NotifyDriverMbx.isr);
-        }
-        else {
-            Hwi.construct(state.hwi, 54, NotifyDriverMbx.isr);
-        }
-}
-    }
-    else if (Program.build.target.isa == "66") {
+    if (isaChain.match(/#64P#/)) {
         /* interrupt event IDs used by this processor */
         state.interruptTable[0] = 55; /* EVE1 -> DSP1 or DSP2 */
         state.interruptTable[1] = 56; /* EVE2 -> DSP1 or DSP2 */
@@ -123,11 +161,32 @@ if (0) {
         state.interruptTable[9] = 0; /* IPU1-1 -> DSP1 or DSP2 */
         state.interruptTable[10] = 0; /* IPU2-1 -> DSP1 or DSP2 */
     }
-    else if (Program.build.target.$name.match(/A8/)) {
-/* TODO */
-if (0) {
-        Hwi.construct(state.hwi, 77, NotifyDriverMbx.isr);
-}
+    else if (isaChain.match(/#arp32#/)) {
+        /* interrupt event IDs used by this processor */
+        state.interruptTable[0] = 60; /* EVE1 - Group1/INTC1 */
+        state.interruptTable[1] = 60; /* EVE2 - Group1/INTC1 */
+        state.interruptTable[2] = 60; /* EVE3 - Group1/INTC1 */
+        state.interruptTable[3] = 60; /* EVE4 - Group1/INTC1 */
+        state.interruptTable[4] = 29; /* DSP1 - Group0/INTC0 */
+        state.interruptTable[5] = 30; /* DSP2 - Group0/INTC0 */
+        state.interruptTable[6] = 29; /* IPU1-0 */
+        state.interruptTable[7] = 30; /* IPU2-0 */
+        state.interruptTable[8] = 29; /* HOST */
+        state.interruptTable[9] = 30; /* IPU1-1 */
+        state.interruptTable[10] = 30; /* IPU2-1 */
+    }
+    else if (isaChain.match(/#v7M#/)) {
+        /* TODO */
+//      if (Core.id == 0) {
+//          Hwi.construct(state.hwi, 53, NotifyDriverMbx.isr);
+//      }
+//      else {
+//          Hwi.construct(state.hwi, 54, NotifyDriverMbx.isr);
+//      }
+    }
+    else if (isaChain.match(/#v7A#/)) {
+        /* TODO */
+//      Hwi.construct(state.hwi, 77, NotifyDriverMbx.isr);
     }
     else {
         throw("Invalid target: " + Program.build.target.$name);
@@ -142,52 +201,109 @@ if (0) {
 
 /*
  *  ======== viewInitBasic ========
+ *  Initizalize the 'Basic' ROV view. Called once per instance.
+ *
+ *  view = instance of 'struct NotifyDriverMbx.BasicView'
  */
 function viewInitBasic(view, obj)
 {
     var Program = xdc.useModule('xdc.rov.Program');
-    var ScalarStructs = xdc.useModule('xdc.rov.support.ScalarStructs');
     var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-    var modCfg = Program.getModuleConfig(
-            'ti.sdo.ipc.family.vayu.NotifyDriverMbx');
-
-    /* translate the virtual id to a processor id */
-    var remoteProcId = -1;
-
-    for (var i = 0; i < modCfg.procIdTable.length; i++) {
-        if (obj.remoteVirtId == modCfg.procIdTable[i]) {
-            remoteProcId = i;
-            break;
-        }
-    }
 
     /* view.remoteProc */
     try {
-        view.remoteProc = MultiProc.getName$view(remoteProcId);
+        view.remoteProc = MultiProc.getName$view(obj.remoteProcId);
     }
     catch (e) {
         Program.displayError(view, 'remoteProc',
                 "Problem retrieving proc name: " + e);
     }
+}
 
-    /* view.mailboxAddr */
-    var selfVirtId = modCfg.procIdTable[MultiProc.self$view()];
-    var idx = (obj.remoteVirtId * modCfg.NUM_CORES) + selfVirtId;
-    var baseAddrIdx = (modCfg.mailboxTable[idx] >> 16) & 0xFFFF;
-    var mailboxAddr = modCfg.mailboxBaseAddr[baseAddrIdx];
-    view.mailboxAddr = "0x" + Number(mailboxAddr).toString(16);
-
-    /* view.subMbxId */
-    view.subMbxId = modCfg.mailboxTable[idx] & 0xFF;
+/*
+ *  ======== viewInitMailbox ========
+ *  Initizalize the 'Mailbox' ROV view. Called once per instance.
+ *
+ *  view = instance of 'struct xdc.rov.Program.InstDataView'
+ */
+function viewInitMailbox(view, obj)
+{
+    var Program = xdc.useModule('xdc.rov.Program');
+    var ScalarStructs = xdc.useModule('xdc.rov.support.ScalarStructs');
+    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
+    var modCfg = Program.getModuleConfig(
+            'ti.sdo.ipc.family.vayu.NotifyDriverMbx');
 
-    /* view.count */
+    /* view.label (use remote processor name) */
     try {
-        var MAILBOX_STATUS_IN = Program.fetchStruct(
-                ScalarStructs.S_Bits32$fetchDesc,
-                mailboxAddr + 0xC0 + (0x4 * view.subMbxId), false);
-        view.count = MAILBOX_STATUS_IN.elem;
+        view.label = MultiProc.getName$view(obj.remoteProcId);
     }
     catch (e) {
-        throw(e);
+        Program.displayError(view, 'remoteProcId',
+                "Problem retrieving proc name: " + e);
+    }
+
+    /* create an array to hold the instance data table */
+    var dataTable = new Array();
+    var mailbox = ["Inbound", "Outbound"];
+
+    for (var i = 0; i < mailbox.length; i++) {
+
+        /* create the view element */
+        var elem = Program.newViewStruct(
+                'ti.sdo.ipc.family.vayu.NotifyDriverMbx', 'Mailbox');
+
+        /* elem.direction (make a descriptive label) */
+        if (mailbox[i] == "Inbound") {
+            elem.direction = mailbox[i] + " (from " + view.label + ")";
+        }
+        else if (mailbox[i] == "Outbound") {
+            elem.direction = mailbox[i] + " (to " + view.label + ")";
+        }
+        else {
+            throw new Error("invalid mailbox type");
+        }
+
+        /* elem.mailboxAddr */
+        var selfVirtId = modCfg.procIdTable[MultiProc.self$view()];
+        var idx;
+
+        if (mailbox[i] == "Inbound") {
+            idx = (obj.remoteVirtId * modCfg.NUM_CORES) + selfVirtId;
+        }
+        else if (mailbox[i] == "Outbound") {
+            idx = (selfVirtId * modCfg.NUM_CORES) + obj.remoteVirtId;
+        }
+        else {
+            throw new Error("invalid mailbox type");
+        }
+
+        var baseAddrIdx = (modCfg.mailboxTable[idx] >> 16) & 0xFFFF;
+        var mailboxAddr = modCfg.mailboxBaseAddr[baseAddrIdx];
+        elem.mailboxAddr = "0x" + Number(mailboxAddr).toString(16);
+
+        /* elem.subMbxId */
+        elem.subMbxId = modCfg.mailboxTable[idx] & 0xFF;
+
+        /* elem.msgCount */
+        try {
+            var MAILBOX_STATUS_IN = Program.fetchStruct(
+                    ScalarStructs.S_Bits32$fetchDesc,
+                    mailboxAddr + 0xC0 + (0x4 * elem.subMbxId), false);
+            elem.msgCount = MAILBOX_STATUS_IN.elem;
+        }
+        catch (e) {
+            Program.displayError(view, 'msgCount',
+                    "Problem retrieving messsage count: " + e);
+        }
+
+        /* elem.mbxInterrupt */
+        elem.mbxInterrupt = (modCfg.mailboxTable[idx] >> 8) & 0xFF;
+
+        /* add the element to the instance data table */
+        dataTable.push(elem);
     }
+
+    /* view.elements */
+    view.elements = dataTable;
 }
index 2f7710af638c7d005166f7f504a2398c346b9d4e..8a18e9deab9901764b4215040a85b10b6c5453de 100644 (file)
 #include <xdc/runtime/Error.h>
 #include <xdc/runtime/Startup.h>
 
-#include <ti/sdo/ipc/_Notify.h>
 #include <ti/sdo/ipc/Ipc.h>
+#include <ti/sdo/ipc/_Notify.h>
 #include <ti/sdo/ipc/family/vayu/NotifyDriverMbx.h>
 #include <ti/sdo/ipc/notifyDrivers/NotifyDriverShm.h>
 #include <ti/sdo/utils/_MultiProc.h>
 
+#if defined(xdc_target__isaCompatible_64P)
+
 #include <ti/sysbios/family/c64p/EventCombiner.h>
 #include <ti/sysbios/family/c64p/Hwi.h>
 #include <ti/sysbios/family/shared/vayu/IntXbar.h>
 
+#elif defined(xdc_target__isaCompatible_arp32)
+
+#include <ti/sysbios/family/arp32/Hwi.h>
+
+#elif defined(xdc_target__isaCompatible_v7M)
+
+#include <ti/sysbios/family/arm/m3/Hwi.h>
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+#include <ti/sysbios/family/arm/gic/Hwi.h>
+
+#else
+#error Invalid target
+#endif
+
 #include "package/internal/NotifySetup.xdc.h"
 
 
  */
 Int NotifySetup_Module_startup(Int phase)
 {
-#if defined(xdc_target__isa_66)
+#if defined(xdc_target__isaCompatible_64P)
 
     extern cregister volatile UInt DNUM;
 
@@ -147,17 +165,17 @@ Int NotifySetup_Module_startup(Int phase)
 
     return (Startup_NOTDONE);
 
-#elif defined(xdc_target__isa_arp32)
+#elif defined(xdc_target__isaCompatible_arp32)
 
-    /* TODO */
+    /* nothing to do on this processor */
     return (Startup_DONE);
 
-#elif defined(xdc_target__isa_v7M4)
+#elif defined(xdc_target__isaCompatible_v7M)
 
     /* TODO */
     return (Startup_DONE);
 
-#elif defined(xdc_target__isa_v7A15)
+#elif defined(xdc_target__isaCompatible_v7A)
 
     /* TODO */
     return (Startup_DONE);
@@ -219,11 +237,18 @@ NotifySetup_Driver NotifySetup_driverType(UInt16 remoteProcId)
 Void NotifySetup_plugHwi(UInt16 remoteProcId, Int cpuIntrNum,
         NotifySetup_DriverIsr isr)
 {
+    Error_Block eb;
     UInt        key;
     Hwi_Params  hwiParams;
     UInt16      virtId;
     Int         eventId;
+#if defined(xdc_target__isaCompatible_64P)
     UInt        combinedEventId;
+#elif defined(xdc_target__isaCompatible_arp32)
+    UInt        mbxIdx;
+#endif
+
+    Error_init(&eb);
 
     /* disable global interrupts (TODO: should be a gated module) */
     key = Hwi_disable();
@@ -234,14 +259,16 @@ Void NotifySetup_plugHwi(UInt16 remoteProcId, Int cpuIntrNum,
     /* save driver isr in dispatch table */
     NotifySetup_module->isrDispatchTable[virtId] = isr;
 
+#if defined(xdc_target__isaCompatible_64P)
+
     /* program the event dispatcher */
     eventId = NotifySetup_module->interruptTable[virtId];
     EventCombiner_dispatchPlug(eventId, NotifySetup_dispatchIsr, eventId, TRUE);
 
     /* make sure the interrupt is plugged only once */
-    NotifySetup_module->numPlugged++;
+    NotifySetup_module->numPlugged[0]++;
 
-    if (NotifySetup_module->numPlugged == 1) {
+    if (NotifySetup_module->numPlugged[0] == 1) {
         combinedEventId = eventId / EVENT_GROUP_SIZE;
 
         Hwi_Params_init(&hwiParams);
@@ -251,11 +278,59 @@ Void NotifySetup_plugHwi(UInt16 remoteProcId, Int cpuIntrNum,
 
         Hwi_create(cpuIntrNum,
                 &ti_sysbios_family_c64p_EventCombiner_dispatch,
-                &hwiParams, NULL);
+                &hwiParams, &eb);
+        /* TODO: add error handling */
 
         Hwi_enableInterrupt(cpuIntrNum);
     }
 
+#elif defined(xdc_target__isaCompatible_arp32)
+
+    if ((remoteProcId == NotifySetup_dsp1ProcId) ||
+        (remoteProcId == NotifySetup_ipu1_0ProcId) ||
+        (remoteProcId == NotifySetup_hostProcId)) {
+
+        mbxIdx = 0;
+    }
+    else if ((remoteProcId == NotifySetup_dsp2ProcId) ||
+        (remoteProcId == NotifySetup_ipu2_0ProcId) ||
+        (remoteProcId == NotifySetup_ipu1_1ProcId) ||
+        (remoteProcId == NotifySetup_ipu2_1ProcId)) {
+
+        mbxIdx = 1;
+    }
+    else {
+        mbxIdx = 2; /* remote processor must be EVEx */
+    }
+
+    /* make sure the interrupt is plugged only once */
+    NotifySetup_module->numPlugged[mbxIdx]++;
+
+    if (NotifySetup_module->numPlugged[mbxIdx] == 1) {
+        eventId = NotifySetup_module->interruptTable[virtId];
+
+        Hwi_Params_init(&hwiParams);
+        hwiParams.arg = eventId;
+        hwiParams.vectorNum = cpuIntrNum;
+
+        Hwi_create(eventId, NotifySetup_dispatchIsr, &hwiParams, &eb);
+        /* TODO: add error handling */
+
+        Hwi_enableInterrupt(NotifySetup_module->interruptTable[virtId]);
+    }
+
+#elif defined(xdc_target__isaCompatible_v7M)
+
+    /* TODO */
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+    /* TODO */
+
+#else
+#error Invalid target
+#endif
+
     /* restore global interrupts */
     Hwi_restore(key);
 }
@@ -267,17 +342,23 @@ Void NotifySetup_unplugHwi(UInt16 remoteProcId, Int cpuIntrNum)
 {
     UInt        key;
     Hwi_Handle  hwi;
+#if defined(xdc_target__isaCompatible_64P)
     UInt16      virtId;
     Int         eventId;
+#elif defined(xdc_target__isaCompatible_arp32)
+    UInt        mbxIdx;
+#endif
 
     /* disable global interrupts (TODO: should be a gated module) */
     key = Hwi_disable();
 
+#if defined(xdc_target__isaCompatible_64P)
+
     /* unplug interrupt if last user */
-    NotifySetup_module->numPlugged--;
+    NotifySetup_module->numPlugged[0]--;
 
-    if (NotifySetup_module->numPlugged == 0) {
-        hwi= Hwi_getHandle(cpuIntrNum);
+    if (NotifySetup_module->numPlugged[0] == 0) {
+        hwi = Hwi_getHandle(cpuIntrNum);
         Hwi_delete(&hwi);
     }
 
@@ -286,6 +367,45 @@ Void NotifySetup_unplugHwi(UInt16 remoteProcId, Int cpuIntrNum)
     eventId = NotifySetup_module->interruptTable[virtId];
     EventCombiner_disableEvent(eventId);
 
+#elif defined(xdc_target__isaCompatible_arp32)
+
+    if ((remoteProcId == NotifySetup_dsp1ProcId) ||
+        (remoteProcId == NotifySetup_ipu1_0ProcId) ||
+        (remoteProcId == NotifySetup_hostProcId)) {
+
+        mbxIdx = 0;
+    }
+    else if ((remoteProcId == NotifySetup_dsp2ProcId) ||
+        (remoteProcId == NotifySetup_ipu2_0ProcId) ||
+        (remoteProcId == NotifySetup_ipu1_1ProcId) ||
+        (remoteProcId == NotifySetup_ipu2_1ProcId)) {
+
+        mbxIdx = 1;
+    }
+    else {
+        mbxIdx = 2; /* remote processor must be EVEx */
+    }
+
+    /* unplug interrupt if last user */
+    NotifySetup_module->numPlugged[mbxIdx]--;
+
+    if (NotifySetup_module->numPlugged[0] == 0) {
+        hwi = Hwi_getHandle(cpuIntrNum);
+        Hwi_delete(&hwi);
+    }
+
+#elif defined(xdc_target__isaCompatible_v7M)
+
+    /* TODO */
+
+#elif defined(xdc_target__isaCompatible_v7A)
+
+    /* TODO */
+
+#else
+#error Invalid target
+#endif
+
     /* restore global interrupts */
     Hwi_restore(key);
 }
index 4b5091143826df8e9eac2c1ac98df81e80755c6f..44d3ff2cdab98b320eafb6d913398a7117b435eb 100644 (file)
@@ -192,8 +192,11 @@ internal:
      *  ======== Module_State ========
      */
     struct Module_State {
-        UInt16      numPlugged;         /*! interrupt plug counter */
-        DrvBind     connAry[length];
+        /* interrupt plug counter */
+        UInt16 numPlugged[];
+
+        /* connection array */
+        DrvBind connAry[length];
 
         /*  Interrupt event IDs used to communicate with this processor.
          *  This table is indexed by virtual processor ID.
index a7dd9f8dba0fc99ea7b0399f5441d4f1f47d57ff..51199528a3dc65d8cc9a89413d109aacd32c79f7 100644 (file)
 
 /*
  *  ======== NotifySetup.xs ========
- *
  */
 var MultiProc = null;
+var Core = null;
+var isaChain = "";
 
 /*
  *  ======== module$use ========
  */
 function module$use()
 {
-    var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
-
     /* load modules needed in meta domain and in target domain */
+    var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
     MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-
     xdc.useModule('xdc.runtime.Assert');
+    xdc.useModule('xdc.runtime.Error');
+    xdc.useModule('xdc.runtime.Startup');
+
+    /* concatinate isa chain into single string for easier matching */
+    isaChain = "#" + Program.build.target.getISAChain().join("#") + "#";
+
+    if (isaChain.match(/#64P#/)) {
+        xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+        xdc.useModule('ti.sysbios.family.c64p.Hwi');
+        xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+    }
+    else if (isaChain.match(/#arp32#/)) {
+        xdc.useModule('ti.sysbios.family.arp32.Hwi');
+    }
+    else if (isaChain.match(/#v7M#/)) {
+        Core = xdc.useModule("ti.sysbios.family.arm.ducati.Core");
+    }
+
+    xdc.useModule('ti.sdo.ipc.Ipc');
+    xdc.useModule('ti.sdo.ipc.Notify');
 
     /* initialize procIdTable */
     TableInit.initProcId(this);
@@ -54,23 +73,60 @@ function module$use()
     /* initialize mailboxTable */
     TableInit.generateTable(this);
 
-    /* Initialize mailbox base address table */
-    this.mailboxBaseAddr[0]  = 0x4208B000;  /* EVE1 Internal Mailbox 0 */
-    this.mailboxBaseAddr[1]  = 0x4208C000;  /* EVE1 Internal Mailbox 1 */
-    this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
-    this.mailboxBaseAddr[3]  = 0x4218B000;  /* EVE2 Internal Mailbox 0 */
-    this.mailboxBaseAddr[4]  = 0x4218C000;  /* EVE2 Internal Mailbox 1 */
-    this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
-    this.mailboxBaseAddr[6]  = 0x4228B000;  /* EVE3 Internal Mailbox 0 */
-    this.mailboxBaseAddr[7]  = 0x4228C000;  /* EVE3 Internal Mailbox 1 */
-    this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
-    this.mailboxBaseAddr[9]  = 0x4238B000;  /* EVE4 Internal Mailbox 0 */
-    this.mailboxBaseAddr[10] = 0x4238C000;  /* EVE4 Internal Mailbox 1 */
-    this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
-    this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
-    this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
-    this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
-    this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+    if (isaChain.match(/#64P#|#v7M#|#v7A#/)) {
+        /* initialize mailbox base address table */
+        this.mailboxBaseAddr[0]  = 0x4208B000;  /* EVE1 Internal Mailbox 0 */
+        this.mailboxBaseAddr[1]  = 0x4208C000;  /* EVE1 Internal Mailbox 1 */
+        this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
+        this.mailboxBaseAddr[3]  = 0x4218B000;  /* EVE2 Internal Mailbox 0 */
+        this.mailboxBaseAddr[4]  = 0x4218C000;  /* EVE2 Internal Mailbox 1 */
+        this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
+        this.mailboxBaseAddr[6]  = 0x4228B000;  /* EVE3 Internal Mailbox 0 */
+        this.mailboxBaseAddr[7]  = 0x4228C000;  /* EVE3 Internal Mailbox 1 */
+        this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
+        this.mailboxBaseAddr[9]  = 0x4238B000;  /* EVE4 Internal Mailbox 0 */
+        this.mailboxBaseAddr[10] = 0x4238C000;  /* EVE4 Internal Mailbox 1 */
+        this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
+        this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
+        this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
+        this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
+        this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+    }
+    else if (isaChain.match(/#arp32#/)) {
+        this.mailboxBaseAddr[0]  = 0x4008B000;  /* EVE1 Internal Mailbox 0 */
+        this.mailboxBaseAddr[1]  = 0x4008C000;  /* EVE1 Internal Mailbox 1 */
+        this.mailboxBaseAddr[2]  = 0x4208D000;  /* EVE1 Internal Mailbox 2 */
+        this.mailboxBaseAddr[3]  = 0x4008B000;  /* EVE2 Internal Mailbox 0 */
+        this.mailboxBaseAddr[4]  = 0x4008C000;  /* EVE2 Internal Mailbox 1 */
+        this.mailboxBaseAddr[5]  = 0x4218D000;  /* EVE2 Internal Mailbox 2 */
+        this.mailboxBaseAddr[6]  = 0x4008B000;  /* EVE3 Internal Mailbox 0 */
+        this.mailboxBaseAddr[7]  = 0x4008C000;  /* EVE3 Internal Mailbox 1 */
+        this.mailboxBaseAddr[8]  = 0x4228D000;  /* EVE3 Internal Mailbox 2 */
+        this.mailboxBaseAddr[9]  = 0x4008B000;  /* EVE4 Internal Mailbox 0 */
+        this.mailboxBaseAddr[10] = 0x4008C000;  /* EVE4 Internal Mailbox 1 */
+        this.mailboxBaseAddr[11] = 0x4238D000;  /* EVE4 Internal Mailbox 2 */
+        this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
+        this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
+        this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
+        this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
+
+        /* each EVE receives its message using the local mailbox address */
+        if (MultiProc.id == this.eve1ProcId) {
+            this.mailboxBaseAddr[2] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve2ProcId) {
+            this.mailboxBaseAddr[5] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve3ProcId) {
+            this.mailboxBaseAddr[8] = 0x4008D000;
+        }
+        else if (MultiProc.id == this.eve4ProcId) {
+            this.mailboxBaseAddr[11] = 0x4008D000;
+        }
+    }
+    else {
+        throw("Invalid target: " + Program.build.target.$name);
+    }
 
     /* determine which notify drivers to include */
     this.$private.driverMask = 0;
@@ -107,8 +163,6 @@ function module$static$init(state, mod)
 {
     var procId;
 
-    state.numPlugged = 0;
-
     /* Initialize the state connAry from the config params. Translate
      * processor names into IDs for better runtime performance.
      */
@@ -120,27 +174,9 @@ function module$static$init(state, mod)
         state.connAry[i].driver = mod.connections[i].driver;
     }
 
-    /* finish initializing the interrupt table */
-    if (Program.build.target.isa == "v7M4") {
-//      TODO
-//      if (Core.id == 0) {
-//          Hwi.construct(state.hwi, 53, NotifyDriverMbx.isr);
-//      }
-//      else {
-//          Hwi.construct(state.hwi, 54, NotifyDriverMbx.isr);
-//      }
-        /* interrupt event IDs used by this processor */
-        for (var i = 0; i < state.interruptTable.length; i++) {
-            state.interruptTable[i] = 0xFFFF; /* TODO */
-        }
-    }
-    else if (Program.build.target.isa == "arp32") {
-        /* interrupt event IDs used by this processor */
-        for (var i = 0; i < state.interruptTable.length; i++) {
-            state.interruptTable[i] = 0xFFFF; /* TODO */
-        }
-    }
-    else if (Program.build.target.isa == "66") {
+    if (isaChain.match(/#64P#/)) {
+        state.numPlugged.length = 1;
+
         /* interrupt event IDs used by this processor */
         state.interruptTable[0] = 55; /* EVE1 -> DSP1 or DSP2 */
         state.interruptTable[1] = 56; /* EVE2 -> DSP1 or DSP2 */
@@ -156,7 +192,41 @@ function module$static$init(state, mod)
         state.interruptTable[9] = 0; /* IPU1-1 -> DSP1 or DSP2 */
         state.interruptTable[10] = 0; /* IPU2-1 -> DSP1 or DSP2 */
     }
-    else if (Program.build.target.isa == "v7A15") {
+    else if (isaChain.match(/#arp32#/)) {
+        state.numPlugged.length = this.NUM_EVE_MBX / this.NUM_EVES;
+
+        /* interrupt event IDs used by this processor */
+        state.interruptTable[0] = 60; /* EVE1 - Group1/INTC1 */
+        state.interruptTable[1] = 60; /* EVE2 - Group1/INTC1 */
+        state.interruptTable[2] = 60; /* EVE3 - Group1/INTC1 */
+        state.interruptTable[3] = 60; /* EVE4 - Group1/INTC1 */
+        state.interruptTable[4] = 29; /* DSP1 - Group0/INTC0 */
+        state.interruptTable[5] = 30; /* DSP2 - Group0/INTC0 */
+        state.interruptTable[6] = 29; /* IPU1-0 */
+        state.interruptTable[7] = 30; /* IPU2-0 */
+        state.interruptTable[8] = 29; /* HOST */
+        state.interruptTable[9] = 30; /* IPU1-1 */
+        state.interruptTable[10] = 30; /* IPU2-1 */
+    }
+    else if (isaChain.match(/#v7M#/)) {
+        state.numPlugged.length = 1;
+
+        /* TODO */
+//      if (Core.id == 0) {
+//          Hwi.construct(state.hwi, 53, NotifyDriverMbx.isr);
+//      }
+//      else {
+//          Hwi.construct(state.hwi, 54, NotifyDriverMbx.isr);
+//      }
+
+        /* interrupt event IDs used by this processor */
+        for (var i = 0; i < state.interruptTable.length; i++) {
+            state.interruptTable[i] = 0xFFFF; /* TODO */
+        }
+    }
+    else if (isaChain.match(/#v7A#/)) {
+        state.numPlugged.length = 1;
+
         /* interrupt event IDs used by this processor */
         for (var i = 0; i < state.interruptTable.length; i++) {
             state.interruptTable[i] = 0xFFFF; /* TODO */