[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqJ9FQyOO_yaHjjMvwvL_CrWrZz7r4hom6n5hgdx0Z=RNw@mail.gmail.com>
Date: Wed, 17 Jan 2018 19:59:08 -0600
From: Rob Herring <robh@...nel.org>
To: PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
Cc: Mathieu Malaterre <malat@...ian.org>,
Marcin Nowakowski <marcin.nowakowski@...s.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Zubair.Kakakhel@...s.com,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
Linux-MIPS <linux-mips@...ux-mips.org>
Subject: Re: [PATCH v2 1/2] nvmem: add driver for JZ4780 efuse
On Wed, Jan 17, 2018 at 11:31 AM, PrasannaKumar Muralidharan
<prasannatsmkumar@...il.com> wrote:
> Hi Rob,
>
> On 11 January 2018 at 20:38, Rob Herring <robh@...nel.org> wrote:
>> On Sat, Jan 6, 2018 at 6:43 AM, PrasannaKumar Muralidharan
>> <prasannatsmkumar@...il.com> wrote:
>>> Hi Rob,
>>>
>>> On 4 January 2018 at 01:32, Rob Herring <robh@...nel.org> wrote:
>>>> On Thu, Dec 28, 2017 at 10:29:52PM +0100, Mathieu Malaterre wrote:
>>>>> From: PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
[...]
>>>>> + nemc: nemc@...10000 {
>>>>> + compatible = "ingenic,jz4780-nemc";
>>>>> + reg = <0x13410000 0x10000>;
>>>>> + #address-cells = <2>;
>>>>> + #size-cells = <1>;
>>>>> + ranges = <1 0 0x1b000000 0x1000000
>>>>> + 2 0 0x1a000000 0x1000000
>>>>> + 3 0 0x19000000 0x1000000
>>>>> + 4 0 0x18000000 0x1000000
>>>>> + 5 0 0x17000000 0x1000000
>>>>> + 6 0 0x16000000 0x1000000>;
>>>>> +
>>>>> + clocks = <&cgu JZ4780_CLK_NEMC>;
>>>>> +
>>>>> + status = "disabled";
>>>>> + };
>>>>>
>>>>> - clocks = <&cgu JZ4780_CLK_NEMC>;
>>>>> + efuse: efuse@...100d0 {
>>>>> + compatible = "ingenic,jz4780-efuse";
>>>>> + reg = <0x134100d0 0xff>;
>>>>
>>>> You are creating an overlapping region here with nemc above. Don't do
>>>> that.
>>>
>>> Should "reg = <0x13410000 0x10000>;" be used instead?
>>
>> No, that still overlaps with nemc. What's in registers 0x00-0xcf and
>> 0x1d0-0xffff? Either get rid of this node altogether and make the
>> driver for nemc also instantiate the efuse driver (DT is not the only
>> way to instantiate drivers), or create sub-nodes under nemc for each
>> distinct h/w block in the 13410000-13420000 address space.
>
> My idea was not to change nemc driver.
>
> By "create sub-nodes under nemc" do you mean something like below?
Yes.
> nemc: nemc@...10000 {
> compatible = "ingenic,jz4780-nemc";
> reg = <0x13410000 0x10000>;
> <...>
> status = "disabled";
Though having disabled here is strange. We'd normally ignore all the
child nodes.
>
> efuse: efuse@...101d0 {
> compatible = "ingenic,jz4780-efuse";
> reg = <0x134100d0 0xff>;
> }
> }
>
> Will this instantiate efuse driver? I do not know how to do that with
> sub-node. I will explore more on this.
The nemc driver just needs to call of_platform_default_populate.
>> Or a third option is make nemc reg:
>>
>> reg = <0x13410000 0xd0>, <0x134101d0 0xfe30>;
>>
>> But I suspect that is wrong and you probably have some other function in there.
>>
>> Rob
>
> If the efuse block were to use a different base register address (that
> does not overlap with nemc register range) in future SoC how the node
> should be? Using nemc to instantiate efuse won't be the best choice if
> that happens.
Then you will have a different compatible for nemc (because it is
different) and then the driver should skip the above step.
Rob
Powered by blists - more mailing lists