devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
@ 2020-01-13 18:56 Stefan Wahren
  2020-01-13 18:56 ` [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal Stefan Wahren
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 18:56 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree,
	Stefan Wahren

This series enables thermal support for the Raspberry Pi 4. Neither the
bcm2835_thermal nor the brcmstb_thermal are suitable for the BCM2711.
So add a new thermal driver to read out the SoC temperature from the
AVS RO block of the BCM2711.

Changes in V5:
- git the rid of device member in private structure
- improve readability of bcm2711_get_temp
- avoid trace message in get_temp callback

Changes in V4:
- change my email address to avoid spurious characters

Changes in V3:
- add Rob's, Florian's and Nicolas' reviewed-by/tested-by
- adjust binding license
- make error pointer handling consistent

Changes in V2:
- rebase on thermal/linux-next
- convert binding to YAML
- make AVS RO block a subnode of AVS monitor and access it via syscon
- drop unnecessary TSENS clock and get the rid of remove callback
- add Florian's reviewed-by to last/unchanged patch

Stefan Wahren (4):
  dt-bindings: Add Broadcom AVS RO thermal
  thermal: Add BCM2711 thermal driver
  ARM: dts: bcm2711: Enable thermal
  ARM: configs: Build BCM2711 thermal as module

 .../bindings/thermal/brcm,avs-ro-thermal.yaml      |  45 ++++++++
 arch/arm/boot/dts/bcm2711.dtsi                     |  12 ++
 arch/arm/configs/multi_v7_defconfig                |   1 +
 arch/arm64/configs/defconfig                       |   1 +
 drivers/thermal/broadcom/Kconfig                   |   7 ++
 drivers/thermal/broadcom/Makefile                  |   1 +
 drivers/thermal/broadcom/bcm2711_thermal.c         | 123 +++++++++++++++++++++
 7 files changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
 create mode 100644 drivers/thermal/broadcom/bcm2711_thermal.c

-- 
2.7.4


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal
  2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
@ 2020-01-13 18:56 ` Stefan Wahren
  2020-01-16 17:33   ` Rob Herring
  2020-01-13 18:56 ` [PATCH V5 2/4] thermal: Add BCM2711 thermal driver Stefan Wahren
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 18:56 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree,
	Stefan Wahren

Since the BCM2711 doesn't have a AVS TMON block, the thermal information
must be retrieved from the AVS ring oscillator block. This block is part
of the AVS monitor which contains a bunch of raw sensors.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml

diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
new file mode 100644
index 0000000..98e7b57
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom AVS ring oscillator thermal
+
+maintainers:
+  - Stefan Wahren <wahrenst@gmx.net>
+
+description: |+
+  The thermal node should be the child of a syscon node with the
+  required property:
+
+  - compatible: Should be one of the following:
+                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
+
+  Refer to the the bindings described in
+  Documentation/devicetree/bindings/mfd/syscon.txt
+
+properties:
+  compatible:
+    const: brcm,bcm2711-thermal
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+        avs-monitor@7d5d2000 {
+                compatible = "brcm,bcm2711-avs-monitor",
+                             "syscon", "simple-mfd";
+                reg = <0x7d5d2000 0xf00>;
+
+                thermal: thermal {
+                        compatible = "brcm,bcm2711-thermal";
+                        #thermal-sensor-cells = <0>;
+                };
+        };
+...
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V5 2/4] thermal: Add BCM2711 thermal driver
  2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
  2020-01-13 18:56 ` [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal Stefan Wahren
@ 2020-01-13 18:56 ` Stefan Wahren
  2020-01-13 18:56 ` [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal Stefan Wahren
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 18:56 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree,
	Stefan Wahren

This adds the thermal sensor driver for the Broadcom BCM2711 SoC,
which is placed on the Raspberry Pi 4. The driver only provides
SoC temperature reading so far.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 drivers/thermal/broadcom/Kconfig           |   7 ++
 drivers/thermal/broadcom/Makefile          |   1 +
 drivers/thermal/broadcom/bcm2711_thermal.c | 123 +++++++++++++++++++++++++++++
 3 files changed, 131 insertions(+)
 create mode 100644 drivers/thermal/broadcom/bcm2711_thermal.c

diff --git a/drivers/thermal/broadcom/Kconfig b/drivers/thermal/broadcom/Kconfig
index cf43e15..061f1db 100644
--- a/drivers/thermal/broadcom/Kconfig
+++ b/drivers/thermal/broadcom/Kconfig
@@ -1,4 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0-only
+config BCM2711_THERMAL
+	tristate "Broadcom AVS RO thermal sensor driver"
+	depends on ARCH_BCM2835 || COMPILE_TEST
+	depends on THERMAL_OF && MFD_SYSCON
+	help
+	  Support for thermal sensors on Broadcom BCM2711 SoCs.
+
 config BCM2835_THERMAL
 	tristate "Thermal sensors on bcm2835 SoC"
 	depends on ARCH_BCM2835 || COMPILE_TEST
diff --git a/drivers/thermal/broadcom/Makefile b/drivers/thermal/broadcom/Makefile
index 490ab1f..c917b24 100644
--- a/drivers/thermal/broadcom/Makefile
+++ b/drivers/thermal/broadcom/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_BCM2711_THERMAL)		+= bcm2711_thermal.o
 obj-$(CONFIG_BCM2835_THERMAL)		+= bcm2835_thermal.o
 obj-$(CONFIG_BRCMSTB_THERMAL)		+= brcmstb_thermal.o
 obj-$(CONFIG_BCM_NS_THERMAL)		+= ns-thermal.o
diff --git a/drivers/thermal/broadcom/bcm2711_thermal.c b/drivers/thermal/broadcom/bcm2711_thermal.c
new file mode 100644
index 0000000..67c2a73
--- /dev/null
+++ b/drivers/thermal/broadcom/bcm2711_thermal.c
@@ -0,0 +1,123 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Broadcom AVS RO thermal sensor driver
+ *
+ * based on brcmstb_thermal
+ *
+ * Copyright (C) 2020 Stefan Wahren
+ */
+
+#include <linux/bitops.h>
+#include <linux/clk.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of_device.h>
+#include <linux/regmap.h>
+#include <linux/thermal.h>
+
+#include "../thermal_hwmon.h"
+
+#define AVS_RO_TEMP_STATUS		0x200
+#define AVS_RO_TEMP_STATUS_VALID_MSK	(BIT(16) | BIT(10))
+#define AVS_RO_TEMP_STATUS_DATA_MSK	GENMASK(9, 0)
+
+struct bcm2711_thermal_priv {
+	struct regmap *regmap;
+	struct thermal_zone_device *thermal;
+};
+
+static int bcm2711_get_temp(void *data, int *temp)
+{
+	struct bcm2711_thermal_priv *priv = data;
+	int slope = thermal_zone_get_slope(priv->thermal);
+	int offset = thermal_zone_get_offset(priv->thermal);
+	u32 val;
+	int ret;
+	long t;
+
+	ret = regmap_read(priv->regmap, AVS_RO_TEMP_STATUS, &val);
+	if (ret)
+		return ret;
+
+	if (!(val & AVS_RO_TEMP_STATUS_VALID_MSK))
+		return -EIO;
+
+	val &= AVS_RO_TEMP_STATUS_DATA_MSK;
+
+	/* Convert a HW code to a temperature reading (millidegree celsius) */
+	t = slope * val + offset;
+
+	*temp = t < 0 ? 0 : t;
+
+	return 0;
+}
+
+static const struct thermal_zone_of_device_ops bcm2711_thermal_of_ops = {
+	.get_temp	= bcm2711_get_temp,
+};
+
+static const struct of_device_id bcm2711_thermal_id_table[] = {
+	{ .compatible = "brcm,bcm2711-thermal" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, bcm2711_thermal_id_table);
+
+static int bcm2711_thermal_probe(struct platform_device *pdev)
+{
+	struct thermal_zone_device *thermal;
+	struct bcm2711_thermal_priv *priv;
+	struct device *dev = &pdev->dev;
+	struct device_node *parent;
+	struct regmap *regmap;
+	int ret;
+
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	/* get regmap from syscon node */
+	parent = of_get_parent(dev->of_node); /* parent should be syscon node */
+	regmap = syscon_node_to_regmap(parent);
+	of_node_put(parent);
+	if (IS_ERR(regmap)) {
+		ret = PTR_ERR(regmap);
+		dev_err(dev, "failed to get regmap: %d\n", ret);
+		return ret;
+	}
+	priv->regmap = regmap;
+
+	thermal = devm_thermal_zone_of_sensor_register(dev, 0, priv,
+						       &bcm2711_thermal_of_ops);
+	if (IS_ERR(thermal)) {
+		ret = PTR_ERR(thermal);
+		dev_err(dev, "could not register sensor: %d\n", ret);
+		return ret;
+	}
+
+	priv->thermal = thermal;
+
+	thermal->tzp->no_hwmon = false;
+	ret = thermal_add_hwmon_sysfs(thermal);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
+static struct platform_driver bcm2711_thermal_driver = {
+	.probe = bcm2711_thermal_probe,
+	.driver = {
+		.name = "bcm2711_thermal",
+		.of_match_table = bcm2711_thermal_id_table,
+	},
+};
+module_platform_driver(bcm2711_thermal_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Stefan Wahren");
+MODULE_DESCRIPTION("Broadcom AVS RO thermal sensor driver");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal
  2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
  2020-01-13 18:56 ` [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal Stefan Wahren
  2020-01-13 18:56 ` [PATCH V5 2/4] thermal: Add BCM2711 thermal driver Stefan Wahren
@ 2020-01-13 18:56 ` Stefan Wahren
  2020-01-13 20:13   ` Florian Fainelli
  2020-01-13 18:56 ` [PATCH V5 4/4] ARM: configs: Build BCM2711 thermal as module Stefan Wahren
  2020-01-13 19:10 ` [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Daniel Lezcano
  4 siblings, 1 reply; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 18:56 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree,
	Stefan Wahren

This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding
the AVS monitor and a subnode for the thermal part.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 arch/arm/boot/dts/bcm2711.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index 961bed8..96f341d 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -66,6 +66,17 @@
 						 IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		avs_monitor: avs-monitor@7d5d2000 {
+			compatible = "brcm,bcm2711-avs-monitor",
+				     "syscon", "simple-mfd";
+			reg = <0x7d5d2000 0xf00>;
+
+			thermal: thermal {
+				compatible = "brcm,bcm2711-thermal";
+				#thermal-sensor-cells = <0>;
+			};
+		};
+
 		dma: dma@7e007000 {
 			compatible = "brcm,bcm2835-dma";
 			reg = <0x7e007000 0xb00>;
@@ -363,6 +374,7 @@
 
 &cpu_thermal {
 	coefficients = <(-487) 410040>;
+	thermal-sensors = <&thermal>;
 };
 
 &dsi0 {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V5 4/4] ARM: configs: Build BCM2711 thermal as module
  2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
                   ` (2 preceding siblings ...)
  2020-01-13 18:56 ` [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal Stefan Wahren
@ 2020-01-13 18:56 ` Stefan Wahren
  2020-01-13 19:10 ` [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Daniel Lezcano
  4 siblings, 0 replies; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 18:56 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree,
	Stefan Wahren

This builds the BCM2711 thermal driver as module for the Raspberry Pi 4.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 arch/arm64/configs/defconfig        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 3f1b96d..f5d19cc 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -496,6 +496,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_ROCKCHIP_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
+CONFIG_BCM2711_THERMAL=m
 CONFIG_BCM2835_THERMAL=m
 CONFIG_BRCMSTB_THERMAL=m
 CONFIG_ST_THERMAL_MEMMAP=y
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 6a83ba2..b2f6673 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -442,6 +442,7 @@ CONFIG_ROCKCHIP_THERMAL=m
 CONFIG_RCAR_THERMAL=y
 CONFIG_RCAR_GEN3_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
+CONFIG_BCM2711_THERMAL=m
 CONFIG_BCM2835_THERMAL=m
 CONFIG_BRCMSTB_THERMAL=m
 CONFIG_EXYNOS_THERMAL=y
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
  2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
                   ` (3 preceding siblings ...)
  2020-01-13 18:56 ` [PATCH V5 4/4] ARM: configs: Build BCM2711 thermal as module Stefan Wahren
@ 2020-01-13 19:10 ` Daniel Lezcano
  2020-01-13 19:20   ` Stefan Wahren
  4 siblings, 1 reply; 14+ messages in thread
From: Daniel Lezcano @ 2020-01-13 19:10 UTC (permalink / raw)
  To: Stefan Wahren, Zhang Rui, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree


Hi Stefan,

how do you want the series merged?

On 13/01/2020 19:56, Stefan Wahren wrote:
> This series enables thermal support for the Raspberry Pi 4. Neither the
> bcm2835_thermal nor the brcmstb_thermal are suitable for the BCM2711.
> So add a new thermal driver to read out the SoC temperature from the
> AVS RO block of the BCM2711.
> 
> Changes in V5:
> - git the rid of device member in private structure
> - improve readability of bcm2711_get_temp
> - avoid trace message in get_temp callback
> 
> Changes in V4:
> - change my email address to avoid spurious characters
> 
> Changes in V3:
> - add Rob's, Florian's and Nicolas' reviewed-by/tested-by
> - adjust binding license
> - make error pointer handling consistent
> 
> Changes in V2:
> - rebase on thermal/linux-next
> - convert binding to YAML
> - make AVS RO block a subnode of AVS monitor and access it via syscon
> - drop unnecessary TSENS clock and get the rid of remove callback
> - add Florian's reviewed-by to last/unchanged patch
> 
> Stefan Wahren (4):
>   dt-bindings: Add Broadcom AVS RO thermal
>   thermal: Add BCM2711 thermal driver
>   ARM: dts: bcm2711: Enable thermal
>   ARM: configs: Build BCM2711 thermal as module
> 
>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      |  45 ++++++++
>  arch/arm/boot/dts/bcm2711.dtsi                     |  12 ++
>  arch/arm/configs/multi_v7_defconfig                |   1 +
>  arch/arm64/configs/defconfig                       |   1 +
>  drivers/thermal/broadcom/Kconfig                   |   7 ++
>  drivers/thermal/broadcom/Makefile                  |   1 +
>  drivers/thermal/broadcom/bcm2711_thermal.c         | 123 +++++++++++++++++++++
>  7 files changed, 190 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>  create mode 100644 drivers/thermal/broadcom/bcm2711_thermal.c
> 


-- 
 <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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
  2020-01-13 19:10 ` [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Daniel Lezcano
@ 2020-01-13 19:20   ` Stefan Wahren
  2020-01-13 19:24     ` Daniel Lezcano
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Wahren @ 2020-01-13 19:20 UTC (permalink / raw)
  To: Daniel Lezcano, Zhang Rui, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel, linux-pm

Hi Daniel,

Am 13.01.20 um 20:10 schrieb Daniel Lezcano:
> Hi Stefan,
>
> how do you want the series merged?

i'm not BCM2835 maintainer anymore, so the final decision is up to
Nicolas or Florian.

But if i can make a wish, it would be nice to take as much as possible
via the thermal tree, because Nicolas already sent the pull requests for
5.6.

Thanks
Stefan


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
  2020-01-13 19:20   ` Stefan Wahren
@ 2020-01-13 19:24     ` Daniel Lezcano
  2020-01-13 19:54       ` Nicolas Saenz Julienne
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Lezcano @ 2020-01-13 19:24 UTC (permalink / raw)
  To: Stefan Wahren, Zhang Rui, Amit Kucheria, Rob Herring,
	Mark Rutland, Nicolas Saenz Julienne, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel, linux-pm

On 13/01/2020 20:20, Stefan Wahren wrote:
> Hi Daniel,
> 
> Am 13.01.20 um 20:10 schrieb Daniel Lezcano:
>> Hi Stefan,
>>
>> how do you want the series merged?
> 
> i'm not BCM2835 maintainer anymore, so the final decision is up to
> Nicolas or Florian.
> 
> But if i can make a wish, it would be nice to take as much as possible
> via the thermal tree, because Nicolas already sent the pull requests for
> 5.6.

Ok, I can take the series if it is fine for everyone else.


-- 
 <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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
  2020-01-13 19:24     ` Daniel Lezcano
@ 2020-01-13 19:54       ` Nicolas Saenz Julienne
  2020-01-15 23:44         ` Florian Fainelli
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-13 19:54 UTC (permalink / raw)
  To: Daniel Lezcano, Stefan Wahren, Zhang Rui, Amit Kucheria,
	Rob Herring, Mark Rutland, Florian Fainelli, Catalin Marinas,
	Will Deacon
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

On Mon, 2020-01-13 at 20:24 +0100, Daniel Lezcano wrote:
> On 13/01/2020 20:20, Stefan Wahren wrote:
> > Hi Daniel,
> > 
> > Am 13.01.20 um 20:10 schrieb Daniel Lezcano:
> > > Hi Stefan,
> > > 
> > > how do you want the series merged?
> > 
> > i'm not BCM2835 maintainer anymore, so the final decision is up to
> > Nicolas or Florian.
> > 
> > But if i can make a wish, it would be nice to take as much as possible
> > via the thermal tree, because Nicolas already sent the pull requests for
> > 5.6.
> 
> Ok, I can take the series if it is fine for everyone else.

Sounds good to me. Thanks!

Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal
  2020-01-13 18:56 ` [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal Stefan Wahren
@ 2020-01-13 20:13   ` Florian Fainelli
  0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2020-01-13 20:13 UTC (permalink / raw)
  To: Stefan Wahren, Zhang Rui, Daniel Lezcano, Amit Kucheria,
	Rob Herring, Mark Rutland, Nicolas Saenz Julienne,
	Florian Fainelli, Catalin Marinas, Will Deacon
  Cc: linux-pm, linux-arm-kernel, bcm-kernel-feedback-list, devicetree

On 1/13/20 10:56 AM, Stefan Wahren wrote:
> This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding
> the AVS monitor and a subnode for the thermal part.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4
  2020-01-13 19:54       ` Nicolas Saenz Julienne
@ 2020-01-15 23:44         ` Florian Fainelli
  0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2020-01-15 23:44 UTC (permalink / raw)
  To: Nicolas Saenz Julienne, Daniel Lezcano, Stefan Wahren, Zhang Rui,
	Amit Kucheria, Rob Herring, Mark Rutland, Florian Fainelli,
	Catalin Marinas, Will Deacon
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel, linux-pm

On 1/13/20 11:54 AM, Nicolas Saenz Julienne wrote:
> On Mon, 2020-01-13 at 20:24 +0100, Daniel Lezcano wrote:
>> On 13/01/2020 20:20, Stefan Wahren wrote:
>>> Hi Daniel,
>>>
>>> Am 13.01.20 um 20:10 schrieb Daniel Lezcano:
>>>> Hi Stefan,
>>>>
>>>> how do you want the series merged?
>>>
>>> i'm not BCM2835 maintainer anymore, so the final decision is up to
>>> Nicolas or Florian.
>>>
>>> But if i can make a wish, it would be nice to take as much as possible
>>> via the thermal tree, because Nicolas already sent the pull requests for
>>> 5.6.
>>
>> Ok, I can take the series if it is fine for everyone else.
> 
> Sounds good to me. Thanks!

Works for me as well, thanks!
-- 
-- 
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal
  2020-01-13 18:56 ` [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal Stefan Wahren
@ 2020-01-16 17:33   ` Rob Herring
  2020-01-16 18:23     ` Stefan Wahren
  0 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2020-01-16 17:33 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Zhang Rui, Daniel Lezcano, Amit Kucheria, Mark Rutland,
	Nicolas Saenz Julienne, Florian Fainelli, Catalin Marinas,
	Will Deacon, open list:THERMAL,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE, devicetree

On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>
> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
> must be retrieved from the AVS ring oscillator block. This block is part
> of the AVS monitor which contains a bunch of raw sensors.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml

The example fails 'make dt_binding_check':

/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
thermal: 'reg' is a required property

> diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> new file mode 100644
> index 0000000..98e7b57
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom AVS ring oscillator thermal
> +
> +maintainers:
> +  - Stefan Wahren <wahrenst@gmx.net>
> +
> +description: |+
> +  The thermal node should be the child of a syscon node with the
> +  required property:
> +
> +  - compatible: Should be one of the following:
> +                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
> +
> +  Refer to the the bindings described in
> +  Documentation/devicetree/bindings/mfd/syscon.txt
> +
> +properties:
> +  compatible:
> +    const: brcm,bcm2711-thermal
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +        avs-monitor@7d5d2000 {
> +                compatible = "brcm,bcm2711-avs-monitor",
> +                             "syscon", "simple-mfd";
> +                reg = <0x7d5d2000 0xf00>;
> +
> +                thermal: thermal {
> +                        compatible = "brcm,bcm2711-thermal";
> +                        #thermal-sensor-cells = <0>;

Also this is not documented. That's not caught because
'additionalProperties: false' is also needed.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal
  2020-01-16 17:33   ` Rob Herring
@ 2020-01-16 18:23     ` Stefan Wahren
  2020-01-16 18:26       ` Stefan Wahren
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Wahren @ 2020-01-16 18:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: Zhang Rui, Daniel Lezcano, Amit Kucheria, Mark Rutland,
	Nicolas Saenz Julienne, Florian Fainelli, Catalin Marinas,
	Will Deacon, open list:THERMAL,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE, devicetree

Hi Rob,

Am 16.01.20 um 18:33 schrieb Rob Herring:
> On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>> must be retrieved from the AVS ring oscillator block. This block is part
>> of the AVS monitor which contains a bunch of raw sensors.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>> ---
>>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>>  1 file changed, 45 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> The example fails 'make dt_binding_check':
>
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
> thermal: 'reg' is a required property

can you please explain what is the reason for this? The example below
has a reg property. I'm confused.

Best regards
Stefan

>
>> diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> new file mode 100644
>> index 0000000..98e7b57
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> @@ -0,0 +1,45 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Broadcom AVS ring oscillator thermal
>> +
>> +maintainers:
>> +  - Stefan Wahren <wahrenst@gmx.net>
>> +
>> +description: |+
>> +  The thermal node should be the child of a syscon node with the
>> +  required property:
>> +
>> +  - compatible: Should be one of the following:
>> +                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
>> +
>> +  Refer to the the bindings described in
>> +  Documentation/devicetree/bindings/mfd/syscon.txt
>> +
>> +properties:
>> +  compatible:
>> +    const: brcm,bcm2711-thermal
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +examples:
>> +  - |
>> +        avs-monitor@7d5d2000 {
>> +                compatible = "brcm,bcm2711-avs-monitor",
>> +                             "syscon", "simple-mfd";
>> +                reg = <0x7d5d2000 0xf00>;
>> +
>> +                thermal: thermal {
>> +                        compatible = "brcm,bcm2711-thermal";
>> +                        #thermal-sensor-cells = <0>;
> Also this is not documented. That's not caught because
> 'additionalProperties: false' is also needed.
>
> Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal
  2020-01-16 18:23     ` Stefan Wahren
@ 2020-01-16 18:26       ` Stefan Wahren
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Wahren @ 2020-01-16 18:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Zhang Rui, Daniel Lezcano, Amit Kucheria, Mark Rutland,
	Nicolas Saenz Julienne, Florian Fainelli, Catalin Marinas,
	Will Deacon, open list:THERMAL,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE, devicetree

Am 16.01.20 um 19:23 schrieb Stefan Wahren:
> Hi Rob,
>
> Am 16.01.20 um 18:33 schrieb Rob Herring:
>> On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>>> must be retrieved from the AVS ring oscillator block. This block is part
>>> of the AVS monitor which contains a bunch of raw sensors.
>>>
>>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>>> Reviewed-by: Rob Herring <robh@kernel.org>
>>> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>>> ---
>>>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>>>  1 file changed, 45 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> The example fails 'make dt_binding_check':
>>
>> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
>> thermal: 'reg' is a required property
> can you please explain what is the reason for this? The example below
> has a reg property. I'm confused.

Please ignore, i got the issue.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-01-16 18:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 18:56 [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Stefan Wahren
2020-01-13 18:56 ` [PATCH V5 1/4] dt-bindings: Add Broadcom AVS RO thermal Stefan Wahren
2020-01-16 17:33   ` Rob Herring
2020-01-16 18:23     ` Stefan Wahren
2020-01-16 18:26       ` Stefan Wahren
2020-01-13 18:56 ` [PATCH V5 2/4] thermal: Add BCM2711 thermal driver Stefan Wahren
2020-01-13 18:56 ` [PATCH V5 3/4] ARM: dts: bcm2711: Enable thermal Stefan Wahren
2020-01-13 20:13   ` Florian Fainelli
2020-01-13 18:56 ` [PATCH V5 4/4] ARM: configs: Build BCM2711 thermal as module Stefan Wahren
2020-01-13 19:10 ` [PATCH V5 0/4] ARM: Enable thermal support for Raspberry Pi 4 Daniel Lezcano
2020-01-13 19:20   ` Stefan Wahren
2020-01-13 19:24     ` Daniel Lezcano
2020-01-13 19:54       ` Nicolas Saenz Julienne
2020-01-15 23:44         ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).