public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lei Wen <leiwen@marvell.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] mmc: print out avaible partition table
Date: Mon, 13 Sep 2010 17:17:39 +0800	[thread overview]
Message-ID: <1284369459-29997-2-git-send-email-leiwen@marvell.com> (raw)
In-Reply-To: <1284369459-29997-1-git-send-email-leiwen@marvell.com>

Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 common/cmd_mmc.c |   20 ++++++++++++++++++++
 disk/part.c      |    3 +++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index c0b30d8..437dd88 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 avaiable partition on mmc\n"
 	"mmc list - lists available devices");
 #endif
diff --git a/disk/part.c b/disk/part.c
index 3ba88c7..1806fe6 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -364,6 +364,9 @@ static void print_part_header (const char *type, block_dev_desc_t * dev_desc)
 	case IF_TYPE_DOC:
 		puts ("DOC");
 		break;
+	case IF_TYPE_MMC:
+		puts ("MMC");
+		break;
 	default:
 		puts ("UNKNOWN");
 		break;
-- 
1.7.0.4

  reply	other threads:[~2010-09-13  9:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  9:17 [U-Boot] [PATCH 1/2] mmc: add boundary check for mmc operation Lei Wen
2010-09-13  9:17 ` Lei Wen [this message]
2010-09-13  9:47 ` Wolfgang Denk
2010-09-13 11:54 ` [U-Boot] [PATCH 1/2 V2] " Lei Wen
2010-09-13 13:40   ` Sergei Shtylyov
2010-09-13 14:03     ` Lei Wen
2010-09-13 11:54 ` [U-Boot] [PATCH 2/2 V2] mmc: print out avaible partition table Lei Wen
2010-09-13 13:41   ` Sergei Shtylyov
2010-09-13 14:03     ` Lei Wen
2010-09-13 14:07     ` [U-Boot] [PATCH 1/2 V3] mmc: add boundary check for mmc operation Lei Wen
2010-09-17  3:22       ` Lei Wen
2010-09-18 13:01         ` Lei Wen
2010-09-18 21:46       ` Wolfgang Denk
2010-09-20 10:39         ` Ghorai, Sukumar
2010-09-20 12:59           ` Lei Wen
2010-09-20 13:28             ` Ghorai, Sukumar
2010-10-12 19:20               ` Wolfgang Denk
2010-10-12 19:48                 ` Ghorai, Sukumar
2010-09-13 14:07     ` [U-Boot] [PATCH 2/2 V3] mmc: print out avaible partition table Lei Wen
2010-09-18 21:47       ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2010-09-13  4:06 [U-Boot] [PATCH 1/2] mmc: add boundary check for mmc operation Lei Wen
2010-09-13  4:06 ` [U-Boot] [PATCH 2/2] mmc: print out avaible partition table Lei Wen
2010-09-13  8:54   ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284369459-29997-2-git-send-email-leiwen@marvell.com \
    --to=leiwen@marvell.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox