diff mbox series

[v4,3/3] ARM: dts: qcom: msm8974: switch TCSR mutex to MMIO

Message ID 20220920150414.637634-4-krzysztof.kozlowski@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series ARM/hwlock: qcom: switch TCSR mutex to MMIO (msm8974) | expand

Commit Message

Krzysztof Kozlowski Sept. 20, 2022, 3:04 p.m. UTC
The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable, as
TCSR mutex is actually a dedicated IO address space, and it also fixes
DT schema checks:

  qcom-msm8974-sony-xperia-rhine-amami.dtb: tcsr-mutex: 'reg' is a required property
  qcom-msm8974-sony-xperia-rhine-amami.dtb: tcsr-mutex: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Comments

Alexey Minnekhanov Sept. 21, 2022, 8:55 p.m. UTC | #1
Hi,

On 20.09.2022 18:04, Krzysztof Kozlowski wrote:

> -	tcsr_mutex: tcsr-mutex {
> -		compatible = "qcom,tcsr-mutex";
> -		syscon = <&tcsr_mutex_block 0 0x80>;

I'm looking and don't understand where does this information go, is it 
lost in the conversion? I mean those "0 0x80" parameters to syscon 
reference.

Looking at the code of qcom_hwspinlock driver those seem to be read by 
qcom_hwspinlock_probe_syscon() [1] using  of_property_read_u32_index() 
as base and stride values and those would be 0 nad 0x80 respectively as 
is now.

But without syscon reference, in mmio mode, code goes through 
qcom_hwspinlock_probe_mmio() few lines below, which says

	/* All modern platform has offset 0 and stride of 4k */
	*offset = 0;
	*stride = 0x1000;

So after this conversion stride value will jump from 0x80  to 0x1000, 
which does not seem to be 1 to 1 identical conversion to me, unless I am 
missing something.

Perhaps msm8974 does not fall into category of "All modern platform"?


[1] 
https://elixir.bootlin.com/linux/latest/source/drivers/hwspinlock/qcom_hwspinlock.c#L73
Krzysztof Kozlowski Sept. 22, 2022, 6:44 a.m. UTC | #2
On 21/09/2022 22:55, Alexey Minnekhanov wrote:
> Hi,
> 
> On 20.09.2022 18:04, Krzysztof Kozlowski wrote:
> 
>> -	tcsr_mutex: tcsr-mutex {
>> -		compatible = "qcom,tcsr-mutex";
>> -		syscon = <&tcsr_mutex_block 0 0x80>;
> 
> I'm looking and don't understand where does this information go, is it 
> lost in the conversion? I mean those "0 0x80" parameters to syscon 
> reference.

This compatible is using:
of_msm8226_tcsr_mutex
.stride = 0x80,

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index a4e12daf3eeb..7bc19b5375f6 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1194,7 +1194,7 @@  remoteproc_mss: remoteproc@fc880000 {
 			resets = <&gcc GCC_MSS_RESTART>;
 			reset-names = "mss_restart";
 
-			qcom,halt-regs = <&tcsr_mutex_block 0x1180 0x1200 0x1280>;
+			qcom,halt-regs = <&tcsr_mutex 0x1180 0x1200 0x1280>;
 
 			qcom,smem-states = <&modem_smp2p_out 0>;
 			qcom,smem-state-names = "stop";
@@ -1233,9 +1233,10 @@  smd-edge {
 			};
 		};
 
-		tcsr_mutex_block: syscon@fd484000 {
-			compatible = "syscon";
+		tcsr_mutex: hwlock@fd484000 {
+			compatible = "qcom,msm8974-tcsr-mutex", "qcom,tcsr-mutex", "syscon";
 			reg = <0xfd484000 0x2000>;
+			#hwlock-cells = <1>;
 		};
 
 		tcsr: syscon@fd4a0000 {
@@ -1719,13 +1720,6 @@  reboot-mode {
 		};
 	};
 
-	tcsr_mutex: tcsr-mutex {
-		compatible = "qcom,tcsr-mutex";
-		syscon = <&tcsr_mutex_block 0 0x80>;
-
-		#hwlock-cells = <1>;
-	};
-
 	thermal-zones {
 		cpu0-thermal {
 			polling-delay-passive = <250>;