* [PATCH 0/2] iio: adc: stm32: describe the STM32H7 temperature sensor calibration
@ 2026-11-24 20:22 Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 1/2] dt-bindings: iio: adc: st,stm32-adc: add temperature sensor calibration cells Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 2/2] ARM: dts: stm32: add the factory calibration data to stm32h743 Gerard Marull-Paretas
0 siblings, 2 replies; 3+ messages in thread
From: Gerard Marull-Paretas @ 2026-11-24 20:22 UTC (permalink / raw)
To: jic23, robh, krzk+dt, conor+dt, mcoquelin.stm32, alexandre.torgue
Cc: fabrice.gasnier, dlechner, nuno.sa, andy, linux-iio, devicetree,
linux-stm32, linux-arm-kernel
The STM32 ADC binding lets an ADC take the factory calibration of its
internal voltage reference (VREFINT_CAL) as an nvmem cell, but not the
two calibration points of the internal temperature sensor (TS_CAL1 and
TS_CAL2), although the STM32F4 and STM32MP1 device trees already
describe those cells.
This series adds the two temperature sensor calibration cells to the
binding, and describes the factory calibration area of the STM32H7 in
system memory, passing its cells to ADC3, which the temperature sensor
and VREFINT are connected to.
PebbleOS uses these bindings, including the new cells, to describe the
STM32H747 and read its temperature sensor.
Gerard Marull-Paretas (2):
dt-bindings: iio: adc: st,stm32-adc: add temperature sensor
calibration cells
ARM: dts: stm32: add the factory calibration data to stm32h743
.../bindings/iio/adc/st,stm32-adc.yaml | 10 +++++++++
arch/arm/boot/dts/st/stm32h743.dtsi | 21 +++++++++++++++++++
2 files changed, 31 insertions(+)
base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
--
2.45.2
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 1/2] dt-bindings: iio: adc: st,stm32-adc: add temperature sensor calibration cells
2026-11-24 20:22 [PATCH 0/2] iio: adc: stm32: describe the STM32H7 temperature sensor calibration Gerard Marull-Paretas
@ 2026-11-24 20:22 ` Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 2/2] ARM: dts: stm32: add the factory calibration data to stm32h743 Gerard Marull-Paretas
1 sibling, 0 replies; 3+ messages in thread
From: Gerard Marull-Paretas @ 2026-11-24 20:22 UTC (permalink / raw)
To: jic23, robh, krzk+dt, conor+dt, mcoquelin.stm32, alexandre.torgue
Cc: fabrice.gasnier, dlechner, nuno.sa, andy, linux-iio, devicetree,
linux-stm32, linux-arm-kernel
The internal temperature sensor of STM32 ADCs is calibrated in the
factory at two temperatures, and its calibration data (TS_CAL1 and
TS_CAL2) is stored in a read-only area, along with the internal voltage
reference calibration (VREFINT_CAL). On STM32H7, the temperature sensor
is connected to ADC3.
Only the vrefint calibration can be passed to an ADC today. Allow the
two temperature sensor calibration points to be passed as nvmem cells as
well, so the ADC the temperature sensor is connected to can convert its
readings.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
---
.../devicetree/bindings/iio/adc/st,stm32-adc.yaml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
index c4c4575d3fa9..9fe41b89982e 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
@@ -337,12 +337,22 @@ patternProperties:
deprecated: true
nvmem-cells:
+ minItems: 1
items:
- description: Phandle to the calibration vrefint data provided by otp
+ - description:
+ Temperature sensor calibration data at the first calibration
+ temperature (TS_CAL1)
+ - description:
+ Temperature sensor calibration data at the second calibration
+ temperature (TS_CAL2)
nvmem-cell-names:
+ minItems: 1
items:
- const: vrefint
+ - const: ts-cal1
+ - const: ts-cal2
patternProperties:
"^channel@([0-9]|1[0-9])$":
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] ARM: dts: stm32: add the factory calibration data to stm32h743
2026-11-24 20:22 [PATCH 0/2] iio: adc: stm32: describe the STM32H7 temperature sensor calibration Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 1/2] dt-bindings: iio: adc: st,stm32-adc: add temperature sensor calibration cells Gerard Marull-Paretas
@ 2026-11-24 20:22 ` Gerard Marull-Paretas
1 sibling, 0 replies; 3+ messages in thread
From: Gerard Marull-Paretas @ 2026-11-24 20:22 UTC (permalink / raw)
To: jic23, robh, krzk+dt, conor+dt, mcoquelin.stm32, alexandre.torgue
Cc: fabrice.gasnier, dlechner, nuno.sa, andy, linux-iio, devicetree,
linux-stm32, linux-arm-kernel
The temperature sensor and internal voltage reference calibration data
of the STM32H7 are stored in system memory, at 0x1ff1e820 (TS_CAL1),
0x1ff1e840 (TS_CAL2) and 0x1ff1e860 (VREFINT_CAL).
Describe this area as STM32 factory-programmed data, and pass the
calibration cells to ADC3, which the temperature sensor and VREFINT are
connected to.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
---
arch/arm/boot/dts/st/stm32h743.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boot/dts/st/stm32h743.dtsi b/arch/arm/boot/dts/st/stm32h743.dtsi
index 2f19cfbc57ad..ecb6aba3b0db 100644
--- a/arch/arm/boot/dts/st/stm32h743.dtsi
+++ b/arch/arm/boot/dts/st/stm32h743.dtsi
@@ -70,6 +70,25 @@ clk_i2s: i2s_ckin {
};
soc {
+ romem: efuse@1ff1e800 {
+ compatible = "st,stm32f4-otp";
+ reg = <0x1ff1e800 0x100>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ ts_cal1: calib@20 {
+ reg = <0x20 0x2>;
+ };
+
+ ts_cal2: calib@40 {
+ reg = <0x40 0x2>;
+ };
+
+ vrefint: calib@60 {
+ reg = <0x60 0x2>;
+ };
+ };
+
timer5: timer@40000c00 {
compatible = "st,stm32-timer";
reg = <0x40000c00 0x400>;
@@ -572,6 +591,8 @@ adc3: adc@0 {
reg = <0x0>;
interrupt-parent = <&adc_3>;
interrupts = <0>;
+ nvmem-cells = <&vrefint>, <&ts_cal1>, <&ts_cal2>;
+ nvmem-cell-names = "vrefint", "ts-cal1", "ts-cal2";
status = "disabled";
};
};
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-24 21:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 20:22 [PATCH 0/2] iio: adc: stm32: describe the STM32H7 temperature sensor calibration Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 1/2] dt-bindings: iio: adc: st,stm32-adc: add temperature sensor calibration cells Gerard Marull-Paretas
2026-11-24 20:22 ` [PATCH 2/2] ARM: dts: stm32: add the factory calibration data to stm32h743 Gerard Marull-Paretas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox