[U-Boot] [PATCH] rpi: Set the default mmc max device to 2

Simon Glass sjg at chromium.org
Mon Jul 9 02:39:40 UTC 2018


Hi Alex,

On 4 July 2018 at 00:48, Alexander Graf <agraf at suse.de> wrote:
> On 07/04/2018 09:34 AM, Emmanuel Vadot wrote:
>>
>> On Wed, 4 Jul 2018 09:25:16 +0200
>> Alexander Graf <agraf at suse.de> wrote:
>>
>>> On 07/04/2018 09:08 AM, Emmanuel Vadot wrote:
>>>>
>>>> When running with special configuration (OF_BOARD and mmc overlay)
>>>> RPI have the SD card as id 1.
>>>> This make device enumeration fails when using the API.
>>>>
>>>> Signed-off-by: Emmanuel Vadot <manu at freebsd.org>
>>>
>>> Could you please elaborate a bit? From the commit message I don't fully
>>> understand which problem you're trying to solve.
>>>
>>>
>>> Thanks,
>>>
>>> Alex
>>
>>   Sure,
>>
>>   When using the dtb from the rpi fundation and the mmc overlay (which
>> switch back the sd card to use the SDHCI controller and not the SDHOST
>> one) and using OF_BOARD so u-boot uses it/pass it to the OS the device
>> id for the sd is 1 :
>> U-Boot> mmc list
>> mmc at 7e300000: 1
>>
>>   This cause the API (see api/api_storage.c) code to never expose this
>> device to the consumer as the default value for
>> CONFIG_SYS_MMC_MAX_DEVICE is 1.
>
>
> Ouch, that whole file assumes that you know the number of devices present in
> your system. That's terrible.
>
> I think the real fix would be to convert api_storage.c to instead use dm
> native routines to loop through all available devices and not explicitly
> depend on any maximum number of possible devices.
>
> Simon, do you potentially have a patch lying around for that in a branch
> already?

No sorry I don't.

The API could use another look for DM.

Regards,
Simon


More information about the U-Boot mailing list