Skip to contentSkip to conversation

Update for AP807 thermal data

PATCH Applied Russell King (Oracle) 7 participants 12 messages Jun 16, 2023 – Feb 7, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Update for AP807 thermal data

Hi,

This series updates the thermal data for the AP807 die, which has different coefficients to the AP806.

These patches have come from the SolidRun CN913x build repository which can be found at:
https://github.com/SolidRun/cn913x_build/tree/master/patches/linux

 .../devicetree/bindings/thermal/armada-thermal.txt |  1 +
 arch/arm64/boot/dts/marvell/armada-ap807.dtsi      |  3 ++
 drivers/thermal/armada_thermal.c                   | 32 ++++++++++++++++++++--
 3 files changed, 34 insertions(+), 2 deletions(-)
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
#1 lore raw

PATCH 1/3 dt-bindings: armada-thermal: add armada-ap807-thermal compatible

From: Alex Leibovich <[email protected]>

Add marvell,armada-ap807-thermal compatible for the AP807 die.

---
 Documentation/devicetree/bindings/thermal/armada-thermal.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/thermal/armada-thermal.txt +1 -0
index b0bee7e42038..ab8b8fccc7af 100644
@@ -8,6 +8,7 @@
     * marvell,armada380-thermal
     * marvell,armadaxp-thermal
     * marvell,armada-ap806-thermal
+    * marvell,armada-ap807-thermal
     * marvell,armada-cp110-thermal
 
 Note: these bindings are deprecated for AP806/CP110 and should instead
Signature · 1 line
2.30.2
Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: armada-thermal: add armada-ap807-thermal compatible

Quoted 6 lines · Russell King (Oracle)

From: Alex Leibovich <[email protected]>

Add marvell,armada-ap807-thermal compatible for the AP807 die.

This is a TXT file, thus testing by some jenkins seems like a fake tag. Please drop fake tags.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

PATCH 2/3 thermal: armada: add support for AP807 thermal data

In reply to Russell King (Oracle)

From: Alex Leibovich <[email protected]>

Add support for the AP807 die thermal data. This is the same as AP806, except for the coefficients.

ap807 values taken from TSENSE_ADC_16FFC spec, which says:
T(in Celsius) = T(code)*TSENE_GAIN+TSENE_OFFSET
where in default:

	TSENE_OFFSET = 128.9
	TSENE_GAIN = 0.394
---
 drivers/thermal/armada_thermal.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)
drivers/thermal/armada_thermal.c +30 -2
index 2efc222a379b..f64c2b508542 100644
@@ -231,7 +231,7 @@ static void armada380_init(struct platform_device *pdev,
 	regmap_write(priv->syscon, data->syscon_control0_off, reg);
 }
 
