[PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

STALE2956d

Revision v4 of 6 in this series.

15 messages, 5 authors, 2018-07-09 · open the first message on its own page

[PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

From: Amit Kucheria <hidden>
Date: 2018-07-02 12:47:01

This series is a mixed bag:
- Some code moves to allow code sharing between various v2.x.y versions of
  the TSENS IP,
- new qcom,tsens-v2.4.0 DT property for SDM845 and a generic qcom,tsens-v2
  property as a fallback compatible for all v2.x.y platforms,
- new platform support (sdm845)
- a cleanup patch and
- a DT change to have a common way to deal with the SROT and TM registers
  despite slightly different features across the IP family and different
  register offsets.

Rob mentioned offline that we should expose the full version string of the
TSENS IP (x.y.z) and have a fallback compatible. I hope patch 4 does what
you were looking for.

Regards,
Amit

Amit Kucheria (6):
  thermal: tsens: Get rid of unused fields in structure
  dt: qcom: 8996: thermal: Move to DT initialisation
  thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse
  thermal: tsens: Add support for SDM845
  thermal: tsens: Check if we have valid data before reading
  arm64: dts: sdm845: Add tsens nodes

 .../devicetree/bindings/thermal/qcom-tsens.txt     |  2 ++
 arch/arm64/boot/dts/qcom/msm8996.dtsi              | 12 ++++++-
 arch/arm64/boot/dts/qcom/sdm845.dtsi               | 16 +++++++++
 drivers/thermal/qcom/Makefile                      |  2 +-
 drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c}  | 39 ++++++++++++----------
 drivers/thermal/qcom/tsens.c                       |  6 ++++
 drivers/thermal/qcom/tsens.h                       |  7 ++--
 7 files changed, 62 insertions(+), 22 deletions(-)
 rename drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} (66%)

-- 
2.7.4

[PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation

From: Amit Kucheria <hidden>
Date: 2018-07-02 12:44:52

We also split up the regmap address space into two, one for the TM
registers, the other for the SROT registers. This was required to deal with
different address offsets for the TM and SROT registers across different
SoC families.

Since tsens-common.c/init_common() currently only registers one address
space, the order is important (TM before SROT). This is OK since the code
doesn't really use the SROT functionality yet.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 8c7f9ca..6c8a857 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -461,7 +461,17 @@
 
 		tsens0: thermal-sensor at 4a8000 {
 			compatible = "qcom,msm8996-tsens";
-			reg = <0x4a8000 0x2000>;
+			reg = <0x4a9000 0x1000>, /* TM */
+			      <0x4a8000 0x1000>; /* SROT */
+			#qcom,sensors = <13>;
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: thermal-sensor at 4ac000 {
+			compatible = "qcom,msm8996-tsens";
+			reg = <0x4ad000 0x1000>, /* TM */
+			      <0x4ac000 0x1000>; /* SROT */
+			#qcom,sensors = <8>;
 			#thermal-sensor-cells = <1>;
 		};
 
-- 
2.7.4

[PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Amit Kucheria <hidden>
Date: 2018-07-02 12:45:30

SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
 			#interrupt-cells = <2>;
 		};
 
+		tsens0: tsens at c222000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc263000 0x1ff>, /* TM */
+			      <0xc222000 0x1ff>; /* SROT */
+			#qcom,sensors = <13>;
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: tsens at c223000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc265000 0x1ff>, /* TM */
+			      <0xc223000 0x1ff>; /* SROT */
+			#qcom,sensors = <8>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		spmi_bus: spmi at c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0x1100>,
-- 
2.7.4

Re: [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

From: Amit Kucheria <hidden>
Date: 2018-07-02 14:00:19

On Mon, Jul 2, 2018 at 6:14 PM, Amit Kucheria [off-list ref] wrote:
This series is a mixed bag:
- Some code moves to allow code sharing between various v2.x.y versions of
  the TSENS IP,
- new qcom,tsens-v2.4.0 DT property for SDM845 and a generic qcom,tsens-v2
  property as a fallback compatible for all v2.x.y platforms,
- new platform support (sdm845)
- a cleanup patch and
- a DT change to have a common way to deal with the SROT and TM registers
  despite slightly different features across the IP family and different
  register offsets.

Rob mentioned offline that we should expose the full version string of the
TSENS IP (x.y.z) and have a fallback compatible. I hope patch 4 does what
you were looking for.

Regards,
Amit
Forgot to append the changelog. Here it is.

Changes since v3:
- Introduce qcom,tsens-v2.4.0 property and make qcom,tsens-v2 a
  fallback, compatible property.
- Rename ops_v2 to ops_generic_v2

Changes since v2:
- Based on review, moved tsens-8996.c to tsens-v2.c and changed
  corresponding function names, struct names to allow for generic tsensv2
  platforms
- All v2 platforms will now only need to use the qcom,tsen-v2 property
- Added a DT patch to initialize tsens driver on sdm845, now that 4.18-rc1
  will contain an sdm845.dtsi

Changes since v1:
- Move get_temp() from tsens-8996 to tsens-common and rename
- Change 8996 DT entry to allow init_common() to work across sdm845 and
  8996 due to different offsets
Amit Kucheria (6):
  thermal: tsens: Get rid of unused fields in structure
  dt: qcom: 8996: thermal: Move to DT initialisation
  thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse
  thermal: tsens: Add support for SDM845
  thermal: tsens: Check if we have valid data before reading
  arm64: dts: sdm845: Add tsens nodes

 .../devicetree/bindings/thermal/qcom-tsens.txt     |  2 ++
 arch/arm64/boot/dts/qcom/msm8996.dtsi              | 12 ++++++-
 arch/arm64/boot/dts/qcom/sdm845.dtsi               | 16 +++++++++
 drivers/thermal/qcom/Makefile                      |  2 +-
 drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c}  | 39 ++++++++++++----------
 drivers/thermal/qcom/tsens.c                       |  6 ++++
 drivers/thermal/qcom/tsens.h                       |  7 ++--
 7 files changed, 62 insertions(+), 22 deletions(-)
 rename drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} (66%)

--
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

From: Eduardo Valentin <edubezval@gmail.com>
Date: 2018-07-02 17:54:05

On Mon, Jul 02, 2018 at 06:14:03PM +0530, Amit Kucheria wrote:
This series is a mixed bag:
- Some code moves to allow code sharing between various v2.x.y versions of
  the TSENS IP,
- new qcom,tsens-v2.4.0 DT property for SDM845 and a generic qcom,tsens-v2
  property as a fallback compatible for all v2.x.y platforms,
- new platform support (sdm845)
- a cleanup patch and
- a DT change to have a common way to deal with the SROT and TM registers
  despite slightly different features across the IP family and different
  register offsets.

Rob mentioned offline that we should expose the full version string of the
TSENS IP (x.y.z) and have a fallback compatible. I hope patch 4 does what
you were looking for.
Applied patches 1, 3, and 4. Patch 5 needs a description. Patches 2 and
6 go via your arch tree.
Regards,
Amit

Amit Kucheria (6):
  thermal: tsens: Get rid of unused fields in structure
  dt: qcom: 8996: thermal: Move to DT initialisation
  thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse
  thermal: tsens: Add support for SDM845
  thermal: tsens: Check if we have valid data before reading
  arm64: dts: sdm845: Add tsens nodes

 .../devicetree/bindings/thermal/qcom-tsens.txt     |  2 ++
 arch/arm64/boot/dts/qcom/msm8996.dtsi              | 12 ++++++-
 arch/arm64/boot/dts/qcom/sdm845.dtsi               | 16 +++++++++
 drivers/thermal/qcom/Makefile                      |  2 +-
 drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c}  | 39 ++++++++++++----------
 drivers/thermal/qcom/tsens.c                       |  6 ++++
 drivers/thermal/qcom/tsens.h                       |  7 ++--
 7 files changed, 62 insertions(+), 22 deletions(-)
 rename drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} (66%)

-- 
2.7.4

