Commit 2311344c authored by Adrian Hunter's avatar Adrian Hunter Committed by Chris Ball

mmc: mmc-test: add eMMC hardware reset test

MMC core provides a checking function that checks if the reset
has happended.  Add a test to use that function.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 0f201655
...@@ -2328,6 +2328,31 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test) ...@@ -2328,6 +2328,31 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
return mmc_test_rw_multiple_sg_len(test, &test_data); return mmc_test_rw_multiple_sg_len(test, &test_data);
} }
/*
* eMMC hardware reset.
*/
static int mmc_test_hw_reset(struct mmc_test_card *test)
{
struct mmc_card *card = test->card;
struct mmc_host *host = card->host;
int err;
err = mmc_hw_reset_check(host);
if (!err)
return RESULT_OK;
if (err == -ENOSYS)
return RESULT_FAIL;
if (err != -EOPNOTSUPP)
return err;
if (!mmc_can_reset(card))
return RESULT_UNSUP_CARD;
return RESULT_UNSUP_HOST;
}
static const struct mmc_test_case mmc_test_cases[] = { static const struct mmc_test_case mmc_test_cases[] = {
{ {
.name = "Basic write (no data verification)", .name = "Basic write (no data verification)",
...@@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = { ...@@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = {
.run = mmc_test_profile_sglen_r_nonblock_perf, .run = mmc_test_profile_sglen_r_nonblock_perf,
.cleanup = mmc_test_area_cleanup, .cleanup = mmc_test_area_cleanup,
}, },
{
.name = "eMMC hardware reset",
.run = mmc_test_hw_reset,
},
}; };
static DEFINE_MUTEX(mmc_test_lock); static DEFINE_MUTEX(mmc_test_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment