summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-01-09 11:05:32 -0500
committerTom Rini <trini@ti.com>2014-01-09 11:05:32 -0500
commit8401bfa91ef57e331e2a3abdf768d41803bec88e (patch)
tree144e43bb5db26b33fcbadbb52d80760af2f70d04 /common
parent33d413fc91e0bbbb92962a80f5333d6f1f628c5b (diff)
parentc5c1af21764d9423b45c1d03e835c4547a8bc5cb (diff)
Merge branch 'master' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mmc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 67a94a74688..da5fef9db9d 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -340,6 +340,28 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
#endif /* CONFIG_SUPPORT_EMMC_BOOT */
}
+
+ else if (argc == 3 && strcmp(argv[1], "setdsr") == 0) {
+ struct mmc *mmc = find_mmc_device(curr_device);
+ u32 val = simple_strtoul(argv[2], NULL, 16);
+ int ret;
+
+ if (!mmc) {
+ printf("no mmc device at slot %x\n", curr_device);
+ return 1;
+ }
+ ret = mmc_set_dsr(mmc, val);
+ printf("set dsr %s\n", (!ret) ? "OK, force rescan" : "ERROR");
+ if (!ret) {
+ mmc->has_init = 0;
+ if (mmc_init(mmc))
+ return 1;
+ else
+ return 0;
+ }
+ return ret;
+ }
+
state = MMC_INVALID;
if (argc == 5 && strcmp(argv[1], "read") == 0)
state = MMC_READ;
@@ -423,5 +445,6 @@ U_BOOT_CMD(
"mmc bootpart <device num> <boot part size MB> <RPMB part size MB>\n"
" - change sizes of boot and RPMB partitions of specified device\n"
#endif
+ "mmc setdsr - set DSR register value\n"
);
#endif /* !CONFIG_GENERIC_MMC */