mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nandor Han <nandor.han@vaisala.com>
To: Rob Herring <robh@kernel.org>
Cc: srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/4] dt-bindings: nvmem: Add bootcount-nvmem
Date: Fri, 30 Apr 2021 11:21:00 +0300	[thread overview]
Message-ID: <48fc2a6c-9c4d-d858-5ab5-c10c590d8345@vaisala.com> (raw)
In-Reply-To: <20210429205310.GA1729011@robh.at.kernel.org>

Hi,

Thanks for your feedback.

<snip>

>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - linux,bootcount-nvmem
> 
> What makes this Linux specific? IIRC, u-boot has boot counting function
> too.
> 

U-Boot has indeed the counterpart functionality of bootcount feature, 
however, in this particularly case is not called `u-boot,bootcount-nvmem`.
If you have any suggestions I'm happy to change it.
Should I remove the `linux` prefix?

<snip>

>> +
>> +  linux,bootcount-magic:
>> +    description: Override default mask value.
>> +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> I don't understand what this is. Is it magic or a mask?

It's the magic value. Seems to be a mistake in the description.
I'll correct this.

> 
>> +
>> +dependencies:
>> +  nvmem-cell-names: [ nvmem-cells ]
> 
> Core schema takes care of this.
> 

Ok. I will remove it in that case.

<snip>

>> +examples:
>> +  # example with 16 bit nvram cell:
>> +  - |
>> +    bootcount {
>> +        compatible = "linux,bootcount-nvmem";
>> +        nvmem-cells = <&bootcount_regs>;
>> +        nvmem-cell-names = "bootcount-regs";
>> +    };
>> +
>> +    rtc: rtc@68 {
>> +        bootcount_regs: bootcount_nvmem_regs@e {
>> +            reg = <0x0e 0x2>;
> 
> It would be simpler to just add a compatible here and get rid of the
> 'bootcount' node here.
> 

This is the configuration for NVMEM cell provider and is done according 
to bindings/nvmem.yaml document.
Is here something that I'm missing?

At least this method of declaring NVMEM cells providers are decoupling 
the code from hardware declaration resulting in a more robust code.

Regards,
    Nandor


  reply	other threads:[~2021-04-30  8:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 13:50 [PATCH v2 0/4] Bootcount driver using NVMEM cell as backend Nandor Han
2021-04-28 13:50 ` [PATCH v2 1/4] dt-bindings: nvmem: Add bootcount-nvmem Nandor Han
2021-04-28 22:15   ` Rob Herring
2021-04-29 20:53   ` Rob Herring
2021-04-30  8:21     ` Nandor Han [this message]
2021-04-28 13:50 ` [PATCH v2 2/4] nvmem: bootcount: add bootcount driver Nandor Han
2021-04-28 13:50 ` [PATCH v2 3/4] nvmem: snvs_lpgpr: use cell stride for regmap size calculation Nandor Han
2021-04-28 13:50 ` [PATCH v2 4/4] nvmem: snvs_lpgpr: support two bytes NVMEM cell size Nandor Han

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=48fc2a6c-9c4d-d858-5ab5-c10c590d8345@vaisala.com \
    --to=nandor.han@vaisala.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.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

all inboxes | Powered by JetHome®