Beispiel #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);
}
Beispiel #2
0
/*!
 *  ======== NotifySetup_sharedMemReq ========
 */  
SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) 
{
    SizeT memReq;
    NotifyDriverShm_Params notifyShmParams;
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;

    memReq = NotifyDriverShm_sharedMemReq(&notifyShmParams);

    return (memReq);
}
Beispiel #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;
    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);
}
Beispiel #4
0
/*!
 * ======== NotifySetup_sharedMemReq ========
 */
SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
{
    SizeT memReq;
    NotifyDriverShm_Params params;
    
    NotifyDriverShm_Params_init(&params);
    params.sharedAddr      = sharedAddr;
    params.intVectorId     = NotifySetup_dspIntVectId;
    params.remoteProcId    = remoteProcId;

    memReq = NotifyDriverShm_sharedMemReq(&params);
    
    return(memReq);
}
Beispiel #5
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);
}
Beispiel #6
0
/*!
 * ======== NotifySetup_sharedMemReq ========
 */
SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr)
{
    SizeT memReq;
    NotifyDriverShm_Params params;

    Assert_isTrue(remoteProcId != MultiProc_getId("HOST"), NULL);

    NotifyDriverShm_Params_init(&params);
    params.sharedAddr      = sharedAddr;
    params.intVectorId     = NotifySetup_dspIntVectId;
    params.remoteProcId    = remoteProcId;

    memReq = NotifyDriverShm_sharedMemReq(&params);

    return(memReq);
}
Beispiel #7
0
/*!
 *  ======== NotifySetup_sharedMemReq ========
 */  
SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) 
{
    SizeT memReq;
    NotifyDriverShm_Params notifyShmParams;
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;
    /* Disable cache for inter-ducati NotifyDriverShm instances */
    /*if ((MultiProc_self() == NotifySetup_vpssProcId && 
         remoteProcId == NotifySetup_videoProcId) ||
        (MultiProc_self() == NotifySetup_videoProcId && 
        remoteProcId == NotifySetup_vpssProcId)) {
        notifyShmParams.cacheEnabled = FALSE;
        notifyShmParams.cacheLineSize = 0;
    }*/

    memReq = NotifyDriverShm_sharedMemReq(&notifyShmParams);

    return (memReq);
}
Beispiel #8
0
/*!
 *  ======== NotifySetup_sharedMemReq ========
 */  
SizeT NotifySetup_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr) 
{
    SizeT memReq;
    NotifyDriverShm_Params notifyShmParams;
    UInt16 myId = MultiProc_self();   
    
    NotifyDriverShm_Params_init(&notifyShmParams);
    notifyShmParams.sharedAddr = sharedAddr;
    /* 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;
    }

    memReq = NotifyDriverShm_sharedMemReq(&notifyShmParams);
    
    return (memReq);
}
/*!
 *  ======== NotifySetup_sharedMemReq ========
 *  Return the amount of shared memory required
 */
SizeT
NotifySetupOmapl1xx_sharedMemReq (UInt16 remoteProcId, Ptr sharedAddr)
{
    SizeT                  memReq = 0x0;
    NotifyDriverShm_Params params;

    GT_1trace (curTrace, GT_ENTER, "NotifySetupOmapl1xx_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,
                             "NotifySetupOmapl1xx_sharedMemReq",
                             Notify_E_INVALIDARG,
                             "Invalid NULL sharedAddr provided.");
    }
    else {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
        NotifyDriverShm_Params_init (&params);
        params.sharedAddr = sharedAddr;

        if (!NotifySetup_useSecondLine) {
            memReq = NotifyDriverShm_sharedMemReq (&params);
        }
        else {
            memReq = 2 * NotifyDriverShm_sharedMemReq (&params);
        }
#if !defined(SYSLINK_BUILD_OPTIMIZE)
    }
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */

    GT_1trace (curTrace, GT_LEAVE, "NotifySetupOmapl1xx_sharedMemReq", memReq);

    /*! @retval Shared-Memory-Requirements Operation successful */
    return (memReq);
}
Beispiel #10
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);
}
/*!
 *  @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);
}