platform/msm_shared/mmc.c
static unsigned int mmc_boot_status_error(unsigned mmc_status)
{
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;

	/* If DATA_CRC_FAIL bit is set to 1 then CRC error was detected by
	   card/device during the data transfer */
	if (mmc_status & MMC_BOOT_MCI_STAT_DATA_CRC_FAIL) {
		mmc_ret = MMC_BOOT_E_DATA_CRC_FAIL;
	}
	/* If DATA_TIMEOUT bit is set to 1 then the data transfer time exceeded
	   the data timeout period without completing the transfer */
	else if (mmc_status & MMC_BOOT_MCI_STAT_DATA_TIMEOUT) {
		mmc_ret = MMC_BOOT_E_DATA_TIMEOUT;
	}
	/* If RX_OVERRUN bit is set to 1 then SDCC2 tried to receive data from
	   the card before empty storage for new received data was available.
	   Verify that bit FLOW_ENA in MCI_CLK is set to 1 during the data xfer. */
	else if (mmc_status & MMC_BOOT_MCI_STAT_RX_OVRRUN) {
		/* Note: We've set FLOW_ENA bit in MCI_CLK to 1. so no need to verify
		   for now */
		mmc_ret = MMC_BOOT_E_RX_OVRRUN;
	}
	/* If TX_UNDERRUN bit is set to 1 then SDCC2 tried to send data to
	   the card before new data for sending was available. Verify that bit
	   FLOW_ENA in MCI_CLK is set to 1 during the data xfer. */
	else if (mmc_status & MMC_BOOT_MCI_STAT_TX_UNDRUN) {
		/* Note: We've set FLOW_ENA bit in MCI_CLK to 1.so skipping it now */
		mmc_ret = MMC_BOOT_E_RX_OVRRUN;
	}
	return mmc_ret;
}
/*
 * Decode type of error caused during read and write
 */
Decode type of error caused during read and write
Decode type of error caused during read and write
static unsigned int mmc_boot_status_error(unsigned mmc_status)
{
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
	if (mmc_status & MMC_BOOT_MCI_STAT_DATA_CRC_FAIL) {
		mmc_ret = MMC_BOOT_E_DATA_CRC_FAIL;
	}
	else if (mmc_status & MMC_BOOT_MCI_STAT_DATA_TIMEOUT) {
		mmc_ret = MMC_BOOT_E_DATA_TIMEOUT;
	}
	else if (mmc_status & MMC_BOOT_MCI_STAT_RX_OVRRUN) {
		mmc_ret = MMC_BOOT_E_RX_OVRRUN;
	}
	else if (mmc_status & MMC_BOOT_MCI_STAT_TX_UNDRUN) {
		mmc_ret = MMC_BOOT_E_RX_OVRRUN;
	}
	return mmc_ret;
}
static unsigned int mmc_boot_status_error ( unsigned mmc_status ) { unsigned int mmc_ret = MMC_BOOT_E_SUCCESS ; if ( mmc_status & MMC_BOOT_MCI_STAT_DATA_CRC_FAIL ) { mmc_ret = MMC_BOOT_E_DATA_CRC_FAIL ; } else if ( mmc_status & MMC_BOOT_MCI_STAT_DATA_TIMEOUT ) { mmc_ret = MMC_BOOT_E_DATA_TIMEOUT ; } else if ( mmc_status & MMC_BOOT_MCI_STAT_RX_OVRRUN ) { mmc_ret = MMC_BOOT_E_RX_OVRRUN ; } else if ( mmc_status & MMC_BOOT_MCI_STAT_TX_UNDRUN ) { mmc_ret = MMC_BOOT_E_RX_OVRRUN ; } return mmc_ret ; }
Decode type of error caused during read and write
Decode type of error caused during read and write
/* If DATA_CRC_FAIL bit is set to 1 then CRC error was detected by
	   card/device during the data transfer */ /* If DATA_TIMEOUT bit is set to 1 then the data transfer time exceeded
	   the data timeout period without completing the transfer */ /* If RX_OVERRUN bit is set to 1 then SDCC2 tried to receive data from
	   the card before empty storage for new received data was available.
	   Verify that bit FLOW_ENA in MCI_CLK is set to 1 during the data xfer. */ /* Note: We've set FLOW_ENA bit in MCI_CLK to 1. so no need to verify
		   for now */ /* If TX_UNDERRUN bit is set to 1 then SDCC2 tried to send data to
	   the card before new data for sending was available. Verify that bit
	   FLOW_ENA in MCI_CLK is set to 1 during the data xfer. */ /* Note: We've set FLOW_ENA bit in MCI_CLK to 1.so skipping it now */