int mmc_start_movi_smart(struct mmc_card *card)
{
	int ret;
	u8 data_buf[512];
	u32 date = 0;
	u32 old_date = 0;
	u32 movi_ver = 0;

	ret = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (ret)
		return ret;

	ret = mmc_movi_cmd(card->host, 0x0000CCEE);
	if (ret)
		return ret;

	ret = mmc_movi_read_req(card, (void *)data_buf, 0x1000, 1);
	if (ret)
		return ret;

	ret = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (ret)
		return ret;

	ret = mmc_movi_cmd(card->host, 0x00DECCEE);
	if (ret)
		return ret;

	movi_ver = ((data_buf[312] << 24) | (data_buf[313] << 16) |
			(data_buf[314] << 8) | data_buf[315]);
	if (movi_ver == MOVI_CONT_VMX0)
		ret = MMC_MOVI_VER_VMX0;
	else if (movi_ver == MOVI_CONT_VHX0)
		ret = MMC_MOVI_VER_VHX0;
	else
		ret = 0x0;

	date = ((data_buf[327] << 24) | (data_buf[326] << 16) |
				(data_buf[325] << 8) | data_buf[324]);

	card->movi_fwver = data_buf[320];
	card->movi_fwdate = date;

	old_date =  ((data_buf[351] << 24) | (data_buf[350] << 16) |
			(data_buf[349] << 8) | data_buf[348]);

	pr_info("%s : %02x : %02x : %08x : %x.\n", mmc_hostname(card->host),
			ret, card->movi_fwver, card->movi_fwdate, old_date);

	return ret;
}
Exemple #2
0
int mmc_start_movi_operation(struct mmc_card *card)
{
	int err = 0;

	err = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (err)
		return err;
	err = mmc_movi_cmd(card->host, 0x10210000);
	if (err)
		return err;

	err = mmc_movi_erase_cmd(card->host, 0x00040300, 0x4A03B510);
	if (err)
		return err;
	err = mmc_movi_erase_cmd(card->host, 0x00040304, 0x28004790);
	if (err)
		return err;
	err = mmc_movi_erase_cmd(card->host, 0x00040308, 0xE7FED100);
	if (err)
		return err;
	err = mmc_movi_erase_cmd(card->host, 0x0004030C, 0x0000BD10);
	if (err)
		return err;
	err = mmc_movi_erase_cmd(card->host, 0x00040310, 0x00059D73);
	if (err)
		return err;
	err = mmc_movi_erase_cmd(card->host, 0x0005C7EA, 0xFD89F7E3);
	if (err)
		return err;

	err = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (err)
		return err;
	err = mmc_movi_cmd(card->host, 0x00DECCEE);
	if (err)
		return err;

	return err;
}
Exemple #3
0
int mmc_start_movi_smart(struct mmc_card *card)
{
	int err;
	u8 data_buf[512];
	u32 date = 0;

	err = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (err)
		return err;

	err = mmc_movi_cmd(card->host, 0x0000CCEE);
	if (err)
		return err;

	err = mmc_movi_read_req(card, (void *)data_buf, 0x1000, 1);
	if (err)
		return err;

	err = mmc_movi_cmd(card->host, 0xEFAC62EC);
	if (err)
		return err;

	err = mmc_movi_cmd(card->host, 0x00DECCEE);
	if (err)
		return err;

	date = ((data_buf[327] << 24) | (data_buf[326] << 16) |
				(data_buf[325] << 8) | data_buf[324]);

	if (date !=  0x20120413) {
		err = -1;
		return err;
		}

	return 0x2;
}