linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Keiji Hayashibara <hayashibara.keiji@socionext.com>
Cc: "'Masahiro Yamada'" <yamada.masahiro@socionext.com>,
	"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	devicetree@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Masami Hiramatsu" <masami.hiramatsu@linaro.org>,
	"Jassi Brar" <jaswinder.singh@linaro.org>,
	"Hayashi, Kunihiko/林 邦彦" <hayashi.kunihiko@socionext.com>,
	"Owada, Kiyoshi/大和田 清志" <owada.kiyoshi@socionext.com>
Subject: Re: [PATCH v1 1/3] dt-bindings: nvmem: add description for UniPhier eFuse
Date: Tue, 12 Sep 2017 11:15:46 -0500	[thread overview]
Message-ID: <20170912161546.q5xr5pfdxin3qujf@rob-hp-laptop> (raw)
In-Reply-To: <000001d32615$38e1b0c0$aaa51240$@socionext.com>

On Tue, Sep 05, 2017 at 04:04:31PM +0900, Keiji Hayashibara wrote:
> Hello Yamada-san,
> 
> Thank you for your comment.
> 
> > From: Masahiro Yamada [mailto:yamada.masahiro@socionext.com]
> > Sent: Monday, September 4, 2017 9:56 PM
> > 
> > 2017-09-01 8:20 GMT+09:00 Keiji Hayashibara
> > <hayashibara.keiji@socionext.com>:
> > > Add uniphier-efuse dt-bindings documentation.
> > >
> > > Signed-off-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
> > > ---
> > >  .../devicetree/bindings/nvmem/uniphier-efuse.txt   | 45
> > ++++++++++++++++++++++
> > >  1 file changed, 45 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt

> > > +Example:
> > > +
> > > +       soc-glue@5f900000 {
> > > +               compatible = "socionext,uniphier-ld20-soc-glue-debug",
> > > +                            "simple-mfd";
> > > +               #address-cells = <1>;
> > > +               #size-cells = <1>;
> > > +               ranges = <0x0 0x5f900000 0x2000>;
> > 
> > 
> > IMHO, I think an empty "ranges;" will clarify the code, but it is up to
> > your taste.
> > 
> > 
> > > +
> > > +               efuse {
> > > +                       compatible = "socionext,uniphier-efuse",
> > > +                                    "syscon";
> > 
> > 
> > You are adding a dedicated driver for "socionext,uniphier-efuse".
> > 
> > Then, "syscon" as well?
> > 
> 
> Since I was using the syscon interface to implement the driver,
> I specified "syscon". It's interface is syscon_node_to_regmap().
> 
> I will rethink this in v2.
> 
> > 
> > 
> > > +                       reg = <0x100 0xf00>;
> > 
> > 
> > Not so many efuse registers exist on the SoC.
> > 
> > reg = <0x100 0x200>; will be enough.
> > 
> > 
> > Or if you want to be strict to the hw spec, you can write as follows:
> > 
> >         soc-glue@5f900000 {
> >                compatible = "socionext,uniphier-ld20-soc-glue-debug";
> >                             "simple-mfd";
> >                #address-cells = <1>;
> >                #size-cells = <1>;
> >                ranges = <0x0 0x5f900000 0x2000>;
> > 
> >                efuse@100 {
> >                            compatible = "socionext,uniphier-efuse";
> >                            reg = <0x100 0x28>;
> >                };
> > 
> >                efuse@200 {
> >                            compatible = "socionext,uniphier-efuse";
> >                            reg = <0x200 0x68>;
> >                };
> >        };
> > 
> > 
> > 
> > 
> > > +                       #address-cells = <1>;
> > > +                       #size-cells = <1>;
> > > +
> > > +                       /* Data cells */
> > > +                       usb_mon: usb_mon {
> > > +                               reg = <0x154 0xc>;
> > > +                       };
> > 
> > 
> > This <0x154 0xc> represents 0x5f900254 in CPU address view.
> > (0x5f900000 + 0x100 + 0x154)
> > 
> > So many ranges conversion, and how error-prone..
> > 
> 
> Yes, indeed...
> I will modify as below.

Please don't. A non-empty ranges is preferred. It limits the scope and 
chance for errors (smaller range allows fewer possible values and 
limits the chances of having address ranges duplicated in multiple 
nodes). But yes, it does add the requirement of doing addition and/or 
OR operations. I can't review whether the address ends up being correct 
either way, but having non-empty ranges helps enforce the other things.

Rob

  reply	other threads:[~2017-09-12 16:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 23:20 [PATCH v1 0/3] add UniPhier efuse support Keiji Hayashibara
2017-08-31 23:20 ` [PATCH v1 1/3] dt-bindings: nvmem: add description for UniPhier eFuse Keiji Hayashibara
2017-09-04 12:55   ` Masahiro Yamada
2017-09-05  7:04     ` Keiji Hayashibara
2017-09-12 16:15       ` Rob Herring [this message]
2017-09-13  2:31         ` Keiji Hayashibara
2017-08-31 23:20 ` [PATCH v1 2/3] nvmem: uniphier: add UniPhier eFuse driver Keiji Hayashibara
2017-09-04 12:58   ` Masahiro Yamada
2017-09-07  0:36     ` Keiji Hayashibara
2017-08-31 23:20 ` [PATCH v1 3/3] arm64: dts: uniphier: add efuse node for LD20 Keiji Hayashibara

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=20170912161546.q5xr5pfdxin3qujf@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=hayashibara.keiji@socionext.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu@linaro.org \
    --cc=owada.kiyoshi@socionext.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=yamada.masahiro@socionext.com \
    /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).