diff options
author | Lei Wen <leiwen@marvell.com> | 2010-09-13 22:07:28 +0800 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-09-18 23:47:28 +0200 |
commit | 8f3b96427aa573d5b300788e6ff5e989cff1e351 (patch) | |
tree | 3ea588c4b53e9b748aa91814b3b4110dd4b48446 /common/cmd_mmc.c | |
parent | d2bf29e3994688ce730c8ab82bbafe6e39c229c1 (diff) | |
download | u-boot-imx-8f3b96427aa573d5b300788e6ff5e989cff1e351.zip u-boot-imx-8f3b96427aa573d5b300788e6ff5e989cff1e351.tar.gz u-boot-imx-8f3b96427aa573d5b300788e6ff5e989cff1e351.tar.bz2 |
mmc: print out partition table
Signed-off-by: Lei Wen <leiwen@marvell.com>
Diffstat (limited to 'common/cmd_mmc.c')
-rw-r--r-- | common/cmd_mmc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 2b14a42..4e7bcdf 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -154,6 +154,25 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc_init(mmc); return 0; + } else if (strncmp(argv[1], "part", 4) == 0) { + int dev = simple_strtoul(argv[2], NULL, 10); + block_dev_desc_t *mmc_dev; + struct mmc *mmc = find_mmc_device(dev); + + if (!mmc) { + puts("no mmc devices available\n"); + return 1; + } + mmc_init(mmc); + mmc_dev = mmc_get_dev(dev); + if (mmc_dev != NULL && + mmc_dev->type != DEV_TYPE_UNKNOWN) { + print_part(mmc_dev); + return 0; + } + + puts("get mmc type error!\n"); + return 1; } case 0: @@ -230,5 +249,6 @@ U_BOOT_CMD( "read <device num> addr blk# cnt\n" "mmc write <device num> addr blk# cnt\n" "mmc rescan <device num>\n" + "mmc part <device num> - lists available partition on mmc\n" "mmc list - lists available devices"); #endif |