linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Cc: Mathieu Malaterre <malat@debian.org>,
	Marcin Nowakowski <marcin.nowakowski@mips.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Zubair.Kakakhel@mips.com,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Linux-MIPS <linux-mips@linux-mips.org>
Subject: Re: [PATCH v2 1/2] nvmem: add driver for JZ4780 efuse
Date: Wed, 17 Jan 2018 19:59:08 -0600	[thread overview]
Message-ID: <CAL_JsqJ9FQyOO_yaHjjMvwvL_CrWrZz7r4hom6n5hgdx0Z=RNw@mail.gmail.com> (raw)
In-Reply-To: <CANc+2y4nBcVPUjTiXXDDUD_qph0zHAmr-SDCt74C8gCZdNQ4Fw@mail.gmail.com>

On Wed, Jan 17, 2018 at 11:31 AM, PrasannaKumar Muralidharan
<prasannatsmkumar@gmail.com> wrote:
> Hi Rob,
>
> On 11 January 2018 at 20:38, Rob Herring <robh@kernel.org> wrote:
>> On Sat, Jan 6, 2018 at 6:43 AM, PrasannaKumar Muralidharan
>> <prasannatsmkumar@gmail.com> wrote:
>>> Hi Rob,
>>>
>>> On 4 January 2018 at 01:32, Rob Herring <robh@kernel.org> wrote:
>>>> On Thu, Dec 28, 2017 at 10:29:52PM +0100, Mathieu Malaterre wrote:
>>>>> From: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>

[...]

>>>>> +             nemc: nemc@13410000 {
>>>>> +                     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@134100d0 {
>>>>> +                     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@13410000 {
>                      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@134101d0 {
>                                           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

  reply	other threads:[~2018-01-18  1:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 21:29 [PATCH v2 0/2] Add efuse driver for Ingenic JZ4780 SoC Mathieu Malaterre
2017-12-28 21:29 ` [PATCH v2 1/2] nvmem: add driver for JZ4780 efuse Mathieu Malaterre
2017-12-29 12:35   ` Marcin Nowakowski
2018-01-02 12:02   ` Srinivas Kandagatla
2018-01-02 16:17     ` PrasannaKumar Muralidharan
2018-01-03 20:02   ` Rob Herring
2018-01-06 12:43     ` PrasannaKumar Muralidharan
2018-01-11 15:08       ` Rob Herring
2018-01-17 17:31         ` PrasannaKumar Muralidharan
2018-01-18  1:59           ` Rob Herring [this message]
2018-01-20  8:11         ` PrasannaKumar Muralidharan
2017-12-28 21:29 ` [PATCH v2 2/2] dts: Probe efuse for CI20 Mathieu Malaterre
2018-01-03 20:04   ` Rob Herring
2018-01-17 20:54   ` James Hogan
2018-01-02 12:01 ` [PATCH v2 0/2] Add efuse driver for Ingenic JZ4780 SoC Srinivas Kandagatla
2018-01-02 16:17   ` PrasannaKumar Muralidharan
2018-01-02 17:58     ` Srinivas Kandagatla

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_JsqJ9FQyOO_yaHjjMvwvL_CrWrZz7r4hom6n5hgdx0Z=RNw@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=Zubair.Kakakhel@mips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=malat@debian.org \
    --cc=marcin.nowakowski@mips.com \
    --cc=mark.rutland@arm.com \
    --cc=prasannatsmkumar@gmail.com \
    --cc=ralf@linux-mips.org \
    --cc=srinivas.kandagatla@linaro.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).