Skip to contentSkip to conversation

PMU, rpm-stats and IMEM for MSM8226

PATCH Applied Matti Lehtimäki 3 participants 9 messages May 20, 2023 – May 25, 2023

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

v2 cover PMU, rpm-stats and IMEM for MSM8226

This series adds PMU, rpm-stats and IMEM nodes for MSM8226. It also defines reboot modes for MSM8226.

Changes in v2:
- Use constants instead of magic number in PMU node
- Always enable IMEM node
- Move reboot-mode magic numbers to platform,
those should be always the same, drop patch for matisse-wifi

Matti Lehtimäki (4):
dt-bindings: sram: qcom,imem: Document MSM8226
ARM: dts: qcom: msm8226: Add PMU node
ARM: dts: qcom: msm8226: Add rpm-stats device node
ARM: dts: qcom: msm8226: Add IMEM node

 .../devicetree/bindings/sram/qcom,imem.yaml   |  1 +
 arch/arm/boot/dts/qcom-msm8226.dtsi           | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 dt-bindings: sram: qcom,imem: Document MSM8226

Add compatible for MSM8226 IMEM.

---
 Documentation/devicetree/bindings/sram/qcom,imem.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/sram/qcom,imem.yaml +1 -0
index ba694ce4a037..318acd129ff9 100644
@@ -18,6 +18,7 @@ properties:
     items:
       - enum:
           - qcom,apq8064-imem
+          - qcom,msm8226-imem
           - qcom,msm8974-imem
           - qcom,qcs404-imem
           - qcom,sc7180-imem
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/4 ARM: dts: qcom: msm8226: Add PMU node

In reply to Matti Lehtimäki

Enable perf events on MSM8226 devices by adding the PMU node.

---
Changes in v2:
- Use constants instead of magic number

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/qcom-msm8226.dtsi +6 -0
index c373081bc21b..cb4b4a6d0447 100644
@@ -46,6 +46,12 @@ scm {
 		};
 	};
 
+	pmu {
+		compatible = "arm,cortex-a7-pmu";
+		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
+					 IRQ_TYPE_LEVEL_HIGH)>;
+	};
+
 	reserved-memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 1 line
2.34.1
Reviewed-by on v2 2/4
#3 lore raw

Re: [PATCH v2 2/4] ARM: dts: qcom: msm8226: Add PMU node

Quoted 3 lines · On Samstag, 20. Mai 2023 14:19:31 CEST Matti Lehtimäki wrote:

Enable perf events on MSM8226 devices by adding the PMU node.

Quoted 25 lines

---
Changes in v2:
- Use constants instead of magic number

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/qcom-msm8226.dtsi index c373081bc21b..cb4b4a6d0447 100644

arch/arm/boot/dts/qcom-msm8226.dtsi +6 -0
@@ -46,6 +46,12 @@ scm {
 		};
 	};
 
+	pmu {
+		compatible = "arm,cortex-a7-pmu";
+		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
+					 IRQ_TYPE_LEVEL_HIGH)>;
+	};
+
 	reserved-memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
#4 lore raw

PATCH v2 3/4 ARM: dts: qcom: msm8226: Add rpm-stats device node

In reply to Matti Lehtimäki

Add device node for the rpm-stats pseudo device.

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/qcom-msm8226.dtsi +5 -0
index cb4b4a6d0447..8644540f5aae 100644
@@ -592,6 +592,11 @@ frame@f9028000 {
 			};
 		};
 
+		sram@fc190000 {
+			compatible = "qcom,msm8226-rpm-stats";
+			reg = <0xfc190000 0x10000>;
+		};
+
 		rpm_msg_ram: sram@fc428000 {
 			compatible = "qcom,rpm-msg-ram";
 			reg = <0xfc428000 0x4000>;
Signature · 1 line
2.34.1
Reviewed-by on v2 3/4
#5 lore raw

Re: [PATCH v2 3/4] ARM: dts: qcom: msm8226: Add rpm-stats device node

Quoted 4 lines · On Samstag, 20. Mai 2023 14:19:32 CEST Matti Lehtimäki wrote:

Add device node for the rpm-stats pseudo device.

Quoted 21 lines
---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/qcom-msm8226.dtsi index cb4b4a6d0447..8644540f5aae 100644

arch/arm/boot/dts/qcom-msm8226.dtsi +5 -0
@@ -592,6 +592,11 @@ frame@f9028000 {
 			};
 		};
 
