From: Wolfgang Denk Date: Wed, 13 Apr 2011 07:49:41 +0200 Subject: [U-Boot] [U-BOOT] [PATCH] mmc: enable switch partition function In-Reply-To: References: <1296463665-26551-1-git-send-email-leiwen@marvell.com> <20110208142758.1945014B9A0D@gemini.denx.de> <20110208151331.DE1E614B9A0D@gemini.denx.de> <20110412193123.05E1214F02E@gemini.denx.de> <20110413053508.41B4D151F83@gemini.denx.de> Message-ID: <20110413054941.4E5C1151F83@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Lei Wen, In message you wrote: > > > I'm not really sure I understand what this command was supposed to do. > > What I want to see is consistency with other drivers, i. e. you should > > be able to use "mmc dev" to select a device and optionally a partition > > on it as current device, so the remaining "mmc" commands do not need > > any device arguments any more. > > Like this mmc dev[:part], could it be acceptable? The command should work similar to what we see with other storage devices, i. e. mmc dev 3 will select device "3" as current device, so that mmc dev will print something like "mmc device 3: Model ... Type ... Capacity ..." etc., and that mmc read 80800000 0 100 would read the first 256 blocks of device 3 into RAM starting at address 80800000. Similar after mmc dev 2:3 but now for device 2, partition 3. For example, here is how it works on IDE: => help ide ide - IDE sub-system Usage: ide reset - reset IDE controller ide info - show available IDE devices ide device [dev] - show or set current device ide part [dev] - print partition table of one or all IDE devices ide read addr blk# cnt ide write addr blk# cnt - read/write `cnt' blocks starting at block `blk#' to/from memory address `addr' => ide dev IDE device 0: Model: ST920813AM Firm: 3.02 Ser#: 5QA015N2 Type: Hard Disk Capacity: 19077.1 MB = 18.6 GB (39070080 x 512) => ide dev 1 IDE device 1: not available > > I want to get rid of the device argument in all these calls. > > So the the mmc read would becomes "mmc read [ram address] [mmc sector > start] [sector num]"? Right. That's what we use on other storage devices, too. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You can only live once, but if you do it right, once is enough.