* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
@ 2018-07-04 7:08 Emmanuel Vadot
2018-07-04 7:25 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel Vadot @ 2018-07-04 7:08 UTC (permalink / raw)
To: u-boot
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@freebsd.org>
---
include/configs/rpi.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index a97550b732..26fc9b9d95 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -69,6 +69,8 @@
#define CONFIG_MISC_INIT_R
#endif
+#define CONFIG_SYS_MMC_MAX_DEVICE 2
+
/* Console configuration */
#define CONFIG_SYS_CBSIZE 1024
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
2018-07-04 7:08 [U-Boot] [PATCH] rpi: Set the default mmc max device to 2 Emmanuel Vadot
@ 2018-07-04 7:25 ` Alexander Graf
2018-07-04 7:34 ` Emmanuel Vadot
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2018-07-04 7:25 UTC (permalink / raw)
To: u-boot
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@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
> ---
> include/configs/rpi.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/configs/rpi.h b/include/configs/rpi.h
> index a97550b732..26fc9b9d95 100644
> --- a/include/configs/rpi.h
> +++ b/include/configs/rpi.h
> @@ -69,6 +69,8 @@
> #define CONFIG_MISC_INIT_R
> #endif
>
> +#define CONFIG_SYS_MMC_MAX_DEVICE 2
> +
> /* Console configuration */
> #define CONFIG_SYS_CBSIZE 1024
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
2018-07-04 7:25 ` Alexander Graf
@ 2018-07-04 7:34 ` Emmanuel Vadot
2018-07-04 7:48 ` Alexander Graf
2018-12-02 21:54 ` Alexander Graf
0 siblings, 2 replies; 6+ messages in thread
From: Emmanuel Vadot @ 2018-07-04 7:34 UTC (permalink / raw)
To: u-boot
On Wed, 4 Jul 2018 09:25:16 +0200
Alexander Graf <agraf@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@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.
If it's more clear I'll send a v2 with those words.
Cheers,
> > ---
> > include/configs/rpi.h | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/include/configs/rpi.h b/include/configs/rpi.h
> > index a97550b732..26fc9b9d95 100644
> > --- a/include/configs/rpi.h
> > +++ b/include/configs/rpi.h
> > @@ -69,6 +69,8 @@
> > #define CONFIG_MISC_INIT_R
> > #endif
> >
> > +#define CONFIG_SYS_MMC_MAX_DEVICE 2
> > +
> > /* Console configuration */
> > #define CONFIG_SYS_CBSIZE 1024
> >
--
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
2018-07-04 7:34 ` Emmanuel Vadot
@ 2018-07-04 7:48 ` Alexander Graf
2018-07-09 2:39 ` Simon Glass
2018-12-02 21:54 ` Alexander Graf
1 sibling, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2018-07-04 7:48 UTC (permalink / raw)
To: u-boot
On 07/04/2018 09:34 AM, Emmanuel Vadot wrote:
> On Wed, 4 Jul 2018 09:25:16 +0200
> Alexander Graf <agraf@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@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?
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
2018-07-04 7:48 ` Alexander Graf
@ 2018-07-09 2:39 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2018-07-09 2:39 UTC (permalink / raw)
To: u-boot
Hi Alex,
On 4 July 2018 at 00:48, Alexander Graf <agraf@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@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@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] rpi: Set the default mmc max device to 2
2018-07-04 7:34 ` Emmanuel Vadot
2018-07-04 7:48 ` Alexander Graf
@ 2018-12-02 21:54 ` Alexander Graf
1 sibling, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2018-12-02 21:54 UTC (permalink / raw)
To: u-boot
On 04.07.18 09:34, Emmanuel Vadot wrote:
> On Wed, 4 Jul 2018 09:25:16 +0200
> Alexander Graf <agraf@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@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.
>
> If it's more clear I'll send a v2 with those words.
Please send a v2 with reworked wording or - if you have the time -
rework the storage api to no require this change at all with DM :).
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-12-02 21:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 7:08 [U-Boot] [PATCH] rpi: Set the default mmc max device to 2 Emmanuel Vadot
2018-07-04 7:25 ` Alexander Graf
2018-07-04 7:34 ` Emmanuel Vadot
2018-07-04 7:48 ` Alexander Graf
2018-07-09 2:39 ` Simon Glass
2018-12-02 21:54 ` Alexander Graf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.