Re: [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation

From: Bjorn Andersson <hidden>
Date: 2018-07-02 18:45:42

On Mon 02 Jul 05:44 PDT 2018, Amit Kucheria wrote:
We also split up the regmap address space into two, one for the TM
registers, the other for the SROT registers. This was required to deal with
different address offsets for the TM and SROT registers across different
SoC families.

Since tsens-common.c/init_common() currently only registers one address
space, the order is important (TM before SROT). This is OK since the code
doesn't really use the SROT functionality yet.

Signed-off-by: Amit Kucheria <redacted>
Reviewed-by: Bjorn Andersson <redacted>

Regards,
Bjorn
quoted hunk
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 8c7f9ca..6c8a857 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -461,7 +461,17 @@
 
 		tsens0: thermal-sensor at 4a8000 {
 			compatible = "qcom,msm8996-tsens";
-			reg = <0x4a8000 0x2000>;
+			reg = <0x4a9000 0x1000>, /* TM */
+			      <0x4a8000 0x1000>; /* SROT */
+			#qcom,sensors = <13>;
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: thermal-sensor at 4ac000 {
+			compatible = "qcom,msm8996-tsens";
+			reg = <0x4ad000 0x1000>, /* TM */
+			      <0x4ac000 0x1000>; /* SROT */
+			#qcom,sensors = <8>;
 			#thermal-sensor-cells = <1>;
 		};
 
-- 
2.7.4

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Bjorn Andersson <hidden>
Date: 2018-07-02 18:48:34

On Mon 02 Jul 05:44 PDT 2018, Amit Kucheria wrote:
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
Reviewed-by: Bjorn Andersson <redacted>

Regards,
Bjorn
quoted hunk
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
 			#interrupt-cells = <2>;
 		};
 
+		tsens0: tsens at c222000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc263000 0x1ff>, /* TM */
+			      <0xc222000 0x1ff>; /* SROT */
+			#qcom,sensors = <13>;
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: tsens at c223000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc265000 0x1ff>, /* TM */
+			      <0xc223000 0x1ff>; /* SROT */
+			#qcom,sensors = <8>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		spmi_bus: spmi at c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0x1100>,
-- 
2.7.4

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Matthias Kaehlcke <mka@chromium.org>
Date: 2018-07-03 21:48:30

Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
quoted hunk
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
 			#interrupt-cells = <2>;
 		};
 
+		tsens0: tsens at c222000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc263000 0x1ff>, /* TM */
+			      <0xc222000 0x1ff>; /* SROT */
+			#qcom,sensors = <13>;
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: tsens at c223000 {
+			compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+			reg = <0xc265000 0x1ff>, /* TM */
+			      <0xc223000 0x1ff>; /* SROT */
+			#qcom,sensors = <8>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		spmi_bus: spmi at c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0x1100>,
I tested this series on an SDM845 board. Temperatures can be read from
the tsens0 sensors, however for tsens1 sensors I get:

cat temp
cat: temp: No data available

TRDY_READY_BIT set when reading TRDY_OFFSET in get_temp_tsens_v2().
Unfortunately I currently have no documentation of the registers or the
thermal sensors in general and couldn't investigate further.

Any idea what could be the problem?

Thanks

Matthias

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Stephen Boyd <hidden>
Date: 2018-07-06 17:31:23

Quoting Amit Kucheria (2018-07-02 05:44:09)
quoted hunk
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                        #interrupt-cells = <2>;
                };
 
