All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Claudiu Beznea <claudiu.beznea@microchip.com>,
	srinivas.kandagatla@linaro.org, robh+dt@kernel.org,
	krzk+dt@kernel.org
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: microchip-otpc: document Microchip OTPC
Date: Wed, 11 May 2022 17:27:40 +0200	[thread overview]
Message-ID: <75ce6291-77c7-c932-e8bb-a8bbae02431d@linaro.org> (raw)
In-Reply-To: <20220510094457.4070764-2-claudiu.beznea@microchip.com>

On 10/05/2022 11:44, Claudiu Beznea wrote:
> Document Microchip OTP controller.
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  .../bindings/nvmem/microchip-otpc.yaml        | 55 +++++++++++++++++++
>  include/dt-bindings/nvmem/microchip,otpc.h    | 18 ++++++
>  2 files changed, 73 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml
>  create mode 040000 include/dt-bindings/nvmem
>  create mode 100644 include/dt-bindings/nvmem/microchip,otpc.h
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml
> new file mode 100644
> index 000000000000..a8df7fee5c2b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml

vendor,device.yaml
device should not be a wildcard but first compatible, so
microchip,sama7g5-otpc.yaml


> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/microchip-otpc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip SAMA7G5 OTP Controller (OTPC) device tree bindings

s/device tree bindings//

> +
> +maintainers:
> +  - Claudiu Beznea <claudiu.beznea@microchip.com>
> +
> +description: |
> +  This binding represents the OTP controller found on SAMA7G5 SoC.

Entire description is duplicating title. Please describe the hardware or
skip it.

OTOH, you should mention the header, for example in description.

> +
> +allOf:
> +  - $ref: "nvmem.yaml#"
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: microchip,sama7g5-otpc
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1

These come from nvmem.yaml.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/at91.h>

How the clock is used here?

> +    #include <dt-bindings/nvmem/microchip,otpc.h>
> +
> +    otpc: efuse@e8c00000 {
> +        compatible = "microchip,sama7g5-otpc", "syscon";
> +        reg = <0xe8c00000 0xec>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        temperature_calib: calib@1 {
> +            reg = <OTP_PKT(1) OTP_PKT_SAMA7G5_TEMP_CALIB_LEN>;
> +        };
> +    };
> +
> +...
> diff --git a/include/dt-bindings/nvmem/microchip,otpc.h b/include/dt-bindings/nvmem/microchip,otpc.h
> new file mode 100644
> index 000000000000..44b6ed3b8f18
> --- /dev/null
> +++ b/include/dt-bindings/nvmem/microchip,otpc.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

Same license as bindings.

> +
> +#ifndef _DT_BINDINGS_NVMEM_MICROCHIP_OTPC_H
> +#define _DT_BINDINGS_NVMEM_MICROCHIP_OTPC_H
> +
> +/*
> + * Need to have it as a multiple of 4 as NVMEM memory is registered with
> + * stride = 4.
> + */
> +#define OTP_PKT(id)			((id) * 4)

Do I get it correctly - the offset or register address is now part of a
binding? You write here "id", however you use it as part of "reg", so
it's confusing.

> +
> +/*
> + * Temperature calibration packet length for SAMA7G5: 1 words header,
> + * 18 words payload.
> + */
> +#define OTP_PKT_SAMA7G5_TEMP_CALIB_LEN	(19 * 4)

Length of some memory region also does not look like job for bindings.

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Claudiu Beznea <claudiu.beznea@microchip.com>,
	srinivas.kandagatla@linaro.org, robh+dt@kernel.org,
	krzk+dt@kernel.org
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: microchip-otpc: document Microchip OTPC
Date: Wed, 11 May 2022 17:27:40 +0200	[thread overview]
Message-ID: <75ce6291-77c7-c932-e8bb-a8bbae02431d@linaro.org> (raw)
In-Reply-To: <20220510094457.4070764-2-claudiu.beznea@microchip.com>

On 10/05/2022 11:44, Claudiu Beznea wrote:
> Document Microchip OTP controller.
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  .../bindings/nvmem/microchip-otpc.yaml        | 55 +++++++++++++++++++
>  include/dt-bindings/nvmem/microchip,otpc.h    | 18 ++++++
>  2 files changed, 73 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml
>  create mode 040000 include/dt-bindings/nvmem
>  create mode 100644 include/dt-bindings/nvmem/microchip,otpc.h
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml
> new file mode 100644
> index 000000000000..a8df7fee5c2b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/microchip-otpc.yaml

