/*! * ======== NotifyCircSetup_attach ======== * Initialize interrupt */ Int NotifyCircSetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverCirc_Params notifyShmParams; NotifyDriverCirc_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; UInt16 myId = MultiProc_self(); Int status = Notify_S_SUCCESS; Error_Block eb; /* Initialize the error block */ Error_init(&eb); NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.sharedAddr = sharedAddr; notifyShmParams.remoteProcId = remoteProcId; if (myId == NotifyCircSetup_core1ProcId && remoteProcId != NotifyCircSetup_core0ProcId || myId != NotifyCircSetup_core0ProcId && remoteProcId == NotifyCircSetup_core1ProcId) { Error_raise(&eb, NotifyCircSetup_E_noInterruptLine, MultiProc_getName(remoteProcId), NULL); System_exit(1); } /* Disable cache for inter-ducati NotifyDriverCirc instances */ if ((myId == NotifyCircSetup_core1ProcId && remoteProcId == NotifyCircSetup_core0ProcId) || (myId == NotifyCircSetup_core0ProcId && remoteProcId == NotifyCircSetup_core1ProcId)) { notifyShmParams.cacheLineSize = 0; notifyShmParams.cacheEnabled = FALSE; } /* Only used by the DSP */ notifyShmParams.intVectorId = NotifyCircSetup_dspIntVectId; 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); status = Notify_E_FAIL; } return (status); }
/*! * ======== NotifyCircSetup_attach ======== * Initialize interrupt */ Int NotifyCircSetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverCirc_Params notifyCircParams; NotifyDriverCirc_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; Int status = Notify_S_SUCCESS; Error_Block eb; Error_init(&eb); NotifyDriverCirc_Params_init(¬ifyCircParams); notifyCircParams.sharedAddr = sharedAddr; notifyCircParams.remoteProcId = remoteProcId; /* Set the intVectorId */ if (MultiProc_self() == NotifyCircSetup_dspProcId) { notifyCircParams.intVectorId = NotifyCircSetup_dspIntVectId; } else { notifyCircParams.intVectorId = NotifyCircSetup_arp32IntVectId; } shmDrvHandle = NotifyDriverCirc_create(¬ifyCircParams, &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); status = Notify_E_FAIL; } return (status); }
/*! * ======== NotifyCircSetup_attach ======== * Initialize interrupt */ Int NotifyCircSetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverCirc_Params notifyShmParams; Error_Block eb; Int status = Notify_S_SUCCESS; #ifdef xdc_target__isaCompatible_64 NotifyDriverCirc_Handle armDriverHandle0, armDriverHandle1; UInt armProcId = 1 - MultiProc_self(); /* Initialize the error block */ Error_init(&eb); /* * Setup the notify driver to the ARM (Line 0) */ NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.localIntId = NotifyCircSetup_dspRecvIntId0; notifyShmParams.remoteIntId = NotifyCircSetup_armRecvIntId0; notifyShmParams.intVectorId = NotifyCircSetup_dspIntVectId0; notifyShmParams.remoteProcId = armProcId; notifyShmParams.sharedAddr = sharedAddr; armDriverHandle0 = NotifyDriverCirc_create(¬ifyShmParams, &eb); if (armDriverHandle0 == NULL) { return (Notify_E_FAIL); } ti_sdo_ipc_Notify_create(NotifyDriverCirc_Handle_upCast(armDriverHandle0), armProcId, 0, NULL, &eb); if (Error_check(&eb)) { /* Delete the driver and then return */ NotifyDriverCirc_delete(&armDriverHandle0); return (Notify_E_FAIL); } if (!NotifyCircSetup_useSecondLine) { return (status); } /* * Setup the notify driver to the ARM (Line 1) */ NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.localIntId = NotifyCircSetup_dspRecvIntId1; notifyShmParams.remoteIntId = NotifyCircSetup_armRecvIntId1; notifyShmParams.intVectorId = NotifyCircSetup_dspIntVectId1; notifyShmParams.remoteProcId = armProcId; notifyShmParams.sharedAddr = (Ptr)((UInt32)sharedAddr + NotifyDriverCirc_sharedMemReq(¬ifyShmParams)); armDriverHandle1 = NotifyDriverCirc_create(¬ifyShmParams, &eb); if (armDriverHandle1 == NULL) { return (Notify_E_FAIL); } ti_sdo_ipc_Notify_create(NotifyDriverCirc_Handle_upCast(armDriverHandle1), armProcId, 1, NULL, &eb); if (Error_check(&eb)) { /* Delete the driver and then return */ NotifyDriverCirc_delete(&armDriverHandle1); return (Notify_E_FAIL); } #else /* ARM code */ NotifyDriverCirc_Handle dspDriverHandle0, dspDriverHandle1; UInt dspProcId = 1 - MultiProc_self(); /* Initialize the error block */ Error_init(&eb); /* * Setup the notify driver to the DSP (Line 0) */ NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.localIntId = NotifyCircSetup_armRecvIntId0; notifyShmParams.remoteIntId = NotifyCircSetup_dspRecvIntId0; notifyShmParams.remoteProcId = dspProcId; notifyShmParams.sharedAddr = sharedAddr; dspDriverHandle0 = NotifyDriverCirc_create(¬ifyShmParams, &eb); if (dspDriverHandle0 == NULL) { return (Notify_E_FAIL); } ti_sdo_ipc_Notify_create(NotifyDriverCirc_Handle_upCast(dspDriverHandle0), dspProcId, 0, NULL, &eb); if (Error_check(&eb)) { /* Delete the driver and then return */ NotifyDriverCirc_delete(&dspDriverHandle0); return (Notify_E_FAIL); } if (!NotifyCircSetup_useSecondLine) { return (status); } /* * Setup the notify driver to the DSP (Line 1) */ NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.localIntId = NotifyCircSetup_armRecvIntId1; notifyShmParams.remoteIntId = NotifyCircSetup_dspRecvIntId1; notifyShmParams.remoteProcId = dspProcId; notifyShmParams.sharedAddr = (Ptr)((UInt32)sharedAddr + NotifyDriverCirc_sharedMemReq(¬ifyShmParams)); dspDriverHandle1 = NotifyDriverCirc_create(¬ifyShmParams, &eb); if (dspDriverHandle1 == NULL) { return (Notify_E_FAIL); } ti_sdo_ipc_Notify_create(NotifyDriverCirc_Handle_upCast(dspDriverHandle1), dspProcId, 1, NULL, &eb); if (Error_check(&eb)) { /* Delete the driver and then return */ NotifyDriverCirc_delete(&dspDriverHandle1); return (Notify_E_FAIL); } #endif return (status); }
/*! * @brief Function to perform device specific setup for Notify module. * This function creates the Notify drivers. * * @param[in] sharedAddr Shared address base. * * @sa NotifyCircSetupOmapl1xx_detach */ Int NotifyCircSetupOmapl1xx_attach (UInt16 procId, Ptr sharedAddr) { Int32 status = Notify_S_SUCCESS; NotifyDriverCirc_Params notifyCircParams; GT_1trace (curTrace, GT_ENTER, "NotifyCircSetupOmapl1xx_attach", sharedAddr); GT_assert (curTrace, (sharedAddr != NULL)); GT_assert (curTrace, (procId != MultiProc_self ())); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (sharedAddr == NULL) { /*! @retval Notify_E_INVALIDARG Invalid NULL sharedAddr argument provided. */ status = Notify_E_INVALIDARG; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupOmapl1xx_attach", status, "Invalid NULL sharedAddr provided."); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyDriverCirc_Params_init (¬ifyCircParams); /* Currently not supporting caching on host side. */ notifyCircParams.cacheEnabled = FALSE; notifyCircParams.lineId = 0; notifyCircParams.localIntId = NotifyCircSetup_armRecvIntId0; notifyCircParams.remoteIntId = NotifyCircSetup_dspRecvIntId0; notifyCircParams.remoteProcId = procId; notifyCircParams.sharedAddr = sharedAddr; NotifyCircSetup_dspDriverHandle0 = NotifyDriverCirc_create (¬ifyCircParams); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_dspDriverHandle0 == NULL) { /*! @retval Notify_E_FAIL NotifyDriverCirc_create failed */ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupOmapl1xx_attach", status, "NotifyDriverCirc_create failed"); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyCircSetup_notifyHandle0 = Notify_create ( NotifyCircSetup_dspDriverHandle0, procId, 0u, NULL); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_notifyHandle0 == NULL) { /*! @retval Notify_E_FAIL Notify_create failed */ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupOmapl1xx_attach", status, "Notify_create failed"); } } if (status >= 0) { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ if (NotifyCircSetup_useSecondLine) { /* * Setup the notify driver to the DSP (Line 1) */ NotifyDriverCirc_Params_init (¬ifyCircParams); notifyCircParams.localIntId = NotifyCircSetup_armRecvIntId1; notifyCircParams.remoteIntId = NotifyCircSetup_dspRecvIntId1; notifyCircParams.remoteProcId = procId; notifyCircParams.lineId = 1u; notifyCircParams.sharedAddr = sharedAddr;/* To allow sharedegion * Calculations */ notifyCircParams.sharedAddr = (Ptr)((UInt32) sharedAddr + NotifyDriverCirc_sharedMemReq (¬ifyCircParams)); NotifyCircSetup_dspDriverHandle1 = NotifyDriverCirc_create ( ¬ifyCircParams); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_dspDriverHandle1 == NULL) { /*! @retval Notify_E_FAIL NotifyDriverCirc_create failed for line 1*/ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupOmapl1xx_attach", status, "NotifyDriverCirc_create failed for line 1"); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyCircSetup_notifyHandle1 = Notify_create ( NotifyCircSetup_dspDriverHandle1, procId, 1u, NULL); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_notifyHandle0 == NULL) { /*! @retval Notify_E_FAIL Notify_create failed for line 1*/ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupOmapl1xx_attach", status, "Notify_create failed for line 1"); } } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ } #if !defined(SYSLINK_BUILD_OPTIMIZE) } } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ GT_1trace (curTrace, GT_LEAVE, "NotifyCircSetupOmapl1xx_attach", status); /*! @retval Notify_S_SUCCESS Operation successful */ return (status); }
/*! * @brief Function to perform device specific setup for Notify module. * This function creates the Notify drivers. * * @param[in] sharedAddr Shared address base. * * @sa NotifyCircSetupDm8168_detach */ Int NotifyCircSetupDm8168_attach (UInt16 procId, Ptr sharedAddr) { Int32 status = Notify_S_SUCCESS; NotifyDriverCirc_Params notifyCircParams; GT_1trace (curTrace, GT_ENTER, "NotifyCircSetupDm8168_attach", sharedAddr); GT_assert (curTrace, (sharedAddr != NULL)); GT_assert (curTrace, (procId != MultiProc_self ())); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (sharedAddr == NULL) { /*! @retval Notify_E_INVALIDARG Invalid NULL sharedAddr argument provided. */ status = Notify_E_INVALIDARG; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupDm8168_attach", status, "Invalid NULL sharedAddr provided."); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyDriverCirc_Params_init (¬ifyCircParams); /* Currently not supporting caching on host side. */ notifyCircParams.cacheEnabled = FALSE; notifyCircParams.lineId = 0; notifyCircParams.localIntId = 77u; notifyCircParams.remoteIntId = 0u; notifyCircParams.remoteProcId = procId; notifyCircParams.sharedAddr = sharedAddr; NotifyCircSetup_driverHandle [procId] = NotifyDriverCirc_create (¬ifyCircParams); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_driverHandle [procId] == NULL) { /*! @retval Notify_E_FAIL NotifyDriverCirc_create failed */ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupDm8168_attach", status, "NotifyDriverCirc_create failed"); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyCircSetup_notifyHandle [procId] = Notify_create ( NotifyCircSetup_driverHandle [procId], procId, 0u, NULL); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (NotifyCircSetup_notifyHandle [procId] == NULL) { /*! @retval Notify_E_FAIL Notify_create failed */ status = Notify_E_FAIL; GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupDm8168_attach", status, "Notify_create failed"); } } } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ GT_1trace (curTrace, GT_LEAVE, "NotifyCircSetupDm8168_attach", status); /*! @retval Notify_S_SUCCESS Operation successful */ return (status); }