linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP
@ 2018-07-02 12:44 Amit Kucheria
  2018-07-02 12:44 ` [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Amit Kucheria @ 2018-07-02 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation
  2018-07-02 12:44 [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
@ 2018-07-02 12:44 ` Amit Kucheria
  2018-07-02 18:48   ` Bjorn Andersson
  2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Amit Kucheria @ 2018-07-02 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

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 <amit.kucheria@linaro.org>
---
 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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-02 12:44 [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
  2018-07-02 12:44 ` [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
@ 2018-07-02 12:44 ` Amit Kucheria
  2018-07-02 18:50   ` Bjorn Andersson
                     ` (2 more replies)
  2018-07-02 14:00 ` [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
  2018-07-02 17:53 ` Eduardo Valentin
  3 siblings, 3 replies; 15+ messages in thread
From: Amit Kucheria @ 2018-07-02 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
 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

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

* [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP
  2018-07-02 12:44 [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
  2018-07-02 12:44 ` [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
  2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
@ 2018-07-02 14:00 ` Amit Kucheria
  2018-07-02 17:53 ` Eduardo Valentin
  3 siblings, 0 replies; 15+ messages in thread
From: Amit Kucheria @ 2018-07-02 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 2, 2018 at 6:14 PM, Amit Kucheria <amit.kucheria@linaro.org> 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

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

* [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP
  2018-07-02 12:44 [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
                   ` (2 preceding siblings ...)
  2018-07-02 14:00 ` [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
@ 2018-07-02 17:53 ` Eduardo Valentin
  2018-07-09 11:30   ` Amit Kucheria
  3 siblings, 1 reply; 15+ messages in thread
From: Eduardo Valentin @ 2018-07-02 17:53 UTC (permalink / raw)
  To: linux-arm-kernel

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
> 

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

* [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation
  2018-07-02 12:44 ` [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
@ 2018-07-02 18:48   ` Bjorn Andersson
  0 siblings, 0 replies; 15+ messages in thread
From: Bjorn Andersson @ 2018-07-02 18:48 UTC (permalink / raw)
  To: linux-arm-kernel

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 <amit.kucheria@linaro.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
@ 2018-07-02 18:50   ` Bjorn Andersson
  2018-07-03 21:48   ` Matthias Kaehlcke
  2018-07-06 17:31   ` Stephen Boyd
  2 siblings, 0 replies; 15+ messages in thread
From: Bjorn Andersson @ 2018-07-02 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

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 <amit.kucheria@linaro.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
  2018-07-02 18:50   ` Bjorn Andersson
@ 2018-07-03 21:48   ` Matthias Kaehlcke
  2018-07-09 11:26     ` Amit Kucheria
  2018-07-06 17:31   ` Stephen Boyd
  2 siblings, 1 reply; 15+ messages in thread
From: Matthias Kaehlcke @ 2018-07-03 21:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
> sensors.
> 
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
>  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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
  2018-07-02 18:50   ` Bjorn Andersson
  2018-07-03 21:48   ` Matthias Kaehlcke
@ 2018-07-06 17:31   ` Stephen Boyd
  2018-07-09 11:27     ` Amit Kucheria
  2 siblings, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2018-07-06 17:31 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Amit Kucheria (2018-07-02 05:44:09)
> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
> sensors.
> 
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
>  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>;

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-03 21:48   ` Matthias Kaehlcke
@ 2018-07-09 11:26     ` Amit Kucheria
  2018-07-09 16:01       ` Matthias Kaehlcke
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Kucheria @ 2018-07-09 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> Hi,
>
> On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
>> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
>> sensors.
>>
>> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
>> ---
>>  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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-06 17:31   ` Stephen Boyd
@ 2018-07-09 11:27     ` Amit Kucheria
  0 siblings, 0 replies; 15+ messages in thread
From: Amit Kucheria @ 2018-07-09 11:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 6, 2018 at 11:01 PM, Stephen Boyd <swboyd@chromium.org> wrote:
> Quoting Amit Kucheria (2018-07-02 05:44:09)
>> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
>> sensors.
>>
>> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
>> ---
>>  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.

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

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

* [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP
  2018-07-02 17:53 ` Eduardo Valentin
@ 2018-07-09 11:30   ` Amit Kucheria
  0 siblings, 0 replies; 15+ messages in thread
From: Amit Kucheria @ 2018-07-09 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 2, 2018 at 11:23 PM, Eduardo Valentin <edubezval@gmail.com> wrote:
> 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.

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

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-09 11:26     ` Amit Kucheria
@ 2018-07-09 16:01       ` Matthias Kaehlcke
  2018-07-09 16:04         ` Amit Kucheria
  0 siblings, 1 reply; 15+ messages in thread
From: Matthias Kaehlcke @ 2018-07-09 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
> On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> > Hi,
> >
> > On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
> >> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
> >> sensors.
> >>
> >> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> >> ---
> >>  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!

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-09 16:01       ` Matthias Kaehlcke
@ 2018-07-09 16:04         ` Amit Kucheria
  2018-07-09 16:10           ` Matthias Kaehlcke
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Kucheria @ 2018-07-09 16:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 9, 2018 at 9:31 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
>> On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
>> > Hi,
>> >
>> > On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
>> >> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
>> >> sensors.
>> >>
>> >> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
>> >> ---
>> >>  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?

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

* [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes
  2018-07-09 16:04         ` Amit Kucheria
@ 2018-07-09 16:10           ` Matthias Kaehlcke
  0 siblings, 0 replies; 15+ messages in thread
From: Matthias Kaehlcke @ 2018-07-09 16:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 09, 2018 at 09:34:55PM +0530, Amit Kucheria wrote:
> On Mon, Jul 9, 2018 at 9:31 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> > On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote:
> >> On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> >> > Hi,
> >> >
> >> > On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote:
> >> >> SDM845 has two tsens blocks, one with 13 sensors and the other with 8
> >> >> sensors.
> >> >>
> >> >> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> >> >> ---
> >> >>  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

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

end of thread, other threads:[~2018-07-09 16:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 12:44 [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
2018-07-02 12:44 ` [PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
2018-07-02 18:48   ` Bjorn Andersson
2018-07-02 12:44 ` [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
2018-07-02 18:50   ` Bjorn Andersson
2018-07-03 21:48   ` Matthias Kaehlcke
2018-07-09 11:26     ` Amit Kucheria
2018-07-09 16:01       ` Matthias Kaehlcke
2018-07-09 16:04         ` Amit Kucheria
2018-07-09 16:10           ` Matthias Kaehlcke
2018-07-06 17:31   ` Stephen Boyd
2018-07-09 11:27     ` Amit Kucheria
2018-07-02 14:00 ` [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
2018-07-02 17:53 ` Eduardo Valentin
2018-07-09 11:30   ` Amit Kucheria

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