From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751546AbdILQP7 (ORCPT ); Tue, 12 Sep 2017 12:15:59 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:35055 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbdILQPs (ORCPT ); Tue, 12 Sep 2017 12:15:48 -0400 X-Google-Smtp-Source: AOwi7QDbAcuI34xqIaPM20/R2MaXRbWf5foFoHvcDujemlnZsiKjSEhUJ9z/qGhzWDkBkLdhCjlncw== Date: Tue, 12 Sep 2017 11:15:46 -0500 From: Rob Herring To: Keiji Hayashibara Cc: "'Masahiro Yamada'" , Srinivas Kandagatla , devicetree@vger.kernel.org, linux-arm-kernel , Linux Kernel Mailing List , Masami Hiramatsu , Jassi Brar , =?utf-8?B?SGF5YXNoaSwgS3VuaWhpa28v5p6XIOmCpuW9pg==?= , =?utf-8?B?T3dhZGEsIEtpeW9zaGkv5aSn5ZKM55SwIOa4heW/lw==?= Subject: Re: [PATCH v1 1/3] dt-bindings: nvmem: add description for UniPhier eFuse Message-ID: <20170912161546.q5xr5pfdxin3qujf@rob-hp-laptop> References: <1504221620-358-1-git-send-email-hayashibara.keiji@socionext.com> <1504221620-358-2-git-send-email-hayashibara.keiji@socionext.com> <000001d32615$38e1b0c0$aaa51240$@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001d32615$38e1b0c0$aaa51240$@socionext.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > : > > > Add uniphier-efuse dt-bindings documentation. > > > > > > Signed-off-by: Keiji Hayashibara > > > --- > > > .../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