[U-Boot] [U-BOOT] [PATCH] mmc: enable switch partition function

Wolfgang Denk wd at denx.de
Wed Apr 13 07:49:41 CEST 2011


Dear Lei Wen,

In message <BANLkTinFVYDiAt9D+EPadat2f_0qTQaS8w at mail.gmail.com> 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.


More information about the U-Boot mailing list