+               tsens0: tsens at c222000 {
These unit addresses should match the first reg property, not the second
one.
+                       compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                       reg = <0xc263000 0x1ff>, /* TM */
+                             <0xc222000 0x1ff>; /* SROT */
+                       #qcom,sensors = <13>;
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: tsens at c223000 {
+                       compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                       reg = <0xc265000 0x1ff>, /* TM */
+                             <0xc223000 0x1ff>; /* SROT */
+                       #qcom,sensors = <8>;

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Amit Kucheria <hidden>
Date: 2018-07-09 11:26:59

On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke [off-list ref] wrote:
Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
quoted
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                      #interrupt-cells = <2>;
              };

+             tsens0: tsens at c222000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc263000 0x1ff>, /* TM */
+                           <0xc222000 0x1ff>; /* SROT */
+                     #qcom,sensors = <13>;
+                     #thermal-sensor-cells = <1>;
+             };
+
+             tsens1: tsens at c223000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc265000 0x1ff>, /* TM */
+                           <0xc223000 0x1ff>; /* SROT */
+                     #qcom,sensors = <8>;
+                     #thermal-sensor-cells = <1>;
+             };
+
              spmi_bus: spmi at c440000 {
                      compatible = "qcom,spmi-pmic-arb";
                      reg = <0xc440000 0x1100>,
I tested this series on an SDM845 board. Temperatures can be read from
the tsens0 sensors, however for tsens1 sensors I get:

cat temp
cat: temp: No data available

TRDY_READY_BIT set when reading TRDY_OFFSET in get_temp_tsens_v2().
Unfortunately I currently have no documentation of the registers or the
thermal sensors in general and couldn't investigate further.

Any idea what could be the problem?
Strangely enough, I'm seeing this now after rebuilding my integration
branch to test some other bits.

I've sent another version with this patch removed while I investigate
this. Could you check if you're able to read all 8 sensors with v5?

Regards,
Amit

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Amit Kucheria <hidden>
Date: 2018-07-09 11:27:37

On Fri, Jul 6, 2018 at 11:01 PM, Stephen Boyd [off-list ref] wrote:
Quoting Amit Kucheria (2018-07-02 05:44:09)
quoted
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                        #interrupt-cells = <2>;
                };

+               tsens0: tsens at c222000 {
These unit addresses should match the first reg property, not the second
one.
Fixed in v5. Thanks.
quoted
+                       compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                       reg = <0xc263000 0x1ff>, /* TM */
+                             <0xc222000 0x1ff>; /* SROT */
+                       #qcom,sensors = <13>;
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: tsens at c223000 {
+                       compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                       reg = <0xc265000 0x1ff>, /* TM */
+                             <0xc223000 0x1ff>; /* SROT */
+                       #qcom,sensors = <8>;
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

From: Amit Kucheria <hidden>
Date: 2018-07-09 11:30:55

On Mon, Jul 2, 2018 at 11:23 PM, Eduardo Valentin [off-list ref] wrote:
On Mon, Jul 02, 2018 at 06:14:03PM +0530, Amit Kucheria wrote:
quoted
This series is a mixed bag:
- Some code moves to allow code sharing between various v2.x.y versions of
  the TSENS IP,
- new qcom,tsens-v2.4.0 DT property for SDM845 and a generic qcom,tsens-v2
  property as a fallback compatible for all v2.x.y platforms,
- new platform support (sdm845)
- a cleanup patch and
- a DT change to have a common way to deal with the SROT and TM registers
  despite slightly different features across the IP family and different
  register offsets.

Rob mentioned offline that we should expose the full version string of the
TSENS IP (x.y.z) and have a fallback compatible. I hope patch 4 does what
you were looking for.
Applied patches 1, 3, and 4. Patch 5 needs a description. Patches 2 and
6 go via your arch tree.
Hi Eduardo,

I've sent v5 for this series. It fixes a breakage for old DTs with new
code. Also, Rob decided he was happier with the earlier single
fallback binding. Please consider applying the new series.

Regards,
Amit

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Matthias Kaehlcke <mka@chromium.org>
Date: 2018-07-09 16:01:51

On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke [off-list ref] wrote:
quoted
Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
quoted
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                      #interrupt-cells = <2>;
              };

+             tsens0: tsens at c222000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc263000 0x1ff>, /* TM */
+                           <0xc222000 0x1ff>; /* SROT */
+                     #qcom,sensors = <13>;
+                     #thermal-sensor-cells = <1>;
+             };
+
+             tsens1: tsens at c223000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc265000 0x1ff>, /* TM */
+                           <0xc223000 0x1ff>; /* SROT */
+                     #qcom,sensors = <8>;
+                     #thermal-sensor-cells = <1>;
+             };
+
              spmi_bus: spmi at c440000 {
                      compatible = "qcom,spmi-pmic-arb";
                      reg = <0xc440000 0x1100>,
I tested this series on an SDM845 board. Temperatures can be read from
the tsens0 sensors, however for tsens1 sensors I get:

cat temp
cat: temp: No data available

TRDY_READY_BIT set when reading TRDY_OFFSET in get_temp_tsens_v2().
Unfortunately I currently have no documentation of the registers or the
thermal sensors in general and couldn't investigate further.

Any idea what could be the problem?
Strangely enough, I'm seeing this now after rebuilding my integration
branch to test some other bits.

I've sent another version with this patch removed while I investigate
this. Could you check if you're able to read all 8 sensors with v5?
With v6 all sensors can be read, thanks!

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Amit Kucheria <hidden>
Date: 2018-07-09 16:05:03

On Mon, Jul 9, 2018 at 9:31 PM, Matthias Kaehlcke [off-list ref] wrote:
On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
quoted
On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke [off-list ref] wrote:
quoted
Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
quoted
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                      #interrupt-cells = <2>;
              };

