[U-Boot] U-boot Driver Model - MMC - missing uclass implementation?

Philipp Rossak embed3d at gmail.com
Fri Sep 23 19:33:15 CEST 2016


Hi Simon,

I missed the CONFIG_GENERIC_MMC option.
Thank you very much !!

Regards,
Philipp

2016-09-23 17:37 GMT+02:00 Simon Glass <sjg at chromium.org>:

> Hi Phllipp,
>
> On 23 September 2016 at 09:30, Philipp Rossak <embed3d at gmail.com> wrote:
> > Hi,
> >
> > I would like to develop an mmc driver for the STM32 boards with the new
> > driver model.
> >
> > I already built up the basic structure and I discovered some strange
> > behaviour compared to net or serial drivers:
> >
> > When I place only the following statement in the driver .c file:
> >
> > U_BOOT_DRIVER(sdhci_stm32) = {
> >     .name        = "stm32_sdhci",
> >     .id              = UCLASS_MMC,
> >     .ops           = &stm32_mmc_ops,
> >     .probe        = stm32_mmc_probe,
> > ...
> > };
> >
> > I receive the following Message when i perform the "dm uclass" command in
> > u-boot:
> >
> > Cannot find uclass for id 31: please add the UCLASS_DRIVER() declaration
> for
> > this UCLASS_... id
> >
> > But when I had a look at the sources, i found some UCLASS_DRIVER()
> > declaration in drivers/mmc/mmc-uclass.c for the mmc driver.
> >
> > The driver is copied from the sandbox_mmc driver. I only renamed the
> > functions and added some debug messages.
> >
> > When i add this statement to my driver:
> >
> > UCLASS_DRIVER(sdhci_stm32) = {
> >     .name        = "stm32_sdhci",
> >     .id        = UCLASS_MMC,
> > };
> >
> > And I perform the dm uclass command in u-boot i receive the following:
> >
> > uclass 31: stm32_sdhci
> >
> > Do you have any idea what i'm doing wrong / what i missed?
> >
> > Is there maybe some UCLASS implementation missing or not linked?
>
> Yes I think so.
>
> This sounds like you don't have the uclass compiled in. If you look in
> drivers/mmc/Makefile you can see that you need to define
> CONFIG_GENERIC_MMC and CONFIG_DM_MMC.
>
> Regards,
> Simon
>


More information about the U-Boot mailing list