platform/msm_shared/mmc.c
static unsigned int
mmc_boot_send_csd(struct mmc_boot_card *card, unsigned int *raw_csd)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_arg = 0;
	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));

	/* CMD9 Format:
	 * [31:16] RCA
	 * [15:0] stuff bits
	 */
	mmc_arg |= card->rca << 16;

	cmd.cmd_index = CMD9_SEND_CSD;
	cmd.argument = mmc_arg;
	cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
	cmd.resp_type = MMC_BOOT_RESP_R2;

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

	/* response contains the card csd */
	memcpy(raw_csd, cmd.resp, sizeof(cmd.resp));

	return MMC_BOOT_E_SUCCESS;
}
/*
 * Requests card to send it's CSD register's contents. (CMD9)
 */
Requests card to send it's CSD register's contents.
Requests card to send it ' s CSD register ' s contents .
static unsigned int
mmc_boot_send_csd(struct mmc_boot_card *card, unsigned int *raw_csd)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_arg = 0;
	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));
	mmc_arg |= card->rca << 16;
	cmd.cmd_index = CMD9_SEND_CSD;
	cmd.argument = mmc_arg;
	cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
	cmd.resp_type = MMC_BOOT_RESP_R2;
	mmc_ret = mmc_boot_send_command(&cmd);
	if (mmc_ret != MMC_BOOT_E_SUCCESS) {
		return mmc_ret;
	}
	memcpy(raw_csd, cmd.resp, sizeof(cmd.resp));
	return MMC_BOOT_E_SUCCESS;
}
static unsigned int mmc_boot_send_csd ( struct mmc_boot_card * card , unsigned int * raw_csd ) { struct mmc_boot_command cmd ; unsigned int mmc_arg = 0 ; 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 ) ) ; mmc_arg |= card -> rca << 16 ; cmd . cmd_index = CMD9_SEND_CSD ; cmd . argument = mmc_arg ; cmd . cmd_type = MMC_BOOT_CMD_ADDRESS ; cmd . resp_type = MMC_BOOT_RESP_R2 ; mmc_ret = mmc_boot_send_command ( & cmd ) ; if ( mmc_ret != MMC_BOOT_E_SUCCESS ) { return mmc_ret ; } memcpy ( raw_csd , cmd . resp , sizeof ( cmd . resp ) ) ; return MMC_BOOT_E_SUCCESS ; }
Requests card to send it's CSD register's contents.
Requests card to send it ' s CSD register ' s contents .
/* basic check */ /* CMD9 Format:
	 * [31:16] RCA
	 * [15:0] stuff bits
	 */ /* send command */ /* response contains the card csd */