mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH] dt-bindings: nvmem: layouts: add fixed-layout
Date: Thu, 09 Mar 2023 11:25:15 +0100	[thread overview]
Message-ID: <09cd56463e726cff0fd6662814466bc6@walle.cc> (raw)
In-Reply-To: <20230309093410.15214-1-zajec5@gmail.com>

Hi,

Am 2023-03-09 10:34, schrieb Rafał Miłecki:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> With the introduction of NVMEM layouts I believe we should prefer and
> support describing all NVMEM devices content in the "nvmem-layout" 
> node.
> Inluding fixed NVMEM cells (those with hardcoded offset & size).
> 
> This seems to be cleaner design and more explicit.
> 
> Introduce a binding allowing fixed NVMEM cells as a type of layout.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/nvmem/layouts/fixed-layout.yaml  | 52 +++++++++++++++++++
>  .../bindings/nvmem/layouts/nvmem-layout.yaml  |  1 +
>  2 files changed, 53 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml
> 
> diff --git
> a/Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml
> b/Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml
> new file mode 100644
> index 000000000000..7eb86c999a5e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/layouts/fixed-layout.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NVMEM layout for fixed NVMEM cells
> +
> +description:
> +  Many NVMEM devices have hardcoded cells layout (offset and size of 
> specific
> +  NVMEM content doesn't change).
> +
> +  This binding allows defining such cells using NVMEM layout. It can 
> be used on
> +  top of any NVMEM device.
> +
> +maintainers:
> +  - Rafał Miłecki <rafal@milecki.pl>
> +
> +properties:
> +  compatible:
> +    const: fixed-layout
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1
> +
> +patternProperties:
> +  "@[a-f0-9]+$":
> +    type: object
> +    description: NVMEM cell
> +    properties:
> +      reg:
> +        maxItems: 1

Looking at Documentation/devicetree/bindings/nvmem/nvmem.yaml this
is missing the bits property. Also, can we share that information
between the old style and the new style somehow so we don't
duplicate that here?

-michael

> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    nvmem-layout {
> +        compatible = "fixed-layout";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        calibration@4000 {
> +            reg = <0x4000 0x100>;
> +        };
> +    };
> diff --git
> a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> index 8512ee538c4c..03da7848c713 100644
> --- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> @@ -18,6 +18,7 @@ description: |
>    perform their parsing. The nvmem-layout container is here to 
> describe these.
> 
>  oneOf:
> +  - $ref: fixed-layout.yaml
>    - $ref: kontron,sl28-vpd.yaml
>    - $ref: onie,tlv-layout.yaml

      parent reply	other threads:[~2023-03-09 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  9:34 Rafał Miłecki
2023-03-09  9:47 ` Rafał Miłecki
2023-03-09 10:25 ` Michael Walle [this message]

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=09cd56463e726cff0fd6662814466bc6@walle.cc \
    --to=michael@walle.cc \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=rafal@milecki.pl \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=zajec5@gmail.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

all inboxes | Powered by JetHome®