public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] mmc: sdhci: SDHCI controllers also need power
Date: Mon, 20 Mar 2017 14:51:06 +0200	[thread overview]
Message-ID: <1490014266.19767.101.camel@linux.intel.com> (raw)
In-Reply-To: <CAPnjgZ0Qhu8AGP1ROs-GAbA97jCkK2hSHYxKEAa1rpeL9sxp1w@mail.gmail.com>

On Sun, 2017-03-19 at 20:30 -0600, Simon Glass wrote:
> Hi Andy,
> 
> On 15 March 2017 at 12:25, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On some systems SDHCI controllers may be powered off and it's
> > required
> > to bring them on before accessing.
> > 
> > SDHCI generic driver currently lacks any mean of doing it. Call the
> > same
> > board_power_mmc_init() at sdhci_init() stage.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/mmc/sdhci.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> > index 93cefd89cd..54a7e379ff 100644
> > --- a/drivers/mmc/sdhci.c
> > +++ b/drivers/mmc/sdhci.c
> > @@ -469,6 +469,8 @@ static int sdhci_init(struct mmc *mmc)
> >  {
> >         struct sdhci_host *host = mmc->priv;
> > 
> > +       board_mmc_power_init();
> 
> You should be using driver model for this (CONFIG_DM_MMC*).

I didn't get this part. It's used by the driver (tangier_sdhci) as far
as I understand.

>  So either
> get the power supply from the device tree and enable it,

Any example?

>  or do this in
> the board code.

How? It's already board code that powers on the controller. If you look
at mmc_init() it does this. SDHCI on the other hand doesn't which is for
my opinion is a bug. Otherwise why is the difference between
initialization sequence of MMC and SHDCI controllers?

> 
> > +
> >         sdhci_reset(host, SDHCI_RESET_ALL);
> > 
> >         if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) &&
> > !aligned_buffer) {
> > --
> > 2.11.0
> > 
> 
> Regards,
> Simon

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2017-03-20 12:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 18:25 [U-Boot] [PATCH v1] mmc: sdhci: SDHCI controllers also need power Andy Shevchenko
2017-03-20  2:30 ` Simon Glass
2017-03-20 12:51   ` Andy Shevchenko [this message]
2017-04-01  4:24     ` Simon Glass
2017-04-01 13:11       ` Andy Shevchenko
2017-04-06  3:44         ` Simon Glass
2017-04-06  8:51           ` Andy Shevchenko
2017-04-06  9:24             ` Jaehoon Chung
2017-04-06  9:46               ` Andy Shevchenko
2017-04-06 10:50                 ` Jaehoon Chung
2017-04-06 10:58                   ` Andy Shevchenko
2017-04-07 10:05                     ` Jaehoon Chung
2017-04-18 14:29                       ` Andy Shevchenko
2017-04-18 14:33                         ` Simon Glass
2017-04-18 14:45                           ` Andy Shevchenko
2017-04-19  0:12                             ` Simon Glass
2017-04-19 11:50                               ` Andy Shevchenko
2017-04-23  1:18                                 ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490014266.19767.101.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox