summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2011-08-29 16:42:14 +0300
committerChris Ball <cjb@laptop.org>2011-10-26 16:32:07 -0400
commit2311344c33cb8add492881900ca427b62f5a7eae (patch)
tree081fdccc56181878b8feca59088bb8622d0d309e /drivers/mmc/card
parent0f2016558e4f9a8d2f9b1202064915205f4dd450 (diff)
downloadblackbird-op-linux-2311344c33cb8add492881900ca427b62f5a7eae.tar.gz
blackbird-op-linux-2311344c33cb8add492881900ca427b62f5a7eae.zip
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: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/mmc_test.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 2bf229acd3b8..9cdce6367136 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -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);
}
+/*
+ * 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[] = {
{
.name = "Basic write (no data verification)",
@@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = {
.run = mmc_test_profile_sglen_r_nonblock_perf,
.cleanup = mmc_test_area_cleanup,
},
+
+ {
+ .name = "eMMC hardware reset",
+ .run = mmc_test_hw_reset,
+ },
};
static DEFINE_MUTEX(mmc_test_lock);
OpenPOWER on IntegriCloud