From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Mon, 20 Mar 2017 14:51:06 +0200 Subject: [U-Boot] [PATCH v1] mmc: sdhci: SDHCI controllers also need power In-Reply-To: References: <20170315182521.4359-1-andriy.shevchenko@linux.intel.com> Message-ID: <1490014266.19767.101.camel@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Sun, 2017-03-19 at 20:30 -0600, Simon Glass wrote: > Hi Andy, > > On 15 March 2017 at 12:25, Andy Shevchenko > 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 > > --- > >  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 Intel Finland Oy