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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Apr 2021 15:53:10 -0500
From:   Rob Herring <robh@...nel.org>
To:     Nandor Han <nandor.han@...sala.com>
Cc:     srinivas.kandagatla@...aro.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v2 1/4] dt-bindings: nvmem: Add bootcount-nvmem

On Wed, Apr 28, 2021 at 04:50:38PM +0300, Nandor Han wrote:
> Documents the device tree bindings for `bootcount-nvmem` driver.
> 
> Signed-off-by: Nandor Han <nandor.han@...sala.com>
> ---
>  .../bindings/nvmem/bootcount-nvmem.yaml       | 66 +++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml b/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml
> new file mode 100644
> index 000000000000..cc673452fe0f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +# Copyright (c) Vaisala Oyj. All rights reserved.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/bootcount-nvmem.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Bootcount NVMEM bindings
> +
> +maintainers:
> +  - Nandor Han <nandor.han@...sala.com>
> +
> +description: |
> +  This binding is intendent to describe the hardware location for
> +  storing the bootcount value and magic combo.
> +
> +  The NVMEM cell size should be 2 or 4 bytes.
> +
> +allOf:
> +  - $ref: "nvmem-consumer.yaml#"
> +
> +properties:
> +  compatible:
> +    enum:
> +      - linux,bootcount-nvmem

What makes this Linux specific? IIRC, u-boot has boot counting function 
too.

> +
> +  nvmem-cells:
> +    description: Phandle to reboot mode nvmem data cell.
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  nvmem-cell-names:
> +    description: Name of the NVMEM cell.
> +    $ref: /schemas/types.yaml#/definitions/string-array
> +    enum:
> +      - bootcount-regs
> +
> +  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?

> +
> +dependencies:
> +  nvmem-cell-names: [ nvmem-cells ]

Core schema takes care of this.

> +
> +required:
> +  - compatible
> +  - nvmem-cells
> +  - nvmem-cell-names
> +
> +additionalProperties: false
> +
> +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.

> +        };
> +    };
> +
> +...
> -- 
> 2.26.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