/*! * ======== NotifyCircSetup_sharedMemReq ======== * Return the amount of shared memory required */ SizeT NotifyCircSetupDm8168_sharedMemReq (UInt16 remoteProcId, Ptr sharedAddr) { SizeT memReq = 0x0; NotifyDriverCirc_Params params; GT_1trace (curTrace, GT_ENTER, "NotifyCircSetupDm8168_sharedMemReq", sharedAddr); GT_assert (curTrace, (sharedAddr != NULL)); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (sharedAddr == NULL) { /*! @retval 0 Invalid NULL sharedAddr argument provided. */ GT_setFailureReason (curTrace, GT_4CLASS, "NotifyCircSetupDm8168_sharedMemReq", Notify_E_INVALIDARG, "Invalid NULL sharedAddr provided."); } else { #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ NotifyDriverCirc_Params_init (¶ms); params.sharedAddr = sharedAddr; memReq = NotifyDriverCirc_sharedMemReq (¶ms); #if !defined(SYSLINK_BUILD_OPTIMIZE) } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ GT_1trace (curTrace, GT_LEAVE, "NotifyCircSetupDm8168_sharedMemReq", memReq); /*! @retval Shared-Memory-Requirements Operation successful */ return (memReq); }
/*! * ======== NotifyCircSetup_sharedMemReq ======== * Return the amount of shared memory required */ SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) { SizeT memReq; NotifyDriverCirc_Params params; NotifyDriverCirc_Params_init(¶ms); params.sharedAddr = sharedAddr; if (!NotifyCircSetup_useSecondLine) { memReq = NotifyDriverCirc_sharedMemReq(¶ms); } else { memReq = 2 * NotifyDriverCirc_sharedMemReq(¶ms); } return(memReq); }
/*! * ======== NotifyCircSetup_sharedMemReq ======== */ SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) { SizeT memReq; NotifyDriverCirc_Params notifyCircParams; NotifyDriverCirc_Params_init(¬ifyCircParams); notifyCircParams.sharedAddr = sharedAddr; memReq = NotifyDriverCirc_sharedMemReq(¬ifyCircParams); return (memReq); }
/*! * ======== NotifyCircSetup_sharedMemReq ======== */ SizeT NotifyCircSetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) { SizeT memReq; NotifyDriverCirc_Params notifyShmParams; UInt16 myId = MultiProc_self(); NotifyDriverCirc_Params_init(¬ifyShmParams); notifyShmParams.sharedAddr = sharedAddr; /* 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; } memReq = NotifyDriverCirc_sharedMemReq(¬ifyShmParams); return (memReq); }
/*! * ======== 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); }