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

Wolfgang Denk wd at denx.de
Tue Apr 12 21:31:23 CEST 2011


Dear Lei Wen,

In message <AANLkTikH_5rXgFsWbNRnBQtB6WFjT=2K8pd8CBXaKcCQ at mail.gmail.com> you wrote:
>
> Further refine this idea, don't need to call mmc_register multi-times.
> For the purpose is to switch partition when needed, we really do want to one
> real device. So I propose a new solution as:
> 
> Assume there is two sd/mmc controller on the board, named as mmc0&mmc1.
> The mmc0 attach with a sd card, and mmc1 attach with a emmc that has partition
> supported. Then we would have mmc(2, 3, 4, 5, 6, 7, 8) faked device map to mmc0
> , mmc(9, 10, 11, 12, 13, 14, 15) map to mmc1.
> 
> Give the command as "mmc read 9 0x1000000 0 0x10", uboot would get the
> real device
> num by 9/7, while hardware part num is (9-1-7*real_dev_num) that is 1.
> So we need
> to make mmc1 send the switch part 1 command to the emmc, then perform the read
> operation.
> 
> If we want to run "mmc read 5 0x10000 0x10 0x5", the sd attach on mmc0 has no
> hardware partition suppport, it would simply refuse to execute that command.
> Or if we want to be more gracefully handled, we could let the read 5
> perform like the
> read 0 command.

This is ugly and error prone.

Why don't you follow the existing examples from other storage devices,
where we have a "dev" subcommand that allows to select one of the
existing devices as "active" device?  Similarly, you could here select
an active device/partition pair.

This makes the access commands easier, and the user has much less
problems to figure out which number he has to use to specify the -
wrong - partition.

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
No journaling file system can recover your data if the disk dies.
                                 - Steve Rago in <D4Cw1p.L9E at plc.com>


More information about the U-Boot mailing list