Exemple #1
0
static void ak98_mci_send_request(struct mmc_host *mmc)
{
    struct ak98_mci_host *host = mmc_priv(mmc); 
    struct mmc_request *mrq = host->mrq;	
    unsigned long flags; 


#ifdef CONFIG_CPU_FREQ
     /*
        * need not to acquire the freq_lock in interrupt.
        */
     if (!in_interrupt()) 
     {                     
		 down(&host->freq_lock);
         
     }    
#endif

#ifdef CONFIG_MTD_NAND_AK98	
     /*
        * need not to acquire the nand_lock in interrupt.
        */
     if (!in_interrupt()) 
     {                     
         down(&nand_lock);           
     }    
#endif

    ak98_group_pin_config();

    /*
        *when transmit data, alloc the L2 buffer Id.
        */
    if(mrq->data)
    {
        l2_mci_bufid = ak98_l2_alloc(ADDR_MMC_SD);
        if (BUF_NULL == l2_mci_bufid)
        {
            printk("L2 buffer malloc fail!\n");
            BUG();
        }
        ak98_l2_clr_status(l2_mci_bufid);
    }    
    
    spin_lock_irqsave(&host->lock, flags);  
    
	if (mrq->data && (mrq->data->flags & MMC_DATA_READ))
		ak98_mci_start_data(host, mrq->data);

	ak98_mci_start_command(host, mrq->cmd);

	spin_unlock_irqrestore(&host->lock, flags);    

}
Exemple #2
0
static void ak98_sdio_data_irq(struct ak98_mci_host *host, struct mmc_data *data,
		  unsigned int status)
{
	if (status & MCI_DATABLOCKEND) {
		PK("BLOCKEND\n");
#ifdef AKMCI_L2FIFO_PIO
        if (data->flags & MMC_DATA_WRITE)
        {
            ak98_l2_clr_status(l2_sdio_bufid);
        }
		if (host->size > 0)
			mci_xfer(host);
		
#endif
	}
	if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT)) {
		PK1("DATA ERROR: 0x%08x\n", status);

		if (status & MCI_DATACRCFAIL )
			data->error = -EILSEQ;
		else if (status & MCI_DATATIMEOUT)
			data->error = -ETIMEDOUT;
		status |= MCI_DATAEND;
		/*
		 * We hit an error condition.  Ensure that any data
		 * partially written to a page is properly coherent.
		 */
		if (host->sg_len && data->flags & MMC_DATA_READ)
			flush_dcache_page(sg_page(host->sg_ptr));
	}
	if (status & MCI_DATAEND) {
		ak98_sdio_stop_data(host);

		//dump_data(data);

		if (!data->stop) {
			ak98_sdio_request_end(host, data->mrq);
		} else {
			ak98_sdio_start_command(host, data->stop);
		}
	}
}
Exemple #3
0
static void ak98_sdio_send_request(struct mmc_host *mmc)
{
    struct ak98_mci_host *host = mmc_priv(mmc); 
    struct mmc_request *mrq = host->mrq;	
    unsigned long flags;    

#ifdef CONFIG_CPU_FREQ
	 /*
		* need not to acquire the freq_lock in interrupt.
	*/
	 if (!in_interrupt()) 
	 {					   
		 down(&host->freq_lock);
		 
	 }	  
#endif
    

    if(mrq->data || mrq->cmd->data)
    {
        l2_sdio_bufid = ak98_l2_alloc(ADDR_SDIO);
        if (BUF_NULL == l2_sdio_bufid)
        {
            printk("L2 buffer malloc fail!\n");
            BUG();
        }
        ak98_l2_clr_status(l2_sdio_bufid);
    }
    
    spin_lock_irqsave(&host->lock, flags);  
    
	if (mrq->data && (mrq->data->flags & MMC_DATA_READ))
		ak98_sdio_start_data(host, mrq->data);

	ak98_sdio_start_command(host, mrq->cmd);

	spin_unlock_irqrestore(&host->lock, flags);    

}