platform/msm_shared/mmc.c
static unsigned int mmc_boot_send_relative_address(struct mmc_boot_card *card)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;

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

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

	/* CMD3 Format:
	 * [31:0] stuff bits
	 */
	if (card->type == MMC_BOOT_TYPE_SDHC
	    || card->type == MMC_BOOT_TYPE_STD_SD) {
		cmd.cmd_index = CMD3_SEND_RELATIVE_ADDR;
		cmd.argument = 0;
		cmd.cmd_type = MMC_BOOT_CMD_BCAST_W_RESP;
		cmd.resp_type = MMC_BOOT_RESP_R6;

		/* send command */
		mmc_ret = mmc_boot_send_command(&cmd);
		if (mmc_ret != MMC_BOOT_E_SUCCESS) {
			return mmc_ret;
		}
		/* For sD, card will send RCA. Store it */
		card->rca = (cmd.resp[0] >> 16);
	} else {
		cmd.cmd_index = CMD3_SEND_RELATIVE_ADDR;
		cmd.argument = (MMC_RCA << 16);
		card->rca = (cmd.argument >> 16);
		cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
		cmd.resp_type = MMC_BOOT_RESP_R1;

		/* send command */
		mmc_ret = mmc_boot_send_command(&cmd);
		if (mmc_ret != MMC_BOOT_E_SUCCESS) {
			return mmc_ret;
		}
	}

	return MMC_BOOT_E_SUCCESS;
}
/*
 * Ask any card to send it's relative card address (RCA).This RCA number is
 * shorter than CID and is used by the host to address the card in future (CMD3)
 */
Ask any card to send it's relative card address (RCA).This RCA number is
shorter than CID and is used by the host to address the card in future (CMD3)
Ask any card to send it ' s relative card address ( RCA ) . This RCA number is shorter than CID and is used by the host to address the card in future ( CMD3 )
static unsigned int mmc_boot_send_relative_address(struct mmc_boot_card *card)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
	if (card == NULL) {
		return MMC_BOOT_E_INVAL;
	}
	memset((struct mmc_boot_command *)&cmd, 0,
	       sizeof(struct mmc_boot_command));
	if (card->type == MMC_BOOT_TYPE_SDHC
	    || card->type == MMC_BOOT_TYPE_STD_SD) {
		cmd.cmd_index = CMD3_SEND_RELATIVE_ADDR;
		cmd.argument = 0;
		cmd.cmd_type = MMC_BOOT_CMD_BCAST_W_RESP;
		cmd.resp_type = MMC_BOOT_RESP_R6;
		mmc_ret = mmc_boot_send_command(&cmd);
		if (mmc_ret != MMC_BOOT_E_SUCCESS) {
			return mmc_ret;
		}
		card->rca = (cmd.resp[0] >> 16);
	} else {
		cmd.cmd_index = CMD3_SEND_RELATIVE_ADDR;
		cmd.argument = (MMC_RCA << 16);
		card->rca = (cmd.argument >> 16);
		cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
		cmd.resp_type = MMC_BOOT_RESP_R1;
		mmc_ret = mmc_boot_send_command(&cmd);
		if (mmc_ret != MMC_BOOT_E_SUCCESS) {
			return mmc_ret;
		}
	}
	return MMC_BOOT_E_SUCCESS;
}
static unsigned int mmc_boot_send_relative_address ( struct mmc_boot_card * card ) { struct mmc_boot_command cmd ; unsigned int mmc_ret = MMC_BOOT_E_SUCCESS ; if ( card == NULL ) { return MMC_BOOT_E_INVAL ; } memset ( ( struct mmc_boot_command * ) & cmd , 0 , sizeof ( struct mmc_boot_command ) ) ; if ( card -> type == MMC_BOOT_TYPE_SDHC || card -> type == MMC_BOOT_TYPE_STD_SD ) { cmd . cmd_index = CMD3_SEND_RELATIVE_ADDR ; cmd . argument = 0 ; cmd . cmd_type = MMC_BOOT_CMD_BCAST_W_RESP ; cmd . resp_type = MMC_BOOT_RESP_R6 ; mmc_ret = mmc_boot_send_command ( & cmd ) ; if ( mmc_ret != MMC_BOOT_E_SUCCESS ) { return mmc_ret ; } card -> rca = ( cmd . resp [ 0 ] >> 16 ) ; } else { cmd . cmd_index = CMD3_SEND_RELATIVE_ADDR ; cmd . argument = ( MMC_RCA << 16 ) ; card -> rca = ( cmd . argument >> 16 ) ; cmd . cmd_type = MMC_BOOT_CMD_ADDRESS ; cmd . resp_type = MMC_BOOT_RESP_R1 ; mmc_ret = mmc_boot_send_command ( & cmd ) ; if ( mmc_ret != MMC_BOOT_E_SUCCESS ) { return mmc_ret ; } } return MMC_BOOT_E_SUCCESS ; }
Ask any card to send it's relative card address (RCA).This RCA number is
 shorter than CID and is used by the host to address the card in future (CMD3)
Ask any card to send it ' s relative card address ( RCA ) . This RCA number is shorter than CID and is used by the host to address the card in future ( CMD3 )
/* basic check */ /* CMD3 Format:
	 * [31:0] stuff bits
	 */ /* send command */ /* For sD, card will send RCA. Store it */ /* send command */