vendor,device.yaml
device should not be a wildcard but first compatible, so
microchip,sama7g5-otpc.yaml


> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/microchip-otpc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip SAMA7G5 OTP Controller (OTPC) device tree bindings

s/device tree bindings//

> +
> +maintainers:
> +  - Claudiu Beznea <claudiu.beznea@microchip.com>
> +
> +description: |
> +  This binding represents the OTP controller found on SAMA7G5 SoC.

Entire description is duplicating title. Please describe the hardware or
skip it.

OTOH, you should mention the header, for example in description.

> +
> +allOf:
> +  - $ref: "nvmem.yaml#"
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: microchip,sama7g5-otpc
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1

These come from nvmem.yaml.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/at91.h>

How the clock is used here?

> +    #include <dt-bindings/nvmem/microchip,otpc.h>
> +
> +    otpc: efuse@e8c00000 {
> +        compatible = "microchip,sama7g5-otpc", "syscon";
> +        reg = <0xe8c00000 0xec>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        temperature_calib: calib@1 {
> +            reg = <OTP_PKT(1) OTP_PKT_SAMA7G5_TEMP_CALIB_LEN>;
> +        };
> +    };
> +
> +...
> diff --git a/include/dt-bindings/nvmem/microchip,otpc.h b/include/dt-bindings/nvmem/microchip,otpc.h
> new file mode 100644
> index 000000000000..44b6ed3b8f18
> --- /dev/null
> +++ b/include/dt-bindings/nvmem/microchip,otpc.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

Same license as bindings.

> +
> +#ifndef _DT_BINDINGS_NVMEM_MICROCHIP_OTPC_H
> +#define _DT_BINDINGS_NVMEM_MICROCHIP_OTPC_H
> +
> +/*
> + * Need to have it as a multiple of 4 as NVMEM memory is registered with
> + * stride = 4.
> + */
> +#define OTP_PKT(id)			((id) * 4)

Do I get it correctly - the offset or register address is now part of a
binding? You write here "id", however you use it as part of "reg", so
it's confusing.

> +
> +/*
> + * Temperature calibration packet length for SAMA7G5: 1 words header,
> + * 18 words payload.
> + */
> +#define OTP_PKT_SAMA7G5_TEMP_CALIB_LEN	(19 * 4)

Length of some memory region also does not look like job for bindings.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-11 15:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10  9:44 [PATCH 0/2] nvmem: add Microchip OTP controller Claudiu Beznea
2022-05-10  9:44 ` Claudiu Beznea
2022-05-10  9:44 ` [PATCH 1/2] dt-bindings: microchip-otpc: document Microchip OTPC Claudiu Beznea
2022-05-10  9:44   ` Claudiu Beznea
2022-05-11 15:27   ` Krzysztof Kozlowski [this message]
2022-05-11 15:27     ` Krzysztof Kozlowski
2022-05-12  7:17     ` Claudiu.Beznea
2022-05-12  7:17       ` Claudiu.Beznea
2022-05-12  7:54       ` Krzysztof Kozlowski
2022-05-12  7:54         ` Krzysztof Kozlowski
2022-05-12 15:31         ` Claudiu.Beznea
2022-05-12 15:31           ` Claudiu.Beznea
2022-05-12 15:35           ` Krzysztof Kozlowski
2022-05-12 15:35             ` Krzysztof Kozlowski
2022-05-12 16:04             ` Claudiu.Beznea
2022-05-12 16:04               ` Claudiu.Beznea
2022-05-13  7:49               ` Krzysztof Kozlowski
2022-05-13  7:49                 ` Krzysztof Kozlowski
2022-05-13 10:06                 ` Claudiu.Beznea
2022-05-13 10:06                   ` Claudiu.Beznea
2022-05-10  9:44 ` [PATCH 2/2] nvmem: microchip-otpc: add support Claudiu Beznea
2022-05-10  9:44   ` Claudiu Beznea

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=75ce6291-77c7-c932-e8bb-a8bbae02431d@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=claudiu.beznea@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.