All of lore.kernel.org
 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: Thu, 06 Apr 2017 12:46:29 +0300	[thread overview]
Message-ID: <1491471989.24567.19.camel@linux.intel.com> (raw)
In-Reply-To: <1354bacc-4ad5-91c4-c3d1-0b28cdf09617@samsung.com>

On Thu, 2017-04-06 at 18:24 +0900, Jaehoon Chung wrote:
> On 04/06/2017 05:51 PM, Andy Shevchenko wrote:
> > On Thu, Apr 6, 2017 at 6:44 AM, Simon Glass <sjg@chromium.org>
> > wrote:
> > > On 1 April 2017 at 07:11, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > On Fri, 2017-03-31 at 22:24 -0600, Simon Glass wrote:
> > > > > On 20 March 2017 at 06:51, Andy Shevchenko
> > > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > > On Sun, 2017-03-19 at 20:30 -0600, Simon Glass wrote:
> > > > > > > On 15 March 2017 at 12:25, Andy Shevchenko
> > > > > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > > > > +       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.
> > > > Oh, we are talking about host controller's power management
> > > > which is
> > > > done using PMU (power management unit) inside SoC. It's *not* a
> > > > power
> > > > regulator.
> > > > 
> > > > Above is clearly about card power management, which we also have
> > > > (in
> > > > case of Wi-Fi), but it's not applicable for eMMC soldered on the
> > > > module.
> > > 
> > > Still if the eMMC is soldered on, it needs power, right? What is
> > > the
> > > distinction?
> > 
> > It's irrelevant to this patch and discussion.
> > 
> > > In any case we cannot call board code from the driver with DM -
> > > it's
> > > just not how things work. So can you init it in your board_init()
> > > code
> > > perhaps, if you can't use a power driver?
> > 
> > I didn't get this either.
> > 
> > It means that PMU driver should *not* go with DM model then or what?
> > 
> > > > > > >  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?
> > > > > 
> > > > > There should not really be a different I think, except that
> > > > > with
> > > > > driver model we want to use drivers for power rather than
> > > > > hard-coding
> > > > > things in custom code.
> > > > 
> > > > I totally agree with this, though since we have no clear PCI
> > > > implementation on that board (*) we can't have good described
> > > > PCI power
> > > > management for it.
> > > > 
> > > > (*) It's called "fake PCI" meaning it mimics PCI programming
> > > > interface
> > > > while being not 100% compatible with PCI specification on
> > > > hardware and
> > > > firmware levels.
> > > > 
> > > > So, for now I have been seeing no alternatives than my initial
> > > > approach,
> > > > though I'm all ears for better solution.
> > > Well you can create a regulator driver which has a single
> > > regulator to
> > > handle whatever needs doing to enable MMC power.
> > 
> > No. It looks like you are mixing two power controls: card itself and
> > host controller. They are using quite different mechanisms to be
> > powered on.
> > We are talking here about *host* controller power flow.
> > 
> > And still there is no clarification why MMC flow calls board code
> > and
> > on the other hand you made an objectiion to do the same for SDHCI.
> > 
> > I still do not see better solution as mine initial one, otherwise
> > above question should be clarified first.
> 
> how about mmc_power_init() is called in mmc_probe()?

Yes, that's what I'm referring to. But the driver is pure SDHCI, it
doesn't call mmc_probe() IIRC.

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

  reply	other threads:[~2017-04-06  9:46 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
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 [this message]
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=1491471989.24567.19.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 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.