Thread (12 messages) flat view 12 messages, 6 authors, 2013-09-16

[PATCH] memory: add a basic OF-based memory driver

From: Rob Herring <hidden>
Date: 2013-09-13 14:00:51
Also in: linux-devicetree, lkml

On Thu, Sep 12, 2013 at 8:31 PM, Emilio L?pez [off-list ref] wrote:
Hi Olof,

El 12/09/13 21:57, Olof Johansson escribi?:
quoted
On Thu, Sep 12, 2013 at 5:30 PM, Emilio L?pez [off-list ref]
wrote:
quoted
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.

quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help