+		sram@fc190000 {
+			compatible = "qcom,msm8226-rpm-stats";
+			reg = <0xfc190000 0x10000>;
+		};
+
 		rpm_msg_ram: sram@fc428000 {
 			compatible = "qcom,rpm-msg-ram";
 			reg = <0xfc428000 0x4000>;
#6 lore raw

PATCH v2 4/4 ARM: dts: qcom: msm8226: Add IMEM node

In reply to Matti Lehtimäki

This enables userspace to signal the bootloader to go into the bootloader or recovery mode.

The magic values can be found in both the downstream kernel and the LK kernel (bootloader).

---
Changes in v2:
- Always enable IMEM node
- Move reboot-mode magic numbers to platform,
those should be always the same

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/qcom-msm8226.dtsi +14 -0
index 8644540f5aae..284b7c666fea 100644
@@ -641,6 +641,20 @@ smd-edge {
 				label = "lpass";
 			};
 		};
+
+		sram@fe805000 {
+			compatible = "qcom,msm8226-imem", "syscon", "simple-mfd";
+			reg = <0xfe805000 0x1000>;
+
+			reboot-mode {
+				compatible = "syscon-reboot-mode";
+				offset = <0x65c>;
+
+				mode-bootloader = <0x77665500>;
+				mode-normal     = <0x77665501>;
+				mode-recovery   = <0x77665502>;
+			};
+		};
 	};
 
 	timer {
Signature · 1 line
2.34.1
Reviewed-by on v2 4/4
#7 lore raw

Re: [PATCH v2 4/4] ARM: dts: qcom: msm8226: Add IMEM node

Quoted 7 lines · On Samstag, 20. Mai 2023 14:19:33 CEST Matti Lehtimäki wrote:

This enables userspace to signal the bootloader to go into the bootloader or recovery mode.

The magic values can be found in both the downstream kernel and the LK kernel (bootloader).

Quoted 15 lines

---
Changes in v2:
- Always enable IMEM node
- Move reboot-mode magic numbers to platform,
those should be always the same

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/qcom-msm8226.dtsi index 8644540f5aae..284b7c666fea 100644

arch/arm/boot/dts/qcom-msm8226.dtsi smd-edge { · line 646

Quoted 6 lines
arch/arm/boot/dts/qcom-msm8226.dtsi +3 -0
@@ -641,6 +641,20 @@ smd-edge {
 				label = "lpass";
 			};
 		};
+
+		sram@fe805000 {
+			compatible = "qcom,msm8226-imem", "syscon", 

"simple-mfd";

Quoted 14 lines
arch/arm/boot/dts/qcom-msm8226.dtsi +11 -0
+			reg = <0xfe805000 0x1000>;
+
+			reboot-mode {
+				compatible = "syscon-reboot-mode";
+				offset = <0x65c>;
+
+				mode-bootloader = <0x77665500>;
+				mode-normal     = <0x77665501>;
+				mode-recovery   = <0x77665502>;
+			};
+		};
 	};
 
 	timer {
#8 lore raw

Re: (subset) [PATCH v2 0/4] PMU, rpm-stats and IMEM for MSM8226

In reply to Matti Lehtimäki
Quoted 10 lines · Matti Lehtimäki

This series adds PMU, rpm-stats and IMEM nodes for MSM8226. It also defines reboot modes for MSM8226.

Changes in v2:
- Use constants instead of magic number in PMU node
- Always enable IMEM node
- Move reboot-mode magic numbers to platform,
those should be always the same, drop patch for matisse-wifi

[...]

Applied, thanks!

[2/4] ARM: dts: qcom: msm8226: Add PMU node

      commit: fbc669e65fa3b4fe417c14ea194057140d7f3d74
[3/4] ARM: dts: qcom: msm8226: Add rpm-stats device node
      commit: c1ba26f1a00f560f143336dc29eb6524be333a75
[4/4] ARM: dts: qcom: msm8226: Add IMEM node
      commit: 94aca310e66d953c1676e71754744f181d6fe5f9

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>