예제 #1
0
/*!
 *  ======== NotifySetup_attach ========
 */     
Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
    NotifyDriverShm_Params notifyShmParams;
    NotifyDriverShm_Handle shmDrvHandle;
    ti_sdo_ipc_Notify_Handle notifyHandle;
    Error_Block eb;

    /* Initialize the error block */
    Error_init(&eb);
    
    /* init params and set default values */
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.intVectorId     = NotifySetup_dspIntVectId;
    notifyShmParams.sharedAddr      = sharedAddr;
    notifyShmParams.remoteProcId  = remoteProcId;
        
    shmDrvHandle = NotifyDriverShm_create(&notifyShmParams, &eb);
    if (shmDrvHandle == NULL) {
        return (Notify_E_FAIL);
    }
    
    notifyHandle = ti_sdo_ipc_Notify_create(
            NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL, 
            &eb);
    if (notifyHandle == NULL) {
        NotifyDriverShm_delete(&shmDrvHandle); 
        
        return (Notify_E_FAIL);
    }

    return (Notify_S_SUCCESS);
}
예제 #2
0
/*!
 *  ======== NotifySetup_attach ========
 *  Initialize interrupt
 */
Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
    NotifyDriverShm_Params notifyShmParams;
    NotifyDriverShm_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);
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;
    notifyShmParams.remoteProcId  = remoteProcId;
    
    if (myId == NotifySetup_core1ProcId && 
        remoteProcId != NotifySetup_core0ProcId ||
        myId != NotifySetup_core0ProcId &&
        remoteProcId == NotifySetup_core1ProcId) {
        Error_raise(&eb, NotifySetup_E_noInterruptLine,
            MultiProc_getName(remoteProcId), NULL);
        System_exit(1);
    }
    
    /* Disable cache for inter-ducati NotifyDriverShm instances */
    if ((myId == NotifySetup_core1ProcId && 
         remoteProcId == NotifySetup_core0ProcId) ||
        (myId == NotifySetup_core0ProcId && 
        remoteProcId == NotifySetup_core1ProcId)) {
        notifyShmParams.cacheLineSize = 0;
        notifyShmParams.cacheEnabled = FALSE;
    }
        
    /* Only used by the DSP */
    notifyShmParams.intVectorId   = NotifySetup_dspIntVectId;
        
    shmDrvHandle = NotifyDriverShm_create(&notifyShmParams, &eb);
    if (shmDrvHandle == NULL) {
        return (Notify_E_FAIL);
    }
    
    notifyHandle = ti_sdo_ipc_Notify_create(NotifyDriverShm_Handle_upCast(shmDrvHandle), 
                                 remoteProcId, 0, NULL, &eb);

    if (notifyHandle == NULL) {
        NotifyDriverShm_delete(&shmDrvHandle);
        status = Notify_E_FAIL;
    }

    return (status);
}
예제 #3
0
/*!
 *  ======== NotifySetup_attach ========
 *  Initialize interrupt
 */     
Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
    NotifyDriverShm_Params notifyShmParams;
    NotifyDriverShm_Handle shmDrvHandle;
    ti_sdo_ipc_Notify_Handle notifyHandle;
    Int status = Notify_S_SUCCESS;
    Error_Block eb;
    
    Error_init(&eb);
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;
    notifyShmParams.remoteProcId  = remoteProcId;
    
    /* Set the intVectorId if on the DSP */
    if ((MultiProc_self() == NotifySetup_dsp0ProcId) ||
        (MultiProc_self() == NotifySetup_dsp1ProcId)) {
            notifyShmParams.intVectorId = NotifySetup_dspIntVectId;
    }

    /* Set the intVectorId if on the EVE */
    if ((MultiProc_self() == NotifySetup_eve0ProcId) ||
        (MultiProc_self() == NotifySetup_eve1ProcId) ||
        (MultiProc_self() == NotifySetup_eve2ProcId) ||
        (MultiProc_self() == NotifySetup_eve3ProcId)) {
        if (PROCID(remoteProcId) < 4) {
            notifyShmParams.intVectorId = NotifySetup_eveIntVectId_INTC1;
        }
        else {
            notifyShmParams.intVectorId = NotifySetup_eveIntVectId_INTC0;
        }
    }
    
    shmDrvHandle = NotifyDriverShm_create(&notifyShmParams, &eb);
    if (shmDrvHandle == NULL) {
        return (Notify_E_FAIL);
    }
    
    notifyHandle = ti_sdo_ipc_Notify_create(
            NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, 
            NULL, &eb);
    if (notifyHandle == NULL) {
        NotifyDriverShm_delete(&shmDrvHandle);
        status = Notify_E_FAIL;
    }

    return (status);
}
예제 #4
0
/*!
 *  ======== NotifySetup_attach ========
 *  Initialize interrupt
 */     
Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr)
{
    NotifyDriverShm_Params notifyShmParams;
    NotifyDriverShm_Handle shmDrvHandle;
    ti_sdo_ipc_Notify_Handle notifyHandle;
    Int status = Notify_S_SUCCESS;
    Error_Block eb;
    
    Error_init(&eb);
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;
    notifyShmParams.remoteProcId  = remoteProcId;
    
    /* Set the intVectorId */
    if (MultiProc_self() == NotifySetup_dspProcId) {
        notifyShmParams.intVectorId = NotifySetup_dspIntVectId;
    }
    else {
        notifyShmParams.intVectorId = NotifySetup_arp32IntVectId;
    }
        
    shmDrvHandle = NotifyDriverShm_create(&notifyShmParams, &eb);
    if (shmDrvHandle == NULL) {
        return (Notify_E_FAIL);
    }
    
    notifyHandle = ti_sdo_ipc_Notify_create(
            NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, 
            NULL, &eb);

    if (notifyHandle == NULL) {
        NotifyDriverShm_delete(&shmDrvHandle);
        status = Notify_E_FAIL;
    }

    return (status);
}
예제 #5
0
/*!
 *  @brief      Function to perform device specific setup for Notify module.
 *              This function creates the Notify drivers.
 *
 *  @param[in]  sharedAddr Shared address base.
 *
 *  @sa         NotifySetupOmapl1xx_detach
 */
