Commit 4af1749d authored by Sebastian Rasmussen's avatar Sebastian Rasmussen Committed by Chris Ball
Browse files

mmc-utils: Merge the lsmmc tool into mmc-utils



The lsmmc tools contains an extensive parser of the CID, CSD, SCR
registers from userspace. The utility works as-is and uses sysfs
to read the register values.

The original code is created by Sebastian Rasmussen and still lives
in an attachment in the mail archive of linux-mmc. It need to be merged
into mmc-utils repository, which is convenient for testing MMC device
from userspace.

Change since v3:
 - Remove the unused EXT_CSD parser in lsmmc.c file.
Signed-off-by: default avatarSebastian Rasmussen <sebras@gmail.com>
Signed-off-by: default avatarChris Ball <chris@printf.net>
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
parent 44f94b92
......@@ -4,6 +4,7 @@ CFLAGS ?= -g -O2
objects = \
mmc.o \
mmc_cmds.o \
lsmmc.o \
3rdparty/hmac_sha/hmac_sha2.o \
3rdparty/hmac_sha/sha2.o
......
This diff is collapsed.
......@@ -175,6 +175,24 @@ static struct Command commands[] = {
"NOTE! The cache is an optional feature on devices >= eMMC4.5.",
NULL
},
{ do_read_csd, -1,
"csd read", "<device path>\n"
"Print CSD data from <device path>.\n"
"The device path should specify the csd file directory.",
NULL
},
{ do_read_cid, -1,
"cid read", "<device path>\n"
"Print CID data from <device path>.\n"
"The device path should specify the cid file directory.",
NULL
},
{ do_read_scr, -1,
"scr read", "<device path>\n"
"Print SCR data from <device path>.\n"
"The device path should specify the scr file directory.",
NULL
},
{ 0, 0, 0, 0 }
};
......
......@@ -36,3 +36,6 @@ int do_rpmb_read_block(int nargs, char **argv);
int do_rpmb_write_block(int nargs, char **argv);
int do_cache_en(int nargs, char **argv);
int do_cache_dis(int nargs, char **argv);
int do_read_scr(int argc, char **argv);
int do_read_cid(int argc, char **argv);
int do_read_csd(int argc, char **argv);
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