+             tsens0: tsens at c222000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc263000 0x1ff>, /* TM */
+                           <0xc222000 0x1ff>; /* SROT */
+                     #qcom,sensors = <13>;
+                     #thermal-sensor-cells = <1>;
+             };
+
+             tsens1: tsens at c223000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc265000 0x1ff>, /* TM */
+                           <0xc223000 0x1ff>; /* SROT */
+                     #qcom,sensors = <8>;
+                     #thermal-sensor-cells = <1>;
+             };
+
              spmi_bus: spmi at c440000 {
                      compatible = "qcom,spmi-pmic-arb";
                      reg = <0xc440000 0x1100>,
I tested this series on an SDM845 board. Temperatures can be read from
the tsens0 sensors, however for tsens1 sensors I get:

cat temp
cat: temp: No data available

TRDY_READY_BIT set when reading TRDY_OFFSET in get_temp_tsens_v2().
Unfortunately I currently have no documentation of the registers or the
thermal sensors in general and couldn't investigate further.

Any idea what could be the problem?
Strangely enough, I'm seeing this now after rebuilding my integration
branch to test some other bits.

I've sent another version with this patch removed while I investigate
this. Could you check if you're able to read all 8 sensors with v5?
With v6 all sensors can be read, thanks!
Great! Would it be OK to add your Tested-by tag?

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

From: Matthias Kaehlcke <mka@chromium.org>
Date: 2018-07-09 16:10:30

On Mon, Jul 09, 2018 at 09:34:55PM +0530, Amit Kucheria wrote:
On Mon, Jul 9, 2018 at 9:31 PM, Matthias Kaehlcke [off-list ref] wrote:
quoted
On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
quoted
On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke [off-list ref] wrote:
quoted
Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
quoted
SDM845 has two tsens blocks, one with 13 sensors and the other with 8
sensors.

Signed-off-by: Amit Kucheria <redacted>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index cdaabeb..edf8505 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,22 @@
                      #interrupt-cells = <2>;
              };

+             tsens0: tsens at c222000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc263000 0x1ff>, /* TM */
+                           <0xc222000 0x1ff>; /* SROT */
+                     #qcom,sensors = <13>;
+                     #thermal-sensor-cells = <1>;
+             };
+
+             tsens1: tsens at c223000 {
+                     compatible = "qcom,tsens-v2.4.0", "qcom,tsens-v2";
+                     reg = <0xc265000 0x1ff>, /* TM */
+                           <0xc223000 0x1ff>; /* SROT */
+                     #qcom,sensors = <8>;
+                     #thermal-sensor-cells = <1>;
+             };
+
              spmi_bus: spmi at c440000 {
                      compatible = "qcom,spmi-pmic-arb";
                      reg = <0xc440000 0x1100>,
I tested this series on an SDM845 board. Temperatures can be read from
the tsens0 sensors, however for tsens1 sensors I get:

cat temp
cat: temp: No data available

TRDY_READY_BIT set when reading TRDY_OFFSET in get_temp_tsens_v2().
Unfortunately I currently have no documentation of the registers or the
thermal sensors in general and couldn't investigate further.

Any idea what could be the problem?
Strangely enough, I'm seeing this now after rebuilding my integration
branch to test some other bits.

I've sent another version with this patch removed while I investigate
this. Could you check if you're able to read all 8 sensors with v5?
With v6 all sensors can be read, thanks!
Great! Would it be OK to add your Tested-by tag?
Yep
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help