lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 30 Mar 2021 11:49:16 +0200
From:   Michael Walle <michael@...le.cc>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Rob Herring <robh+dt@...nel.org>,
        Rafał Miłecki <rafal@...ecki.pl>
Subject: Re: [RFC PATCH 0/4] mtd: core: OTP nvmem provider support

Hi Srinivas,

Am 2021-03-30 11:42, schrieb Srinivas Kandagatla:
> On 22/03/2021 18:19, Michael Walle wrote:
>> The goal is to fetch a (base) MAC address from the OTP region of a SPI 
>> NOR
>> flash.
>> 
>> This is the first part, where I try to add the nvmem provider support 
>> to
>> the MTD core.
>> 
>> I'm not sure about the device tree bindings. Consider the following 
>> two
>> variants:
>> 
>> (1)
>>      flash@0 {
>>          ..
>> 
>>          otp {
>>              compatible = "mtd-user-otp";
>>              #address-cells = <1>;
>>              #size-cells = <1>;
>> 
>>              serial-number@0 {
>>                  reg = <0x0 0x8>;
>>              };
>>          };
>>      };
>> 
>> (2)
>>      flash@0 {
>>          ..
>> 
>>          otp {
>>              compatible = "mtd-user-otp";
>>              #address-cells = <1>;
>>              #size-cells = <1>;
>> 
>> 			some-useful-name {
>>                  compatible = "nvmem-cells";
>> 
>>                  serial-number@0 {
>>                      reg = <0x0 0x8>;
>>                  };
>> 			};
>>          };
>>      };
>> 
>> Both bindings use a subnode "opt[-N]". We cannot have the nvmem cells 
>> as
>> children to the flash node because of the legacy partition binding.
>> 
>> (1) seems to be the form which is used almost everywhere in the 
>> kernel.
>> That is, the nvmem cells are just children of the parent node.
>> 
>> (2) seem to be more natural, because there might also be other 
>> properties
>> inside the otp subnode and might be more future-proof.
>> 
>> At the moment this patch implements (1).
>> 
> 
> 
> Have you looked at this series[1], are you both trying to do the same 
> thing?

Yes, I've seen these, but they are for MTD partitions. OTP regions are 
not
MTD partitions (and cannot be mapped to them).

-michael

> 
> [1] 
> https://lore.kernel.org/linux-mtd/20210312062830.20548-2-ansuelsmth@gmail.com/T/
> 
> --srini
> 
> 
>> Michael Walle (4):
>>    nvmem: core: allow specifying of_node
>>    dt-bindings: mtd: add YAML schema for the generic MTD bindings
>>    dt-bindings: mtd: add OTP bindings
>>    mtd: core: add OTP nvmem provider support
>> 
>>   .../devicetree/bindings/mtd/common.txt        |  16 +-
>>   .../devicetree/bindings/mtd/mtd.yaml          | 110 +++++++++++++
>>   drivers/mtd/mtdcore.c                         | 149 
>> ++++++++++++++++++
>>   drivers/nvmem/core.c                          |   4 +-
>>   include/linux/mtd/mtd.h                       |   2 +
>>   include/linux/nvmem-provider.h                |   2 +
>>   6 files changed, 267 insertions(+), 16 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/mtd/mtd.yaml
>> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