From: sashiko-bot@kernel.org
To: "Varshini Rajendran" <varshini.rajendran@microchip.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v6 08/17] dt-bindings: nvmem: microchip,sama7g5-otpc: add sama7d65 and dt node example
Date: Thu, 06 Aug 2026 09:07:48 +0000 [thread overview]
Message-ID: <20260806090748.DF4CF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260806074024.531259-9-varshini.rajendran@microchip.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The device tree example for `sama7d65-otpc` incorrectly uses an ASCII string packet payload TAG ('ACST' / `0x41435354`) as an NVMEM cell `reg` offset, which breaks the driver's read implementation and nvmem API contract.
- [Medium] The calibration scale for `sama7d65_temp_calib` divides the baseline temperature by 1000, which contradicts the millicelsius requirement of the temperature sensor formula unless the hardware stores the value in microcelsius.
--
--- Patch [8]: [PATCH v6 08/17] dt-bindings: nvmem: microchip,sama7g5-otpc: add sama7d65 and dt node example ---
commit e1cdb410e4aef6d0fe6053ee57168bb1e5b19ab3
Author: Varshini Rajendran <varshini.rajendran@microchip.com>
dt-bindings: nvmem: microchip,sama7g5-otpc: add sama7d65 and dt node example
This commit adds support for the sama7d65 compatible string to the
microchip,sama7g5-otpc nvmem binding. It also includes a new device tree node
example demonstrating how a tag can be used to reference a packet stored in
the OTP memory.
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
> index cc25f2927682e..04b44660554ea 100644
> --- a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
[ ... ]
> @@ -48,4 +54,20 @@ examples:
> };
> };
>
> + - |
> + efuse@e8c00000 {
> + compatible = "microchip,sama7d65-otpc", "microchip,sama7g5-otpc", "syscon";
> + reg = <0xe8c00000 0x100>;
> +
> + nvmem-layout {
> + compatible = "fixed-layout";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + calib@41435354 {
> + reg = <0x41435354 0x2c>; /* Temp calib data packet TAG */
[Severity: Medium]
Will using this packet tag as the reg offset cause a read failure at runtime?
Looking at mchp_otpc_read() in drivers/nvmem/microchip-otpc.c, the driver
expects the offset to be the sequential packet ID multiplied by 4:
packet = mchp_otpc_id_to_packet(otpc, off / 4);
if (!packet)
return -EINVAL;
If the ASCII string 'ACST' (0x41435354) is provided as the physical memory
offset, won't this systematically fail during nvmem cell reads and return
-EINVAL?
[Severity: Medium]
Does the calibration scale for sama7d65_temp_calib in the ADC driver
incorrectly calculate the temperature?
In drivers/iio/adc/at91-sama5d2_adc.c, p1_scale is defined as:
.p1_scale = { .numerator = 1, .denominator = 1000 },
When the scale ratio is applied in at91_adc_temp_sensor_init():
clb->p1 *= layout->p1_scale.numerator;
clb->p1 /= layout->p1_scale.denominator;
Dividing the baseline temperature by 1000 contradicts the millicelsius
requirement of the temperature sensor formula. Unless the hardware stores the
value natively in microcelsius, won't this round down or erroneously convert
the value to Celsius, corrupting the baseline temperature?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260806074024.531259-1-varshini.rajendran@microchip.com?part=8
next prev parent reply other threads:[~2026-08-06 9:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 7:40 [PATCH v6 00/17] Add thermal management support for sama7d65 Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 01/17] dt-bindings: iio: adc: at91-sama5d2: document sama7d65 Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 02/17] nvmem: add DEFINE_FREE for nvmem_cell_put cleanup Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 03/17] iio: adc: at91-sama5d2_adc: use cleanup.h for NVMEM buffer Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 04/17] iio: adc: at91-sama5d2_adc: rework temp calibration layout handling Varshini Rajendran
2026-08-06 9:07 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 05/17] iio: adc: at91-sama5d2_adc: add condition to validate calibration data Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 06/17] iio: adc: at91-sama5d2_adc: remove unnecessary casts in of_device_id Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 07/17] iio: adc: at91-sama5d2_adc: adapt the driver for sama7d65 Varshini Rajendran
2026-08-06 9:09 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 08/17] dt-bindings: nvmem: microchip,sama7g5-otpc: add sama7d65 and dt node example Varshini Rajendran
2026-08-06 9:07 ` sashiko-bot [this message]
2026-08-06 7:40 ` [PATCH v6 09/17] nvmem: microchip-otpc: nvmem: microchip-otpc: add tag-based packet lookup Varshini Rajendran
2026-08-06 9:10 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 10/17] nvmem: microchip-otpc: nvmem: add emulation mode and OTP access validation Varshini Rajendran
2026-08-06 9:08 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 11/17] ARM: dts: microchip: sama7d65: add cpu opps Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 12/17] ARM: dts: microchip: sama7d65: Add ADC node Varshini Rajendran
2026-08-06 9:12 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 13/17] ARM: dts: microchip: sama7d65_curiosity: Enable ADC, DVFS Varshini Rajendran
2026-08-06 7:40 ` [PATCH v6 14/17] ARM: dts: microchip: sama7d65: add otpc node Varshini Rajendran
2026-08-06 9:23 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 15/17] ARM: dts: microchip: sama7d65: add cells for temperature calibration Varshini Rajendran
2026-08-06 9:19 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 16/17] ARM: dts: microchip: sama7d65: add temperature sensor Varshini Rajendran
2026-08-06 9:18 ` sashiko-bot
2026-08-06 7:40 ` [PATCH v6 17/17] ARM: dts: microchip: sama7d65: add thermal zones node Varshini Rajendran
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=20260806090748.DF4CF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=varshini.rajendran@microchip.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