Int
NotifySetupOmapl1xx_attach (UInt16 procId, Ptr sharedAddr)
{
    Int32                  status    = Notify_S_SUCCESS ;
    NotifyDriverShm_Params notifyShmParams;

    GT_1trace (curTrace, GT_ENTER, "NotifySetupOmapl1xx_attach", sharedAddr);

    GT_assert (curTrace, (sharedAddr != NULL));

#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,
                             "NotifySetupOmapl1xx_attach",
                             status,
                             "Invalid NULL sharedAddr provided.");
    }
    else {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
        /*
         *  Setup the notify driver to the DSP (Line 0)
         */
        NotifyDriverShm_Params_init (&notifyShmParams);
        notifyShmParams.cacheEnabled   = SharedRegion_isCacheEnabled(
            SharedRegion_getId((Ptr)sharedAddr));
        notifyShmParams.localIntId     = NotifySetup_armRecvIntId0;
        notifyShmParams.remoteIntId    = NotifySetup_dspRecvIntId0;
        notifyShmParams.remoteProcId   = procId;
        notifyShmParams.lineId         = 0u;
        notifyShmParams.sharedAddr     = sharedAddr;

        NotifySetup_dspDriverHandle0 = NotifyDriverShm_create(&notifyShmParams);
#if !defined(SYSLINK_BUILD_OPTIMIZE)
        if (NotifySetup_dspDriverHandle0 == NULL) {
            /*! @retval  Notify_E_FAIL NotifyDriverShm_create failed for line
                                       0 */
            status = Notify_E_FAIL;
            GT_setFailureReason (curTrace,
                                 GT_4CLASS,
                                 "NotifySetupOmapl1xx_attach",
                                 status,
                                 "NotifyDriverShm_create failed for line 0");
        }
        else {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
            NotifySetup_notifyHandle0 = Notify_create (
                                                   NotifySetup_dspDriverHandle0,
                                                   procId,
                                                   0u,
                                                   NULL);

#if !defined(SYSLINK_BUILD_OPTIMIZE)
            if (NotifySetup_notifyHandle0 == NULL) {
                /*! @retval  Notify_E_FAIL Notify_create failed for line 0 */
                status = Notify_E_FAIL;
                GT_setFailureReason (curTrace,
                                     GT_4CLASS,
                                     "NotifySetupOmapl1xx_attach",
                                     status,
                                     "Notify_create failed for line 0");
            }
        }

        if (status >= 0) {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
            if (NotifySetup_useSecondLine) {
                /*
                 *  Setup the notify driver to the DSP (Line 1)
                 */
                NotifyDriverShm_Params_init (&notifyShmParams);
                notifyShmParams.localIntId     = NotifySetup_armRecvIntId1;
                notifyShmParams.remoteIntId    = NotifySetup_dspRecvIntId1;
                notifyShmParams.remoteProcId   = procId;
                notifyShmParams.lineId         = 1u;
                notifyShmParams.sharedAddr     = sharedAddr;/* To allow sharedegion
                                                             * Calculations
                                                             */
                notifyShmParams.sharedAddr     = (Ptr)((UInt32) sharedAddr +
                              NotifyDriverShm_sharedMemReq (&notifyShmParams));
                NotifySetup_dspDriverHandle1 = NotifyDriverShm_create (
                                                            &notifyShmParams);
#if !defined(SYSLINK_BUILD_OPTIMIZE)
                if (NotifySetup_dspDriverHandle1 == NULL) {
                    /*! @retval  Notify_E_FAIL NotifyDriverShm_create failed
                                               for line 1*/
                    status = Notify_E_FAIL;
                    GT_setFailureReason (curTrace,
                                 GT_4CLASS,
                                 "NotifySetupOmapl1xx_attach",
                                 status,
                                 "NotifyDriverShm_create failed for line 1");
                }
                else {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
                    NotifySetup_notifyHandle1 = Notify_create (
                                                  NotifySetup_dspDriverHandle1,
                                                  procId,
                                                  1u,
                                                  NULL);
#if !defined(SYSLINK_BUILD_OPTIMIZE)
                    if (NotifySetup_notifyHandle0 == NULL) {
                        /*! @retval  Notify_E_FAIL Notify_create failed for
                                                 line 1*/
                        status = Notify_E_FAIL;
                        GT_setFailureReason (curTrace,
                                         GT_4CLASS,
                                         "NotifySetupOmapl1xx_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, "NotifySetupOmapl1xx_attach", status);

    /*! @retval Notify_S_SUCCESS Operation successful */
    return (status);
}