Ejemplo n.º 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);
}
Ejemplo n.º 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);
}
Ejemplo n.º 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);
}
Ejemplo n.º 4
0
/*
 *  ======== ti_sdo_ipc_Notify_Module_startup ========
 */
Int ti_sdo_ipc_Notify_Module_startup(Int phase)
{
    UInt16 procId = MultiProc_self();

    /*
     *  Wait for Startup to be done (if MultiProc id not yet set) because a
     *  user fxn may set it
     */
    if (!Startup_Module_startupDone() && procId == MultiProc_INVALIDID) {
        return (Startup_NOTDONE);
    }

    /* Ensure that the MultiProc ID has been configured */
    Assert_isTrue(procId != MultiProc_INVALIDID,
                  ti_sdo_utils_MultiProc_A_invalidMultiProcId);

    /* Create a local instance */
    ti_sdo_ipc_Notify_create(NULL, procId, 0, NULL, NULL);

    return (Startup_DONE);
}
Ejemplo n.º 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 (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);
}
Ejemplo n.º 6
0
/*!
 *  ======== 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(&notifyShmParams);
    notifyShmParams.localIntId     = NotifyCircSetup_dspRecvIntId0;
    notifyShmParams.remoteIntId    = NotifyCircSetup_armRecvIntId0;
    notifyShmParams.intVectorId    = NotifyCircSetup_dspIntVectId0;
    notifyShmParams.remoteProcId   = armProcId;
    notifyShmParams.sharedAddr     = sharedAddr;
    
    armDriverHandle0 = NotifyDriverCirc_create(&notifyShmParams, &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(&notifyShmParams);
    notifyShmParams.localIntId     = NotifyCircSetup_dspRecvIntId1;
    notifyShmParams.remoteIntId    = NotifyCircSetup_armRecvIntId1;
    notifyShmParams.intVectorId    = NotifyCircSetup_dspIntVectId1;
    notifyShmParams.remoteProcId   = armProcId;
    notifyShmParams.sharedAddr     = (Ptr)((UInt32)sharedAddr + 
        NotifyDriverCirc_sharedMemReq(&notifyShmParams));
    armDriverHandle1 = NotifyDriverCirc_create(&notifyShmParams, &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(&notifyShmParams);
    notifyShmParams.localIntId     = NotifyCircSetup_armRecvIntId0;
    notifyShmParams.remoteIntId    = NotifyCircSetup_dspRecvIntId0;
    notifyShmParams.remoteProcId   = dspProcId;
    notifyShmParams.sharedAddr     = sharedAddr;
    
    dspDriverHandle0 = NotifyDriverCirc_create(&notifyShmParams, &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(&notifyShmParams);
    notifyShmParams.localIntId     = NotifyCircSetup_armRecvIntId1;
    notifyShmParams.remoteIntId    = NotifyCircSetup_dspRecvIntId1;
    notifyShmParams.remoteProcId   = dspProcId;
    notifyShmParams.sharedAddr     = (Ptr)((UInt32)sharedAddr + 
        NotifyDriverCirc_sharedMemReq(&notifyShmParams));
    dspDriverHandle1 = NotifyDriverCirc_create(&notifyShmParams, &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);
}