linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] memory: add a basic OF-based memory driver
Date: Fri, 13 Sep 2013 09:00:48 -0500	[thread overview]
Message-ID: <CAL_JsqJACEtSRaDg0TcYODzhpsHFGa4mFSYa_R3qspypEKH+hQ@mail.gmail.com> (raw)
In-Reply-To: <52326ADC.8040703@elopez.com.ar>

On Thu, Sep 12, 2013 at 8:31 PM, Emilio L?pez <emilio@elopez.com.ar> wrote:
> Hi Olof,
>
> El 12/09/13 21:57, Olof Johansson escribi?:
>
>> On Thu, Sep 12, 2013 at 5:30 PM, Emilio L?pez <emilio@elopez.com.ar>
>> wrote:
>>>
>>> This driver's only job is to claim and ensure the necessary clock
>>> for memory operation on a DT-powered machine remains enabled.
>>>
>>> Signed-off-by: Emilio L?pez <emilio@elopez.com.ar>
>>> ---
>>>
>>> I believe this new patch should resolve all the concerns raised; as
>>> always, all feedback is welcome :)
>>
>>
>> I think you're going about this the wrong way.
>>
>> If you have a problem with a clock not staying on, shouldn't you just
>> marking it appropriately in the clock table instead, making sure it's
>> initialized with at least one reference to it?
>
>
> If by "the clock table" you mean the tree as handled by the common clock
> framework, there is no such flag available as of today; see Mike's reply for
> more information.
>
> Personally I feel that if the general case can solve our problems (in this
> case, having a consumer who prepares and enables the clock), we should avoid
> adding special cases to the framework.
>
>
>> I believe that is how
>> some of the other platforms handle this, and it's a lot cleaner than
>> adding a fake binding and a fake driver just to grab a single clock.
>
>
> The binding doesn't have to be fake; it is actually describing the memory
> controller hardware:
>
> mc: mc at 0123000 {
>         compatible = "simple-memory-controller";
>         reg = <0x0123000 0x400>;
>         clocks = <&pll5 1>;
> };
>
> If one day we get docs and/or have any special features we may need from the
> controller, we can use something like
>
> mc: mc at 0123000 {
>         compatible = "vendor,awesome-mc", "simple-memory-controller";
>         reg = <0x0123000 0x400>;
>         clocks = <&pll5 1>;
> };

Better, but this is still wrong. DT describes the hardware. There is
no such h/w as a simple-memory-controller. The fact that you have a
simple-memory-ctrlr kernel driver is a kernel
feature/artifact/limitation. Describe the h/w with a meaningful
compatible string and put that string in the simple memory controller
driver match table. If someday we have a real driver for said memory
controller, then it is only a kernel change to use a different driver.

Rob

  reply	other threads:[~2013-09-13 14:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11  1:43 [PATCH RFC] of: add a basic memory driver Emilio López
2013-09-11  7:54 ` Maxime Ripard
2013-09-11  9:34   ` Emilio López
2013-09-12  0:21     ` Mike Turquette
2013-09-11 16:40 ` Rob Herring
2013-09-13  0:30 ` [PATCH] memory: add a basic OF-based " Emilio López
2013-09-13  0:57   ` Olof Johansson
2013-09-13  1:31     ` Emilio López
2013-09-13 14:00       ` Rob Herring [this message]
2013-09-13 15:49         ` Olof Johansson
2013-09-15 12:43           ` Grant Likely
2013-09-16 12:55             ` Rob Herring

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=CAL_JsqJACEtSRaDg0TcYODzhpsHFGa4mFSYa_R3qspypEKH+hQ@mail.gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).