* [PATCH 0/3] thermal/drivers/amlogic: add S4 support
@ 2026-10-25 19:22 christian.koever-draxl
2026-10-25 19:22 ` [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor christian.koever-draxl
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: christian.koever-draxl @ 2026-10-25 19:22 UTC (permalink / raw)
To: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt
Cc: linux-pm, linux-amlogic, devicetree, linux-kernel,
Christian Stefan Kövér-Draxl
From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
The S4 CPU sensor is the G12A design with the calibration read through
the secure monitor, as on T7, so it reuses the T7 data on top of Ronald
Claveau's secure monitor calibration support. Without calibration the
sensor reported about -144 degrees Celsius.
Patch 3 makes the expected first probe deferral (the secure monitor
probes later) quiet.
Tool use (Documentation/process/generated-content.rst):
This work was done with the help of an AI coding assistant, Claude
(Anthropic), used through Claude Code over many sessions. It did a large
part of the hands-on work: it read the vendor kernel and the firmware
interfaces, probed registers on the board, drafted the code and the
changelogs, and ran the builds, checkpatch, dt_binding_check and the
tests on the hardware. I directed the work, reviewed every change and
the final patches, and take responsibility for them. There is no single
prompt to quote; the sessions were of the form "find out why X fails on
this board, fix it, test it on the box".
Tested on an Amediatech X98Q TV box (Amlogic S905W2, S4 family, 2 GiB),
vendor U-Boot and BL31/OP-TEE, Linux 7.3 plus this work.
Christian Stefan Kövér-Draxl (3):
dt-bindings: thermal: amlogic: add the S4 CPU sensor
thermal/drivers/amlogic: add S4 support
thermal/drivers/amlogic: do not log the secure monitor deferral as an
error
.../devicetree/bindings/thermal/amlogic,thermal.yaml | 1 +
drivers/thermal/amlogic_thermal.c | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
base-commit: 7be4bc52fd9e0e55dc9a2e0232b89427d2c4b614
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor
2026-10-25 19:22 [PATCH 0/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
@ 2026-10-25 19:22 ` christian.koever-draxl
2026-10-30 10:57 ` Krzysztof Kozlowski
2026-10-25 19:22 ` [PATCH 2/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
2026-10-25 19:22 ` [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error christian.koever-draxl
2 siblings, 1 reply; 7+ messages in thread
From: christian.koever-draxl @ 2026-10-25 19:22 UTC (permalink / raw)
To: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt
Cc: linux-pm, linux-amlogic, devicetree, linux-kernel,
Christian Stefan Kövér-Draxl
From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
The S4 CPU temperature sensor is the G12A design, but like on T7 its
calibration value is only available through the secure monitor: the
ao-secure register used on G12A holds unrelated data on S4. Add a
compatible for it; it takes a single clock and the secure monitor
phandle with the sensor index.
Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
---
Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
index e72cb39ac635..5d966ab4d820 100644
--- a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
@@ -23,6 +23,7 @@ properties:
- const: amlogic,g12a-thermal
- enum:
- amlogic,a1-cpu-thermal
+ - amlogic,s4-cpu-thermal
- amlogic,t7-thermal
reg:
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] thermal/drivers/amlogic: add S4 support
2026-10-25 19:22 [PATCH 0/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
2026-10-25 19:22 ` [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor christian.koever-draxl
@ 2026-10-25 19:22 ` christian.koever-draxl
2026-10-30 10:58 ` Krzysztof Kozlowski
2026-10-25 19:22 ` [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error christian.koever-draxl
2 siblings, 1 reply; 7+ messages in thread
From: christian.koever-draxl @ 2026-10-25 19:22 UTC (permalink / raw)
To: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt
Cc: linux-pm, linux-amlogic, devicetree, linux-kernel,
Christian Stefan Kövér-Draxl
From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
The S4 CPU sensor reads its calibration through the secure monitor and
otherwise matches the T7 setup, so reuse the T7 data for it.
Without the calibration the driver reported about -144 degrees Celsius
on an S905W2 board; with it the readings are plausible and CPU
throttling engages.
Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
---
drivers/thermal/amlogic_thermal.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 60728de6968a..c58bac633bed 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -292,6 +292,10 @@ static const struct of_device_id of_amlogic_thermal_match[] = {
.compatible = "amlogic,a1-cpu-thermal",
.data = &amlogic_thermal_a1_cpu_param,
},
+ {
+ .compatible = "amlogic,s4-cpu-thermal",
+ .data = &amlogic_thermal_t7_param,
+ },
{
.compatible = "amlogic,t7-thermal",
.data = &amlogic_thermal_t7_param,
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error
2026-10-25 19:22 [PATCH 0/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
2026-10-25 19:22 ` [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor christian.koever-draxl
2026-10-25 19:22 ` [PATCH 2/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
@ 2026-10-25 19:22 ` christian.koever-draxl
2026-10-26 8:47 ` neil.armstrong
2 siblings, 1 reply; 7+ messages in thread
From: christian.koever-draxl @ 2026-10-25 19:22 UTC (permalink / raw)
To: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt
Cc: linux-pm, linux-amlogic, devicetree, linux-kernel,
Christian Stefan Kövér-Draxl
From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
The thermal sensor usually probes before the secure monitor, so the
first attempt always defers and logs "Failed to get secure monitor
firmware" as an error on every boot, although the second attempt
succeeds. Use dev_err_probe(), which records the reason for the
deferral instead of logging it.
Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
---
drivers/thermal/amlogic_thermal.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index c58bac633bed..54e59f444d46 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -196,10 +196,9 @@ static int amlogic_thermal_probe_sm(struct platform_device *pdev,
pdata->sm_fw = meson_sm_get(ph_args.np);
of_node_put(ph_args.np);
- if (!pdata->sm_fw) {
- dev_err(dev, "Failed to get secure monitor firmware\n");
- return -EPROBE_DEFER;
- }
+ if (!pdata->sm_fw)
+ return dev_err_probe(dev, -EPROBE_DEFER,
+ "Failed to get secure monitor firmware\n");
pdata->tsensor_id = ph_args.args[0];
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error
2026-10-25 19:22 ` [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error christian.koever-draxl
@ 2026-10-26 8:47 ` neil.armstrong
0 siblings, 0 replies; 7+ messages in thread
From: neil.armstrong @ 2026-10-26 8:47 UTC (permalink / raw)
To: christian.koever-draxl, glaroque, rafael, daniel.lezcano,
rui.zhang, lukasz.luba, robh, krzk+dt, conor+dt
Cc: linux-pm, linux-amlogic, devicetree, linux-kernel,
Christian Stefan Kövér-Draxl
On 10/25/26 20:22, christian.koever-draxl@student.uibk.ac.at wrote:
> From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
>
> The thermal sensor usually probes before the secure monitor, so the
> first attempt always defers and logs "Failed to get secure monitor
> firmware" as an error on every boot, although the second attempt
> succeeds. Use dev_err_probe(), which records the reason for the
> deferral instead of logging it.
>
> Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
> ---
> drivers/thermal/amlogic_thermal.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index c58bac633bed..54e59f444d46 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -196,10 +196,9 @@ static int amlogic_thermal_probe_sm(struct platform_device *pdev,
>
> pdata->sm_fw = meson_sm_get(ph_args.np);
> of_node_put(ph_args.np);
> - if (!pdata->sm_fw) {
> - dev_err(dev, "Failed to get secure monitor firmware\n");
> - return -EPROBE_DEFER;
> - }
> + if (!pdata->sm_fw)
> + return dev_err_probe(dev, -EPROBE_DEFER,
> + "Failed to get secure monitor firmware\n");
>
> pdata->tsensor_id = ph_args.args[0];
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor
2026-10-25 19:22 ` [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor christian.koever-draxl
@ 2026-10-30 10:57 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-30 10:57 UTC (permalink / raw)
To: christian.koever-draxl
Cc: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt, linux-pm, linux-amlogic, devicetree,
linux-kernel, Christian Stefan Kövér-Draxl
On Sun, Oct 25, 2026 at 08:22:42PM +0100, christian.koever-draxl@student.uibk.ac.at wrote:
> From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
>
> The S4 CPU temperature sensor is the G12A design, but like on T7 its
> calibration value is only available through the secure monitor: the
> ao-secure register used on G12A holds unrelated data on S4. Add a
> compatible for it; it takes a single clock and the secure monitor
> phandle with the sensor index.
>
> Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
> ---
Feedback from Sashiko looks reasonable and I do not see it being
responded to. Dropping from DT Patchwork.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] thermal/drivers/amlogic: add S4 support
2026-10-25 19:22 ` [PATCH 2/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
@ 2026-10-30 10:58 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-30 10:58 UTC (permalink / raw)
To: christian.koever-draxl
Cc: glaroque, rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh,
krzk+dt, conor+dt, linux-pm, linux-amlogic, devicetree,
linux-kernel, Christian Stefan Kövér-Draxl
On Sun, Oct 25, 2026 at 08:22:43PM +0100, christian.koever-draxl@student.uibk.ac.at wrote:
> From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
>
> The S4 CPU sensor reads its calibration through the secure monitor and
> otherwise matches the T7 setup, so reuse the T7 data for it.
So is it or is it not compatible with T7?
>
> Without the calibration the driver reported about -144 degrees Celsius
> on an S905W2 board; with it the readings are plausible and CPU
> throttling engages.
>
> Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
> ---
> drivers/thermal/amlogic_thermal.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index 60728de6968a..c58bac633bed 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -292,6 +292,10 @@ static const struct of_device_id of_amlogic_thermal_match[] = {
> .compatible = "amlogic,a1-cpu-thermal",
> .data = &amlogic_thermal_a1_cpu_param,
> },
> + {
> + .compatible = "amlogic,s4-cpu-thermal",
> + .data = &amlogic_thermal_t7_param,
> + },
> {
This clearly suggests they are compatible.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-10-30 10:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 19:22 [PATCH 0/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
2026-10-25 19:22 ` [PATCH 1/3] dt-bindings: thermal: amlogic: add the S4 CPU sensor christian.koever-draxl
2026-10-30 10:57 ` Krzysztof Kozlowski
2026-10-25 19:22 ` [PATCH 2/3] thermal/drivers/amlogic: add S4 support christian.koever-draxl
2026-10-30 10:58 ` Krzysztof Kozlowski
2026-10-25 19:22 ` [PATCH 3/3] thermal/drivers/amlogic: do not log the secure monitor deferral as an error christian.koever-draxl
2026-10-26 8:47 ` neil.armstrong
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®