DMA那部分,我改成扫描模式后,CMD17会发送两次,不过,打出来的数据大部分是0。。。
DMA中断模式:
if(WaitForSingleObject(m_hDMAInterruptEvent, INFINITE) != WAIT_OBJECT_0)
{
RETAILMSG(DEBUG_SD, (TEXT("__IST__BADLUCK_TransferIstThread(): Wait for DMA Interrupt Failed!\n")));
Stop_SDIO_DMA_Channel();
status = SD_API_STATUS_DATA_TIMEOUT;
goto TRANSFER_DONE;
}
RETAILMSG(DEBUG_SD, (TEXT("After WaitForSingleObject DMACIntTCStatus0=0x%8x\r\n"),(DWORD)vm_pDMAreg->DMACIntTCStatus));
InterruptDone(m_dwDMASysIntr);
DMA的扫描模式:
temp =(vm_pSDIReg->SD_RINTSTS) & 0x8; //transmit FIFO data request
while( temp != 0x8)
{
RETAILMSG(DEBUG_SD, (TEXT("~~~~~~~~Here wait for data transfer over, SD_STATUS=0x%8x\r\n"),(DWORD)vm_pSDIReg->SD_STATUS));
RETAILMSG(DEBUG_SD, (TEXT("I am waiting,SD_RINTSTS=0x%x \n"),(UINT32)( vm_pSDIReg->SD_RINTSTS)));
temp =( vm_pSDIReg->SD_RINTSTS) & 0x8;
}
RETAILMSG(DEBUG_SD, (TEXT("~~~~~~~~After data transfer over, SD_STATUS=0x%8x\r\n"),(DWORD)vm_pSDIReg->SD_STATUS));
if(m_bDriverShutdown)
{
Stop_SDIO_DMA_Channel();
RETAILMSG(DEBUG_SD, (TEXT("__IST___TransferIstThread_TransferIstThread(): Thread Exiting\n")));
return FALSE;
} |