Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

void sah_Queue_Manager_Prime ( sah_Head_Desc entry  ) 

Prime SAHARA.

This function primes SAHARA for the first time or after the queue becomes empty. Queue lock must have been set by the caller of this routine.

Parameters:
entry A pointer to a sah_Head_Desc to Prime SAHARA with.
Returns:
void

Definition at line 324 of file sah_queue_manager.c.

References sah_Head_Desc::desc, sah_Find_With_State(), sah_HW_Read_DAR(), sah_HW_Write_DAR(), SAH_STATE_ON_SAHARA, and sah_Head_Desc::status.

Referenced by sah_Queue_Manager_Append_Entry(), and sah_reset_sahara_request().

{
#ifdef DIAG_DRV_QUEUE
      LOG_KDIAG("Priming SAHARA");
      if (entry == NULL) {
            LOG_KDIAG("Trying to prime SAHARA with a NULL entry pointer.");
      }
#endif

#ifndef SUBMIT_MULTIPLE_DARS
      /* BUG FIX: state machine can transition from Done1 Busy2 directly
       * to Idle. To fix that problem, only one DAR is being allowed on
       * SAHARA at a time */
      if (sah_Find_With_State(SAH_STATE_ON_SAHARA) != NULL) {
            return;
      }
#endif

#ifdef SAHARA_POWER_MANAGEMENT
      /* check that dynamic power management is not asserted */
    if (!sah_dpm_flag) {
#endif

      /* Enable the SAHARA Clocks */
#ifdef DIAG_DRV_IF
                  LOG_KDIAG("SAHARA : Enabling the IPG and AHB clocks\n")
#endif                        /*DIAG_DRV_IF */

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
            mxc_clks_enable(SAHARA2_CLK);
#else
            {
                  struct clk *clk = clk_get(NULL, "sahara_clk");
                  if (clk != ERR_PTR(ENOENT))
                        clk_enable(clk);
                  clk_put(clk);
            }
#endif

            /* Make sure nothing is in the DAR */
            if (sah_HW_Read_DAR() == 0) {
#if defined(DIAG_DRV_IF)
                  sah_Dump_Chain(&entry->desc, entry->desc.dma_addr);
#endif                        /* DIAG_DRV_IF */

                  sah_HW_Write_DAR((entry->desc.dma_addr));
                  entry->status = SAH_STATE_ON_SAHARA;
            }
#ifdef DIAG_DRV_QUEUE
            else {
                  LOG_KDIAG("DAR should be empty when Priming SAHARA");
            }
#endif
#ifdef SAHARA_POWER_MANAGEMENT
      }
#endif
}


Generated by  Doxygen 1.6.0   Back to index