-static void armada_ap806_init(struct platform_device *pdev,
+static void armada_ap80x_init(struct platform_device *pdev,
 			      struct armada_thermal_priv *priv)
 {
 	struct armada_thermal_data *data = priv->data;
@@ -620,7 +620,7 @@ static const struct armada_thermal_data armada380_data = {
 };
 
 static const struct armada_thermal_data armada_ap806_data = {
-	.init = armada_ap806_init,
+	.init = armada_ap80x_init,
 	.is_valid_bit = BIT(16),
 	.temp_shift = 0,
 	.temp_mask = 0x3ff,
@@ -643,6 +643,30 @@ static const struct armada_thermal_data armada_ap806_data = {
 	.cpu_nr = 4,
 };
 
+static const struct armada_thermal_data armada_ap807_data = {
+	.init = armada_ap80x_init,
+	.is_valid_bit = BIT(16),
+	.temp_shift = 0,
+	.temp_mask = 0x3ff,
+	.thresh_shift = 3,
+	.hyst_shift = 19,
+	.hyst_mask = 0x3,
+	.coef_b = -128900LL,
+	.coef_m = 394ULL,
+	.coef_div = 1,
+	.inverted = true,
+	.signed_sample = true,
+	.syscon_control0_off = 0x84,
+	.syscon_control1_off = 0x88,
+	.syscon_status_off = 0x8C,
+	.dfx_irq_cause_off = 0x108,
+	.dfx_irq_mask_off = 0x10C,
+	.dfx_overheat_irq = BIT(22),
+	.dfx_server_irq_mask_off = 0x104,
+	.dfx_server_irq_en = BIT(1),
+	.cpu_nr = 4,
+};
+
 static const struct armada_thermal_data armada_cp110_data = {
 	.init = armada_cp110_init,
 	.is_valid_bit = BIT(10),
@@ -686,6 +710,10 @@ static const struct of_device_id armada_thermal_id_table[] = {
 		.compatible = "marvell,armada-ap806-thermal",
 		.data       = &armada_ap806_data,
 	},
+	{
+		.compatible = "marvell,armada-ap807-thermal",
+		.data       = &armada_ap807_data,
+	},
 	{
 		.compatible = "marvell,armada-cp110-thermal",
 		.data       = &armada_cp110_data,
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] thermal: armada: add support for AP807 thermal data

Hi Russell,

[email protected] wrote on Fri, 16 Jun 2023 12:50:42 +0100:

Quoted 8 lines

From: Alex Leibovich <[email protected]>

Add support for the AP807 die thermal data. This is the same as AP806, except for the coefficients.

ap807 values taken from TSENSE_ADC_16FFC spec, which says:
T(in Celsius) = T(code)*TSENE_GAIN+TSENE_OFFSET
where in default:

Quoted 7 lines
	TSENE_OFFSET = 128.9
	TSENE_GAIN = 0.394
Quoted 4 lines
---
 drivers/thermal/armada_thermal.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

Thanks,
Miquèl

#5 lore raw

PATCH 3/3 arm64: dts: armada-ap807: update thermal compatible

In reply to Russell King (Oracle)

From: Alex Leibovich <[email protected]>

Use the correct thermal coefficients for the Armada AP807 dies.

---
 arch/arm64/boot/dts/marvell/armada-ap807.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +3 -0
index 4a23f65d475f..a3328d05fc94 100644
@@ -33,3 +33,6 @@ &ap_sdhci0 {
 		     "marvell,armada-ap806-sdhci"; /* Backward compatibility */
 };
 
+&ap_thermal {
+	compatible = "marvell,armada-ap807-thermal";
+};
Signature · 1 line
2.30.2
#6 lore raw

Re: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible

Hi Russell and Alex,

Quoted 17 lines · Russell King

From: Alex Leibovich <[email protected]>

Use the correct thermal coefficients for the Armada AP807 dies.

---
 arch/arm64/boot/dts/marvell/armada-ap807.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +0 -0
index 4a23f65d475f..a3328d05fc94 100644

arch/arm64/boot/dts/marvell/armada-ap807.dtsi &ap_sdhci0 { · line 38

Quoted 6 lines
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +3 -0
@@ -33,3 +33,6 @@ &ap_sdhci0 {
 		     "marvell,armada-ap806-sdhci"; /* Backward compatibility */
 };
 
+&ap_thermal {
+	compatible = "marvell,armada-ap807-thermal";
+};

While working on some thermal optimizations, our hardware team discovered that this patch is still missing upstream. Is something missing or did it get lost?

Regards,
Stefan

maintainer
#7 lore raw

Re: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible

Quoted 23 lines · Stefan Eichenberger

Hi Russell and Alex,

Quoted 20 lines · Russell King

From: Alex Leibovich <[email protected]>

Use the correct thermal coefficients for the Armada AP807 dies.

---
 arch/arm64/boot/dts/marvell/armada-ap807.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +0 -0
index 4a23f65d475f..a3328d05fc94 100644
@@ -33,3 +33,6 @@ &ap_sdhci0 {
 		     "marvell,armada-ap806-sdhci"; /* Backward compatibility */
 };
 
Quoted 7 lines

arch/arm64/boot/dts/marvell/armada-ap807.dtsi &ap_sdhci0 { · line 38

Quoted 3 lines
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +3 -0
+&ap_thermal {
+	compatible = "marvell,armada-ap807-thermal";
+};

While working on some thermal optimizations, our hardware team discovered that this patch is still missing upstream. Is something missing or did it get lost?

Patch 1/3 had a change request. Was it ever reposted with the requested change?

It would also be nice to convert the .txt to .yaml. The DT Maintainers might insist on that when it is reposted?

Andrew

#8 lore raw

Re: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible

Quoted 32 lines · Andrew Lunn
Quoted 23 lines · Stefan Eichenberger

Hi Russell and Alex,

Quoted 20 lines · Russell King

From: Alex Leibovich <[email protected]>

Use the correct thermal coefficients for the Armada AP807 dies.

---
 arch/arm64/boot/dts/marvell/armada-ap807.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +0 -0
index 4a23f65d475f..a3328d05fc94 100644
@@ -33,3 +33,6 @@ &ap_sdhci0 {
 		     "marvell,armada-ap806-sdhci"; /* Backward compatibility */
 };
 
Quoted 7 lines

arch/arm64/boot/dts/marvell/armada-ap807.dtsi &ap_sdhci0 { · line 38

Quoted 3 lines
arch/arm64/boot/dts/marvell/armada-ap807.dtsi +3 -0
+&ap_thermal {
+	compatible = "marvell,armada-ap807-thermal";
+};

While working on some thermal optimizations, our hardware team discovered that this patch is still missing upstream. Is something missing or did it get lost?

Quoted 2 lines

Patch 1/3 had a change request. Was it ever reposted with the requested change?

I don't think so, it's just another patch series of many that I have that's basically low priority, and other stuff probably overrode it and I then forgot about it.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
#9 lore raw

Re: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible

Quoted 7 lines · Russell King (Oracle)
Quoted 6 lines · Andrew Lunn
Quoted 3 lines

While working on some thermal optimizations, our hardware team discovered that this patch is still missing upstream. Is something missing or did it get lost?

Patch 1/3 had a change request. Was it ever reposted with the requested change?

I forgot to mention that the other patches were applied, so it is only the one missing without change request.

Quoted 4 lines

I don't think so, it's just another patch series of many that I have that's basically low priority, and other stuff probably overrode it and I then forgot about it.

No problem at all, thanks a lot for the feedback.

Regards,
Stefan

maintainer
#10 lore raw

Re: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible

Quoted 11 lines · Stefan Eichenberger
Quoted 7 lines · Russell King (Oracle)
Quoted 6 lines · Andrew Lunn
Quoted 3 lines

While working on some thermal optimizations, our hardware team discovered that this patch is still missing upstream. Is something missing or did it get lost?

Patch 1/3 had a change request. Was it ever reposted with the requested change?

I forgot to mention that the other patches were applied, so it is only the one missing without change request.

Ah. O.K. Repost it to the MVEBU Maintainers.

Andrew

#11 lore raw
In reply to Russell King (Oracle)
Quoted 5 lines · Russell King (Oracle)

Hi,

This series updates the thermal data for the AP807 die, which has different coefficients to the AP806.

Quoted 8 lines

These patches have come from the SolidRun CN913x build repository which can be found at:
https://github.com/SolidRun/cn913x_build/tree/master/patches/linux

  .../devicetree/bindings/thermal/armada-thermal.txt |  1 +
  arch/arm64/boot/dts/marvell/armada-ap807.dtsi      |  3 ++
  drivers/thermal/armada_thermal.c                   | 32 ++++++++++++++++++++--
  3 files changed, 34 insertions(+), 2 deletions(-)

Applied, patch 1 and 2.

Dropped the sa_ip-sw-jenkins Tested-by tag

Thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog