[U-Boot] [U-BOOT] [PATCH] mmc: enable switch partition function
Lei Wen
adrian.wenl at gmail.com
Sat Feb 12 04:30:30 CET 2011
Hi,
On Fri, Feb 11, 2011 at 11:05 PM, Lei Wen <adrian.wenl at gmail.com> wrote:
>>
>> I am thinking now approach for this.
>> How about adding addtitional member in the mmc structure, like part.
>> During mmc probe, the driver could know whether the device support partition
>> switch or not, if it support, we could register three other "faked" mmc device
>> corresponding to two boot partition, and RPMB partition.
>>
>> Then we could use the current command to access the different hardware
>> partition in the emmc. Like if we are accessing one hardware partition, we need
>> to send switch command first. If the part member in the mmc is a invalid value,
>> we then don't send that switch partition command.
>>
>> Could this approach be acceptable?
>>
>
> 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.
>
Any feedback for this?...
Thanks,
Lei
More information about the U-Boot
mailing list