platform/msm_shared/mmc.c
static unsigned int
mmc_boot_send_op_cond(struct mmc_boot_host *host, struct mmc_boot_card *card)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_resp = 0;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;

	/* basic check */
	if ((host == NULL) || (card == NULL)) {
		return MMC_BOOT_E_INVAL;
	}

	memset((struct mmc_boot_command *)&cmd, 0,
	       sizeof(struct mmc_boot_command));

	/* CMD1 format:
	 * [31] Busy bit
	 * [30:29] Access mode
	 * [28:24] reserved
	 * [23:15] 2.7-3.6
	 * [14:8]  2.0-2.6
	 * [7]     1.7-1.95
	 * [6:0]   reserved
	 */

	cmd.cmd_index = CMD1_SEND_OP_COND;
	cmd.argument = host->ocr;
	cmd.cmd_type = MMC_BOOT_CMD_BCAST_W_RESP;
	cmd.resp_type = MMC_BOOT_RESP_R3;

	mmc_ret = mmc_boot_send_command(&cmd);
	if (mmc_ret != MMC_BOOT_E_SUCCESS) {
		return mmc_ret;
	}

	/* Now it's time to examine response */
	mmc_resp = cmd.resp[0];

	/* Response contains card's ocr. Update card's information */
	card->ocr = mmc_resp;

	/* Check the response for busy status */
	if (!(mmc_resp & MMC_BOOT_OCR_BUSY)) {
		return MMC_BOOT_E_CARD_BUSY;
	}

	if (mmc_resp & MMC_BOOT_OCR_SEC_MODE) {
		card->type = MMC_BOOT_TYPE_MMCHC;
	} else {
		card->type = MMC_BOOT_TYPE_STD_MMC;
	}
	return MMC_BOOT_E_SUCCESS;
}
/*
 * Send CMD1 to know whether the card supports host VDD profile or not.
 */
Send CMD1 to know whether the card supports host VDD profile or not.
Send CMD1 to know whether the card supports host VDD profile or not .
static unsigned int
mmc_boot_send_op_cond(struct mmc_boot_host *host, struct mmc_boot_card *card)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_resp = 0;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
	if ((host == NULL) || (card == NULL)) {
		return MMC_BOOT_E_INVAL;
	}
	memset((struct mmc_boot_command *)&cmd, 0,
	       sizeof(struct mmc_boot_command));
	cmd.cmd_index = CMD1_SEND_OP_COND;
	cmd.argument = host->ocr;
	cmd.cmd_type = MMC_BOOT_CMD_BCAST_W_RESP;
	cmd.resp_type = MMC_BOOT_RESP_R3;
	mmc_ret = mmc_boot_send_command(&cmd);
	if (mmc_ret != MMC_BOOT_E_SUCCESS) {
		return mmc_ret;
	}
	mmc_resp = cmd.resp[0];
	card->ocr = mmc_resp;
	if (!(mmc_resp & MMC_BOOT_OCR_BUSY)) {
		return MMC_BOOT_E_CARD_BUSY;
	}
	if (mmc_resp & MMC_BOOT_OCR_SEC_MODE) {
		card->type = MMC_BOOT_TYPE_MMCHC;
	} else {
		card->type = MMC_BOOT_TYPE_STD_MMC;
	}
	return MMC_BOOT_E_SUCCESS;
}
static unsigned int mmc_boot_send_op_cond ( struct mmc_boot_host * host , struct mmc_boot_card * card ) { struct mmc_boot_command cmd ; unsigned int mmc_resp = 0 ; unsigned int mmc_ret = MMC_BOOT_E_SUCCESS ; if ( ( host == NULL ) || ( card == NULL ) ) { return MMC_BOOT_E_INVAL ; } memset ( ( struct mmc_boot_command * ) & cmd , 0 , sizeof ( struct mmc_boot_command ) ) ; cmd . cmd_index = CMD1_SEND_OP_COND ; cmd . argument = host -> ocr ; cmd . cmd_type = MMC_BOOT_CMD_BCAST_W_RESP ; cmd . resp_type = MMC_BOOT_RESP_R3 ; mmc_ret = mmc_boot_send_command ( & cmd ) ; if ( mmc_ret != MMC_BOOT_E_SUCCESS ) { return mmc_ret ; } mmc_resp = cmd . resp [ 0 ] ; card -> ocr = mmc_resp ; if ( ! ( mmc_resp & MMC_BOOT_OCR_BUSY ) ) { return MMC_BOOT_E_CARD_BUSY ; } if ( mmc_resp & MMC_BOOT_OCR_SEC_MODE ) { card -> type = MMC_BOOT_TYPE_MMCHC ; } else { card -> type = MMC_BOOT_TYPE_STD_MMC ; } return MMC_BOOT_E_SUCCESS ; }
Send CMD1 to know whether the card supports host VDD profile or not.
Send CMD1 to know whether the card supports host VDD profile or not .
/* basic check */ /* CMD1 format:
	 * [31] Busy bit
	 * [30:29] Access mode
	 * [28:24] reserved
	 * [23:15] 2.7-3.6
	 * [14:8]  2.0-2.6
	 * [7]     1.7-1.95
	 * [6:0]   reserved
	 */ /* Now it's time to examine response */ /* Response contains card's ocr. Update card's information */ /* Check the response for busy status */