Add config to allow VPSS-M3 to EVE communication
authorChris Ring <cring@ti.com>
Tue, 16 Apr 2013 00:53:41 +0000 (17:53 -0700)
committerChris Ring <cring@ti.com>
Tue, 16 Apr 2013 17:13:49 +0000 (10:13 -0700)
This is a poor-man's cherry-pick of
b0b90ee18c62dc1d10a4f7e746eb6c5205bc3b71
from the IPC 1.25 (ipc-i) stream.

packages/ti/sdo/ipc/family/c6a8149/InterruptDucati.c
packages/ti/sdo/ipc/family/c6a8149/InterruptDucati.xdc
packages/ti/sdo/ipc/family/c6a8149/InterruptEve.c
packages/ti/sdo/ipc/family/c6a8149/NotifyCircSetup.c
packages/ti/sdo/ipc/family/c6a8149/NotifySetup.c

index 8ba3cd378a01efac8b73476b3ec816b92edd266e..d16577b56df0daabf7622597bbd578d1db2bf847 100644 (file)
@@ -149,6 +149,10 @@ Void InterruptDucati_intEnable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
         else if (remoteProcId == InterruptDucati_dspProcId) {
             REG32(MAILBOX_IRQENABLE_SET_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
         }
+        else if (remoteProcId == InterruptDucati_eveProcId) {
+            REG32(EVE_MAILBOX_IRQENABLE_SET_VIDEO) =
+                MAILBOX_REG_VAL(EVE_TO_VIDEO);
+        }
         else {
             Hwi_enableInterrupt(M3INTERCOREINT);
         }
@@ -189,6 +193,10 @@ Void InterruptDucati_intDisable(UInt16 remoteProcId,
         else if (remoteProcId == InterruptDucati_dspProcId) {
             REG32(MAILBOX_IRQENABLE_CLR_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
         }
+        else if (remoteProcId == InterruptDucati_eveProcId) {
+            REG32(EVE_MAILBOX_IRQENABLE_CLR_VIDEO) =
+                MAILBOX_REG_VAL(EVE_TO_VIDEO);
+        }
         else {
             Hwi_disableInterrupt(M3INTERCOREINT);
         }
@@ -250,11 +258,26 @@ Void InterruptDucati_intRegister(UInt16 remoteProcId,
     else if (remoteProcId == InterruptDucati_eveProcId) {
         index = 3;
         if ((BIOS_smpEnabled) || (Core_getId() == 0)) {
-            intInfo->localIntId = EVE_MAILBOX_M3VIDEOINT;
+            if (InterruptDucati_enableVpssToEve) {
+                /* Core0 communication to EVE is not supported */
+                Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
+            }
+            else {
+                intInfo->localIntId = EVE_MAILBOX_M3VIDEOINT;
+            }
         }
         else {
-            /* Core1 communication to EVE is not supported */
-            Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
+            if (InterruptDucati_enableVpssToEve) {
+                /*
+                 *  Core1 communication to EVE use same mbox
+                 *  so only 1 can communicate to EVE.
+                 */
+                intInfo->localIntId = EVE_MAILBOX_M3VIDEOINT;
+            }
+            else {
+                /* Core1 communication to EVE is not supported */
+                Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
+            }
         }
     }
     else {
@@ -295,7 +318,8 @@ Void InterruptDucati_intRegister(UInt16 remoteProcId,
                   &eb);
     }
     else {
-        if ((BIOS_smpEnabled) || (Core_getId() == 0)) {
+        if ((BIOS_smpEnabled) || (Core_getId() == 0) ||
+            (InterruptDucati_enableVpssToEve)) {
             Hwi_create(intInfo->localIntId,
                       (Hwi_FuncPtr)InterruptDucati_intShmEveMbxStub,
                       &hwiAttrs,
@@ -330,7 +354,8 @@ Void InterruptDucati_intUnregister(UInt16 remoteProcId,
     }
     else if (remoteProcId == InterruptDucati_eveProcId) {
         index = 3;
-        if (!(BIOS_smpEnabled) && (Core_getId() == 1)) {
+        if (!(BIOS_smpEnabled) && (Core_getId() == 1) &&
+            !(InterruptDucati_enableVpssToEve)) {
             /* Core1 communication to EVE is not supported */
             return;
         }
@@ -427,8 +452,9 @@ Void InterruptDucati_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
         }
     }
     else {
-        if ((BIOS_smpEnabled) || (Core_getId() == 0)) {
-            /* VIDEO-M3 to EVE */
+        if ((BIOS_smpEnabled) || (Core_getId() == 0) ||
+            (InterruptDucati_enableVpssToEve)) {
+            /* VIDEO-M3/VPSS-M3 to EVE */
             key = Hwi_disable();
             if (REG32(EVE_MAILBOX_STATUS(VIDEO_TO_EVE)) == 0) {
                 REG32(EVE_MAILBOX_MESSAGE(VIDEO_TO_EVE)) = arg;
@@ -496,8 +522,9 @@ Void InterruptDucati_intPost(UInt16 srcProcId, IInterrupt_IntInfo *intInfo,
         }
     }
     else {
-        if ((BIOS_smpEnabled) || (Core_getId() == 0)) {
-            /* EVE to VIDEO-M3 */
+        if ((BIOS_smpEnabled) || (Core_getId() == 0) ||
+            (InterruptDucati_enableVpssToEve)) {
+            /* EVE to VIDEO-M3/VPSS-M3 */
             key = Hwi_disable();
             if (REG32(EVE_MAILBOX_STATUS(EVE_TO_VIDEO)) == 0) {
                 REG32(EVE_MAILBOX_MESSAGE(EVE_TO_VIDEO)) = arg;
@@ -546,9 +573,16 @@ UInt InterruptDucati_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
             REG32(MAILBOX_IRQSTATUS_CLR_VIDEO) = MAILBOX_REG_VAL(DSP_TO_VIDEO);
         }
         else {
-            /* EVE to VIDEO-M3 */
-            arg = REG32(EVE_MAILBOX_MESSAGE(EVE_TO_VIDEO));
-            REG32(EVE_MAILBOX_IRQSTATUS_CLR_VIDEO) = MAILBOX_REG_VAL(EVE_TO_VIDEO);
+            if (InterruptDucati_enableVpssToEve) {
+                /* EVE cannot send an interrupt to VIDEO-M3 in this case */
+                Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
+                arg = 0;    /* keep Coverity happy */
+            }
+            else {
+                /* EVE to VIDEO-M3 */
+                arg = REG32(EVE_MAILBOX_MESSAGE(EVE_TO_VIDEO));
+                REG32(EVE_MAILBOX_IRQSTATUS_CLR_VIDEO) = MAILBOX_REG_VAL(EVE_TO_VIDEO);
+            }
         }
     }
     else { /* M3DSSINT */
@@ -563,9 +597,16 @@ UInt InterruptDucati_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
             REG32(MAILBOX_IRQSTATUS_CLR_VPSS) = MAILBOX_REG_VAL(DSP_TO_VPSS);
         }
         else {
-            /* EVE cannot send an interrupt to VPSS-M3! */
-            Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
-            arg = 0;    /* keep Coverity happy */
+            if (InterruptDucati_enableVpssToEve) {
+                /* EVE to VPSS-M3 */
+                arg = REG32(EVE_MAILBOX_MESSAGE(EVE_TO_VIDEO));
+                REG32(EVE_MAILBOX_IRQSTATUS_CLR_VIDEO) = MAILBOX_REG_VAL(EVE_TO_VIDEO);
+            }
+            else {
+                /* EVE cannot send an interrupt to VPSS-M3 */
+                Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal);
+                arg = 0;    /* keep Coverity happy */
+            }
         }
     }
 
@@ -633,10 +674,12 @@ Void InterruptDucati_intShmEveMbxStub(UArg arg)
 {
     InterruptDucati_FxnTable *table;
 
-    if ((BIOS_smpEnabled) || (Core_getId() == 0)) {
+    if ((BIOS_smpEnabled) || (Core_getId() == 0) ||
+        (InterruptDucati_enableVpssToEve)) {
         if ((REG32(EVE_MAILBOX_IRQENABLE_SET_VIDEO) &
             MAILBOX_REG_VAL(EVE_TO_VIDEO)) &&
-            REG32(EVE_MAILBOX_STATUS(EVE_TO_VIDEO)) != 0) { /* EVE to VIDEO-M3 */
+            REG32(EVE_MAILBOX_STATUS(EVE_TO_VIDEO)) != 0) {
+             /* EVE to VIDEO-M3/VPSS-M3 */
             table = &(InterruptDucati_module->fxnTable[3]);
             (table->func)(table->arg);
         }
index d7deabdd3363048c90f849a4700d724f44f26faa..9e6f0edfb1f4e476d3216a2b2a46abf4877586f8 100644 (file)
@@ -52,6 +52,9 @@ module InterruptDucati inherits ti.sdo.ipc.notifyDrivers.IInterrupt
     /* Base address for the EVE Mailbox */
     config UInt32 mailboxEveBaseAddr = 0x5908B000;
 
+    /* enables VPSS to EVE communication in place of VIDEO to EVE */
+    config Bool enableVpssToEve = false;
+
 internal:
 
     /*! Statically retrieve procIds to avoid doing this at runtime */
index 1d08b213a77643e6fe5662c7d801bc55fbc36ec3..7a5b8a93b5eed592125996eed3b3f05834ce5b95 100644 (file)
@@ -85,7 +85,8 @@ Void InterruptEve_intEnable(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
     if (remoteProcId == InterruptEve_hostProcId) {
         REG32(MAILBOX_IRQENABLE_SET_EVE) = MAILBOX_REG_VAL(HOST_TO_EVE);
     }
-    else if (remoteProcId == InterruptEve_videoProcId) {
+    else if ((remoteProcId == InterruptEve_videoProcId) ||
+        (remoteProcId == InterruptEve_vpssProcId)) {
         REG32(MAILBOX_IRQENABLE_SET_EVE) = MAILBOX_REG_VAL(VIDEO_TO_EVE);
     }
     else if (remoteProcId == InterruptEve_dspProcId) {
@@ -106,7 +107,8 @@ Void InterruptEve_intDisable(UInt16 remoteProcId,
     if (remoteProcId == InterruptEve_hostProcId) {
         REG32(MAILBOX_IRQENABLE_CLR_EVE) = MAILBOX_REG_VAL(HOST_TO_EVE);
     }
-    else if (remoteProcId == InterruptEve_videoProcId) {
+    else if ((remoteProcId == InterruptEve_videoProcId) ||
+        (remoteProcId == InterruptEve_vpssProcId)) {
         REG32(MAILBOX_IRQENABLE_CLR_EVE) = MAILBOX_REG_VAL(VIDEO_TO_EVE);
     }
     else if (remoteProcId == InterruptEve_dspProcId) {
@@ -143,7 +145,8 @@ Void InterruptEve_intRegister(UInt16 remoteProcId,
     if (remoteProcId == InterruptEve_hostProcId) {
         index = 0;
     }
-    else if (remoteProcId == InterruptEve_videoProcId) {
+    else if ((remoteProcId == InterruptEve_videoProcId) ||
+        (remoteProcId == InterruptEve_vpssProcId)) {
         index = 1;
     }
     else if (remoteProcId == InterruptEve_dspProcId) {
@@ -198,7 +201,8 @@ Void InterruptEve_intUnregister(UInt16 remoteProcId,
     if (remoteProcId == InterruptEve_hostProcId) {
         index = 0;
     }
-    else if (remoteProcId == InterruptEve_videoProcId) {
+    else if ((remoteProcId == InterruptEve_videoProcId) ||
+        (remoteProcId == InterruptEve_vpssProcId)) {
         index = 1;
     }
     else if (remoteProcId == InterruptEve_dspProcId) {
@@ -246,7 +250,8 @@ Void InterruptEve_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo,
         /* restore interrupts */
         Hwi_restore(key);
     }
-    else if (remoteProcId == InterruptEve_videoProcId) {
+    else if ((remoteProcId == InterruptEve_videoProcId) ||
+        (remoteProcId == InterruptEve_vpssProcId)) {
         /* disable interrupts */
         key = Hwi_disable();
 
@@ -293,7 +298,8 @@ Void InterruptEve_intPost(UInt16 srcProcId, IInterrupt_IntInfo *intInfo,
         /* restore interrupts */
         Hwi_restore(key);
     }
-    else if (srcProcId == InterruptEve_videoProcId) {
+    else if ((srcProcId == InterruptEve_videoProcId) ||
+        (srcProcId == InterruptEve_vpssProcId)) {
         /* disable interrupts */
         key = Hwi_disable();
 
@@ -332,7 +338,8 @@ UInt InterruptEve_intClear(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo)
         arg = REG32(MAILBOX_MESSAGE(HOST_TO_EVE));
         REG32(MAILBOX_IRQSTATUS_CLR_EVE) = MAILBOX_REG_VAL(HOST_TO_EVE);
     }
-    else if (remoteProcId == InterruptEve_videoProcId) { /* VIDEO-M3 */
+    else if ((remoteProcId == InterruptEve_videoProcId) || /* VIDEO-M3 */
+        (remoteProcId == InterruptEve_vpssProcId)) {
         arg = REG32(MAILBOX_MESSAGE(VIDEO_TO_EVE));
         REG32(MAILBOX_IRQSTATUS_CLR_EVE) = MAILBOX_REG_VAL(VIDEO_TO_EVE);
     }
@@ -367,7 +374,7 @@ Void InterruptEve_intShmStub(UArg arg)
         (table->func)(table->arg);
     }
 
-    /* Process messages from VIDEO  */
+    /* Process messages from VIDEO OR VPSS */
     if ((REG32(MAILBOX_IRQENABLE_SET_EVE) & MAILBOX_REG_VAL(VIDEO_TO_EVE))
         && REG32(MAILBOX_STATUS(VIDEO_TO_EVE)) != 0) {
         table = &(InterruptEve_module->fxnTable[1]);
index 46d4f1ba24d480ddf7d21d62ac1ccadf9314f9fb..357cd0c29c1c8ea2dd469a3f9a2227700f6463ba 100644 (file)
@@ -138,14 +138,5 @@ SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
  */
 UInt16 NotifyCircSetup_numIntLines(UInt16 remoteProcId)
 {
-    UInt16 myId = MultiProc_self();
-
-    if (((myId == NotifyCircSetup_eveProcId) &&
-        (remoteProcId == NotifyCircSetup_vpssProcId)) ||
-        ((myId == NotifyCircSetup_vpssProcId) &&
-        (remoteProcId == NotifyCircSetup_eveProcId))) {
-        return (0);
-    }
-
     return (1);
 }
index 59897dd63933f3f0916aa782cc1f552dea062a82..c724272ae0782bb7710e15035ca08bc6c5cec18e 100644 (file)
@@ -140,14 +140,5 @@ SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
  */
 UInt16 NotifySetup_numIntLines(UInt16 remoteProcId)
 {
-    UInt16 myId = MultiProc_self();
-
-    if (((myId == NotifySetup_eveProcId) &&
-        (remoteProcId == NotifySetup_vpssProcId)) ||
-        ((myId == NotifySetup_vpssProcId) &&
-        (remoteProcId == NotifySetup_eveProcId))) {
-        return (0);
-    }
-
     return (1);
 }